summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaliu <kaliu@qti.qualcomm.com>2015-06-26 17:19:38 +0800
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-07-07 15:51:26 +0530
commit2939476a63f5b13e0783e2f773b3ac7fc9bb97c8 (patch)
tree10b82cd2dcb33b496f795b1e20bf33c9f5f54336
parent3501fa6bb301d5db65bd997caf620c9803beb82f (diff)
qcacld: stop multi-connect when cfg80211 issued disconnction
When wpa_supplicant issue connection, multi-candidate ap maybe found by driver. Driver will try to connect these candidates one by one until connection success or all candidates are tried. When receive disconnction cmd from cfg80211, stop connection immediately to avoid disconnction timeout, otherwise driver and cfg80211 maybe out of sync. Change-Id: I6daa59ad495bb91c0ed70846c7aa4ae96ba3507a CRs-Fixed: 816517
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 57a60798d2e4..43a1ebee98ff 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -7766,6 +7766,33 @@ eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionI
return (status);
}
+
+static boolean is_disconnect_pending(tpAniSirGlobal pmac,
+ uint8_t sessionid)
+{
+ tListElem *entry = NULL;
+ tListElem *next_entry = NULL;
+ tSmeCmd *command = NULL;
+ bool disconnect_cmd_exist = false;
+
+ csrLLLock(&pmac->sme.smeCmdPendingList);
+ entry = csrLLPeekHead(&pmac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK);
+ while (entry) {
+ next_entry = csrLLNext(&pmac->sme.smeCmdPendingList,
+ entry, LL_ACCESS_NOLOCK);
+
+ command = GET_BASE_ADDR(entry, tSmeCmd, Link);
+ if (command && CSR_IS_DISCONNECT_COMMAND(command) &&
+ command->sessionId == sessionid){
+ disconnect_cmd_exist = true;
+ break;
+ }
+ entry = next_entry;
+ }
+ csrLLUnlock(&pmac->sme.smeCmdPendingList);
+ return disconnect_cmd_exist;
+}
+
static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJoinRsp )
{
tListElem *pEntry = NULL;
@@ -7807,6 +7834,7 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
else
{
tANI_U32 roamId = 0;
+ bool is_dis_pending;
//The head of the active list is the request we sent
//Try to get back the same profile and roam again
if(pCommand)
@@ -7825,7 +7853,14 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
csrNeighborRoamIndicateConnect(pMac, pSmeJoinRsp->sessionId, VOS_STATUS_E_FAILURE);
}
#endif
- if (pCommand && (pSession->join_bssid_count < CSR_MAX_BSSID_COUNT))
+ /*
+ * if userspace has issued disconnection,
+ * driver should not continue connecting
+ */
+ is_dis_pending = is_disconnect_pending(pMac, pSession->sessionId);
+
+ if (pCommand && (pSession->join_bssid_count < CSR_MAX_BSSID_COUNT) &&
+ !is_dis_pending)
{
if(CSR_IS_WDS_STA( &pCommand->u.roamCmd.roamProfile ))
{
@@ -7856,6 +7891,10 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
if (pSession->join_bssid_count >= CSR_MAX_BSSID_COUNT)
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
FL("Excessive Join Request Failures"));
+
+ if (is_dis_pending)
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("disconnect is pending, complete roam"));
pSession->join_bssid_count = 0;
csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
}