From 440450989af84d95efbd9fe9c0c44c2687c3e4ca Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 9 Aug 2016 15:31:40 +0530 Subject: [PATCH] qcacld-3.0: Do not trigger del sta if it is already in progress qcacld-2.0 to qcacld-3.0 propagation If SAP receive auth from an already connected STA, it post eWNI_SME_DISASSOC_IND msg to SME to delete the STA context and return. STA may try to send auth again as it didnt receive auth resp. Now many frames (probe req, auth etc) may get accumulated in PE message queue and unless PE queue is fully processed SME queue will not be processed and thus del sta will get delayed. This may again cause STA to send more auth req and every time MC thread process an auth req before the sta is deleted, eWNI_SME_DISASSOC_IND msg is posted in SME message queue. And if PE keeps on getting auth before the sta is deleted, SME queue will pile up leading to crash. To fix this do not trigger del sta if it is already in progress. Change-Id: Icff3778d35ef7ea646463fe49c4335e260e9e156 CRs-Fixed: 982329 --- core/mac/src/dph/dph_hash_table.c | 2 ++ core/mac/src/include/dph_global.h | 1 + core/mac/src/pe/lim/lim_link_monitoring_algo.c | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c index 36afa51c8dbc..6ff817c03b5d 100644 --- a/core/mac/src/dph/dph_hash_table.c +++ b/core/mac/src/dph/dph_hash_table.c @@ -282,6 +282,7 @@ tpDphHashNode dph_init_sta_state(tpAniSirGlobal pMac, tSirMacAddr staAddr, #ifdef WLAN_FEATURE_11W pStaDs->last_assoc_received_time = 0; #endif + pStaDs->sta_deletion_in_progress = false; pStaDs->valid = 1; return pStaDs; } @@ -424,6 +425,7 @@ tSirRetStatus dph_delete_hash_entry(tpAniSirGlobal pMac, tSirMacAddr staAddr, #ifdef WLAN_FEATURE_11W ptr->last_assoc_received_time = 0; #endif + ptr->sta_deletion_in_progress = false; ptr->next = 0; } else { /* / Entry not present */ diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h index f10e6cba9bad..89bb6e0e85e1 100644 --- a/core/mac/src/include/dph_global.h +++ b/core/mac/src/include/dph_global.h @@ -241,6 +241,7 @@ typedef struct sDphHashNode { uint8_t nss; int8_t del_sta_ctx_rssi; + bool sta_deletion_in_progress; /* * When a station with already an existing dph entry tries to diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index 94b416000f09..923d9a2d4ffd 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -290,13 +290,16 @@ lim_trigger_sta_deletion(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, if ((sta_ds->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || (sta_ds->mlmStaContext.mlmState == - eLIM_MLM_WT_DEL_BSS_RSP_STATE)) { + eLIM_MLM_WT_DEL_BSS_RSP_STATE) || + sta_ds->sta_deletion_in_progress) { /* Already in the process of deleting context for the peer */ - lim_log(mac_ctx, LOGE, - FL("Deletion is in progress for peer:%pM"), - sta_ds->staAddr); + lim_log(mac_ctx, LOG1, + FL("Deletion is in progress (%d) for peer:%p in mlmState %d"), + sta_ds->sta_deletion_in_progress, sta_ds->staAddr, + sta_ds->mlmStaContext.mlmState); return; } + sta_ds->sta_deletion_in_progress = true; sta_ds->mlmStaContext.disassocReason = eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON;