From fd889b56fdc2d64750060d750f4256f83e4216da Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Fri, 24 Jun 2016 12:37:04 +0530 Subject: [PATCH] qcacld-3.0: Avoid race between user triggered disconnect and OTA disconnect qcacld-2.0 to qcacld-3.0 propagation Due to race between user triggered disconnect and OTA disconnect, On receiving OTA disconnect PE sends DISCONNECT_IND to SME and waits for conformation from SME. By the time if SME already received disconnect from user it will give PE DEAUTH_REQ instead of DIASSOC_CNF messgae. Upon receiving this PE will do the clean up and will send DEAUTH_RSP message. SME will also process DISASSOC_IND and will send eSmeCommandWmStatusChange. But this will be in pending queue as user triggered deauth is in progress as a SME active command. If this is processed after user initiated disconnect command, HDD will get two disconnects which cause mess up of eConnectionState_Disconnecting/eConnectionState_NotConnected states in hdd disconnect handler. Fix is to remove pending eSmeCommandWmStatusChange command after DEAUTH_RSP from SME. Git-commit: 7f0986129d00270d1b7bba3d671bba79ba323933 Change-Id: I004834785491ab7cf3e90371dfd1910c25d0bbef CRs-Fixed: 1003374 (cherry picked from commit 2b4f56c8dcbc292391d705993c7cd874c3dea008) --- core/sme/src/csr/csr_api_roam.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index d4f0d1bf113c..6508f2158e22 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -9340,9 +9340,18 @@ void csr_roaming_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf) break; case eWNI_SME_DEAUTH_RSP: /* or the Deauthentication response message... */ - if (CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, pSmeRsp->sessionId)) + if (CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(pMac, pSmeRsp->sessionId)) { + csr_remove_cmd_with_session_id_from_pending_list(pMac, + pSmeRsp->sessionId, + &pMac->sme.smeCmdPendingList, + eSmeCommandWmStatusChange); + csr_remove_cmd_with_session_id_from_pending_list(pMac, + pSmeRsp->sessionId, + &pMac->roam.roamCmdPendingList, + eSmeCommandWmStatusChange); csr_roam_roaming_state_deauth_rsp_processor(pMac, (tSirSmeDeauthRsp *) pSmeRsp); + } break; case eWNI_SME_START_BSS_RSP: /* or the Start BSS response message... */