summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/src/wlan_hdd_tdls.c45
-rw-r--r--CORE/MAC/src/pe/lim/limProcessTdls.c2
2 files changed, 32 insertions, 15 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c
index 3f21a024540f..35ee975f4d7e 100644
--- a/CORE/HDD/src/wlan_hdd_tdls.c
+++ b/CORE/HDD/src/wlan_hdd_tdls.c
@@ -186,6 +186,7 @@ void hdd_wlan_block_scan_by_tdls_event(void)
void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
{
u16 connected_tdls_peers = 0;
+ hddTdlsPeer_t *curr_peer;
u8 staidx;
hdd_adapter_t *adapter = NULL;
@@ -230,25 +231,39 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
for (staidx = 0; staidx < hddctx->max_num_tdls_sta;
staidx++) {
- if (hddctx->tdlsConnInfo[staidx].staId) {
- wlan_hdd_tdls_reset_peer(adapter,
- hddctx->tdlsConnInfo[staidx].peerMac.bytes);
- hdd_roamDeregisterTDLSSTA(adapter,
- hddctx->tdlsConnInfo[staidx].staId );
- wlan_hdd_tdls_decrement_peer_count(adapter);
- wlan_hdd_tdls_reset_peer(adapter,
- hddctx->tdlsConnInfo[staidx].peerMac.bytes);
+ if (!hddctx->tdlsConnInfo[staidx].staId)
+ continue;
- hdd_send_wlan_tdls_teardown_event(
- eTDLS_TEARDOWN_CONCURRENCY,
+ curr_peer = wlan_hdd_tdls_find_all_peer(hddctx,
hddctx->tdlsConnInfo[staidx].peerMac.bytes);
+ if (!curr_peer)
+ continue;
- vos_mem_zero(&hddctx->tdlsConnInfo[staidx].peerMac,
- sizeof(v_MACADDR_t));
+ hddLog(LOG1, FL("indicate TDLS teardown (staId %d)"),
+ curr_peer->staId);
- hddctx->tdlsConnInfo[staidx].staId = 0;
- hddctx->tdlsConnInfo[staidx].sessionId = 255;
- }
+ /* Indicate teardown to supplicant */
+ wlan_hdd_tdls_indicate_teardown(
+ curr_peer->pHddTdlsCtx->pAdapter,
+ curr_peer,
+ eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
+
+ /*
+ * Del Sta happened already as part of sme_delete_all_tdls_peers
+ * Hence clear hdd data structure.
+ */
+ hdd_roamDeregisterTDLSSTA(adapter,
+ hddctx->tdlsConnInfo[staidx].staId);
+ wlan_hdd_tdls_decrement_peer_count(adapter);
+ wlan_hdd_tdls_reset_peer(adapter, curr_peer->peerMac);
+ hdd_send_wlan_tdls_teardown_event(eTDLS_TEARDOWN_CONCURRENCY,
+ curr_peer->peerMac);
+
+ hddctx->tdlsConnInfo[staidx].staId = 0;
+ hddctx->tdlsConnInfo[staidx].sessionId = 255;
+
+ vos_mem_zero(&hddctx->tdlsConnInfo[staidx].peerMac,
+ sizeof(v_MACADDR_t));
}
wlan_hdd_tdls_check_bmps(adapter);
}
diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c
index d657586db5a7..d94c09fc9254 100644
--- a/CORE/MAC/src/pe/lim/limProcessTdls.c
+++ b/CORE/MAC/src/pe/lim/limProcessTdls.c
@@ -3329,6 +3329,8 @@ static void lim_check_aid_and_delete_peer(tpAniSirGlobal p_mac,
eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
sta_ds->staAddr, session_entry,
FALSE);
+ limTdlsDelSta(p_mac, sta_ds->staAddr,
+ session_entry);
dphDeleteHashEntry(p_mac,
sta_ds->staAddr,
sta_ds->assocId,