qcacmn: Handle BSS peer in STA mode

1. Set BSS peer for AP during peer-create and for STA in peer-map handler
2. Set Self peer in STA mode
3. Avoid tid cleanup in STA mode
4. Remove redundant selfmac checks in Rx
5. In MEC event handler add a check to ignore MEC events
    when STA is not connected.

Change-Id: I2a34b4742d9dedaa0709c1f4c87f3a06b794f36b
This commit is contained in:
Chaitanya Kiran Godavarthi
2019-02-01 17:32:48 +05:30
committed by nshrivas
parent 110d691272
commit 70aeda1cdd
6 changed files with 20 additions and 35 deletions

View File

@@ -4720,7 +4720,7 @@ static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle,
goto free_vdev; goto free_vdev;
if (wlan_op_mode_sta == vdev->opmode) if (wlan_op_mode_sta == vdev->opmode)
dp_peer_delete_wifi3(vdev->vap_bss_peer, 0); dp_peer_delete_wifi3(vdev->vap_self_peer, 0);
/* /*
* If Target is hung, flush all peers before detaching vdev * If Target is hung, flush all peers before detaching vdev
@@ -5023,11 +5023,20 @@ static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle,
/* /*
* For every peer MAp message search and set if bss_peer * For every peer MAp message search and set if bss_peer
*/ */
if (memcmp(peer->mac_addr.raw, vdev->mac_addr.raw, 6) == 0) { if (qdf_mem_cmp(peer->mac_addr.raw, vdev->mac_addr.raw,
QDF_MAC_ADDR_SIZE) == 0 &&
(wlan_op_mode_sta != vdev->opmode)) {
dp_info("vdev bss_peer!!"); dp_info("vdev bss_peer!!");
peer->bss_peer = 1; peer->bss_peer = 1;
vdev->vap_bss_peer = peer; vdev->vap_bss_peer = peer;
} }
if (wlan_op_mode_sta == vdev->opmode &&
qdf_mem_cmp(peer->mac_addr.raw, vdev->mac_addr.raw,
QDF_MAC_ADDR_SIZE) == 0) {
vdev->vap_self_peer = peer;
}
for (i = 0; i < DP_MAX_TIDS; i++) for (i = 0; i < DP_MAX_TIDS; i++)
qdf_spinlock_create(&peer->rx_tid[i].tid_lock); qdf_spinlock_create(&peer->rx_tid[i].tid_lock);

View File

@@ -1446,13 +1446,11 @@ dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id,
hw_peer_id, vdev_id); hw_peer_id, vdev_id);
if (peer) { if (peer) {
/* if (wlan_op_mode_sta == peer->vdev->opmode &&
* For every peer Map message search and set if bss_peer qdf_mem_cmp(peer->mac_addr.raw,
*/ peer->vdev->mac_addr.raw,
if (!(qdf_mem_cmp(peer->mac_addr.raw, QDF_MAC_ADDR_SIZE) != 0) {
peer->vdev->mac_addr.raw, dp_info("STA vdev bss_peer!!!!");
QDF_MAC_ADDR_SIZE))) {
dp_info("vdev bss_peer!!!!");
peer->bss_peer = 1; peer->bss_peer = 1;
peer->vdev->vap_bss_peer = peer; peer->vdev->vap_bss_peer = peer;
} }
@@ -2186,7 +2184,7 @@ void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer)
struct dp_rx_tid *rx_tid = &peer->rx_tid[tid]; struct dp_rx_tid *rx_tid = &peer->rx_tid[tid];
qdf_spin_lock_bh(&rx_tid->tid_lock); qdf_spin_lock_bh(&rx_tid->tid_lock);
if (!peer->bss_peer) { if (!peer->bss_peer && peer->vdev->opmode != wlan_op_mode_sta) {
/* Cleanup defrag related resource */ /* Cleanup defrag related resource */
dp_rx_defrag_waitlist_remove(peer, tid); dp_rx_defrag_waitlist_remove(peer, tid);
dp_rx_reorder_flush_frag(peer, tid); dp_rx_reorder_flush_frag(peer, tid);

View File

@@ -2088,21 +2088,6 @@ done:
continue; continue;
} }
if (qdf_unlikely(peer && peer->bss_peer)) {
QDF_TRACE(QDF_MODULE_ID_DP,
QDF_TRACE_LEVEL_ERROR,
FL("received pkt with same src MAC"));
tid_stats->fail_cnt[MEC_DROP]++;
DP_STATS_INC_PKT(peer, rx.mec_drop, 1, msdu_len);
/* Drop & free packet */
qdf_nbuf_free(nbuf);
/* Statistics */
nbuf = next;
dp_peer_unref_del_find_by_id(peer);
continue;
}
if (qdf_unlikely(peer && (peer->nawds_enabled) && if (qdf_unlikely(peer && (peer->nawds_enabled) &&
(qdf_nbuf_is_da_mcbc(nbuf)) && (qdf_nbuf_is_da_mcbc(nbuf)) &&
(hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr) == (hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr) ==

View File

@@ -805,13 +805,6 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, qdf_nbuf_t nbuf,
qdf_nbuf_set_next(nbuf, NULL); qdf_nbuf_set_next(nbuf, NULL);
dp_rx_deliver_raw(vdev, nbuf, peer); dp_rx_deliver_raw(vdev, nbuf, peer);
} else { } else {
if (qdf_unlikely(peer->bss_peer)) {
dp_info_rl("received pkt with same src MAC");
DP_STATS_INC_PKT(peer, rx.mec_drop, 1,
qdf_nbuf_len(nbuf));
goto drop_nbuf;
}
if (vdev->osif_rx) { if (vdev->osif_rx) {
qdf_nbuf_set_next(nbuf, NULL); qdf_nbuf_set_next(nbuf, NULL);
DP_STATS_INC_PKT(peer, rx.to_stack, 1, DP_STATS_INC_PKT(peer, rx.to_stack, 1,

View File

@@ -2641,9 +2641,7 @@ void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
return; return;
soc = vdev->pdev->soc; soc = vdev->pdev->soc;
qdf_spin_lock_bh(&soc->peer_ref_mutex); peer = vdev->vap_bss_peer;
peer = TAILQ_FIRST(&vdev->peer_list);
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
if (!peer) { if (!peer) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,

View File

@@ -1768,6 +1768,8 @@ struct dp_vdev {
/* TIDmap priority */ /* TIDmap priority */
uint8_t tidmap_prty; uint8_t tidmap_prty;
/* Self Peer in STA mode */
struct dp_peer *vap_self_peer;
}; };