From 82051db26b1dbf08cf42c3b649b043b4c5ec42aa Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Tue, 20 Apr 2021 12:02:38 +0530 Subject: [PATCH] qcacld-3.0: Stop pmf comeback timer on deauth/disassoc rx For PMF connection, when host gets assoc response fail with reason "try again later" host runs PMF comeback timer to send assoc request on pmf timer expiry. While PMF timer is running, if host gets deauth/disassoc frame then host performs deauth/disassoc. As part part of deauth/disassoc host changes lim mlm states to WT_DEL_BSS/ WT_DEL_STA and after moving vdev to down state host processes DEL_BSS/DEL_STA response in LIM. At this stage expected lim mlm state is WT_DEL_BSS/WT_DEL_STA but if the pmf timer expires the pmf timer callback function changes lim mlm states to mlm states stored in comeback timer info struct without checking present lim mlm states. Thus while processing DEL_BSS/DEL_STA response, host fails to get PE session from vdev ID and lim mlm state WT_DEL_BSS/WT_DEL_STA. And disconnect indication to sme fails. To fix this, host stops pmf comeback timer while processing deauth/disassoc and change lim mlm state after checking present lim mlm state. Change-Id: If0094fcdb8254cb4271b5c46b4d42531dc9bc516 CRs-Fixed: 2925184 --- core/mac/src/pe/lim/lim_process_deauth_frame.c | 1 + core/mac/src/pe/lim/lim_process_disassoc_frame.c | 3 +++ core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_deauth_frame.c b/core/mac/src/pe/lim/lim_process_deauth_frame.c index 15d3a554f897..cb1d7ff412b2 100644 --- a/core/mac/src/pe/lim/lim_process_deauth_frame.c +++ b/core/mac/src/pe/lim/lim_process_deauth_frame.c @@ -391,6 +391,7 @@ void lim_perform_deauth(struct mac_context *mac_ctx, struct pe_session *pe_sessi if (lim_search_pre_auth_list(mac_ctx, addr)) lim_delete_pre_auth_node(mac_ctx, addr); + lim_stop_pmfcomeback_timer(pe_session); if (pe_session->pLimMlmJoinReq) { qdf_mem_free(pe_session->pLimMlmJoinReq); pe_session->pLimMlmJoinReq = NULL; diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c index 456dc72d9142..013128d961d8 100644 --- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c +++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c @@ -385,6 +385,9 @@ void lim_perform_disassoc(struct mac_context *mac_ctx, int32_t frame_rssi, /* Update PE session Id */ mlmDisassocInd.sessionId = pe_session->peSessionId; + if (LIM_IS_STA_ROLE(pe_session) && + (pe_session->limMlmState == eLIM_MLM_WT_ASSOC_RSP_STATE)) + lim_stop_pmfcomeback_timer(pe_session); if (lim_is_reassoc_in_progress(mac_ctx, pe_session)) { diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 46294e4cd68c..2da52592cd75 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -444,8 +444,15 @@ void lim_pmf_comeback_timer_callback(void *context) return; } - pe_info("comeback later timer expired. sending MLM ASSOC req for vdev %d", - session->vdev_id); + if (session->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) { + pe_debug("Don't send assoc req, timer expire when limMlmState %d vdev id %d", + session->limMlmState, session->vdev_id); + return; + } + + pe_info("comeback later timer expired. sending MLM ASSOC req for vdev %d, session limMlmState %d, info lim_mlm_state %d", + session->vdev_id, session->limMlmState, info->lim_mlm_state); + /* set MLM state such that ASSOC REQ packet will be sent out */ session->limPrevMlmState = info->lim_prev_mlm_state; session->limMlmState = info->lim_mlm_state;