diff options
| author | Abhishek Singh <absingh@qti.qualcomm.com> | 2015-12-18 09:42:03 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-12-22 14:14:42 +0530 |
| commit | 6f8f35719d6eaefc8fcbae22545ac4e0063cc599 (patch) | |
| tree | 44d8f74dbb9044a12863eb20a2c17ada6dfec8f6 | |
| parent | 83c5b3dd811d59c8fa164143fc0099dc2e41045a (diff) | |
qcacld-2.0: Remove roam cmd from sme active list even in case of failure
-In case CSR is already connected and it receive a connect with the
same profile, csr will silently return and try to send the connect
success to HDD. But if roamInfo staId is 0 this roam command is not
removed from sme active list and leads to active list timeout.
This back to back connect to CSR can happen if HDD and CSR go out
of sync and is taken care already.
-Also if disconnect is received in case scan for ssid is in progress
it will be dropped and roam session state is set to disconnecting.
But this roam session state is not reset for the fresh connection
and thus if next connect also issue scan for ssid the connect
command will be dropped assuming disconnect is in progress.
This change removes roam cmd from sme active list in case of
above failure and resets roam session state for fresh connections.
Also does some cleanup in HDD disconnect command.
Change-Id: I222626f1da6bdad83a5264668dde9aafd3dda149
CRs-Fixed: 953196
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 8 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 22 |
2 files changed, 22 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index b0b72204f0be..3b12523b4a83 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -17120,9 +17120,14 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, reason); + /* + * Wait here instead of returning directly, this will block the next + * connect command and allow processing of the scan for ssid and + * the previous connect command in CSR. Else we might hit some + * race conditions leading to SME and HDD out of sync. + */ if (eHAL_STATUS_CMD_NOT_QUEUED == status) { hddLog(LOG1, FL("status = %d, already disconnected"), (int)status); - goto disconnected; } else if (0 != status) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s csrRoamDisconnect failure, returned %d", @@ -17299,7 +17304,6 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL("convert to internal reason %d to reasonCode %d"), reason, reasonCode); - pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; pScanInfo = &pAdapter->scan_info; if (pScanInfo->mScanPending) { hddLog(VOS_TRACE_LEVEL_INFO, "Disconnect is in progress, " diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index f785ff860d7e..cce682e38ae9 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -6275,10 +6275,7 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman roamInfo.staId = pSession->connectedInfo.staId; roamInfo.u.pConnectedProfile = &pSession->connectedProfile; if (0 == roamInfo.staId) - { - VOS_ASSERT( 0 ); - return eANI_BOOLEAN_FALSE; - } + VOS_ASSERT(0); pSession->bRefAssocStartCnt--; csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, eCSR_ROAM_ASSOCIATION_COMPLETION, eCSR_ROAM_RESULT_ASSOCIATED); @@ -7084,6 +7081,19 @@ eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi csrRoamIssueDisassociateCmd(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); } } + /* + * If roamSession.connectState is disconnecting that mean + * disconnect was received with scan for ssid in progress + * and dropped. This state will ensure that connect will + * not be issued from scan for ssid completion. Thus + * if this fresh connect also issue scan for ssid the connect + * command will be dropped assuming disconnect is in progress. + * Thus reset connectState here + */ + if (eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING == + pMac->roam.roamSession[sessionId].connectState) + pMac->roam.roamSession[sessionId].connectState = + eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED; if(CSR_INVALID_SCANRESULT_HANDLE != hBssListIn) { smsLog(pMac, LOG1, FL("is called with BSSList")); @@ -7684,8 +7694,8 @@ eHalStatus csrRoamDisconnectInternal(tpAniSirGlobal pMac, tANI_U32 sessionId, eC eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING; csrScanAbortScanForSSID(pMac, sessionId); status = eHAL_STATUS_CMD_NOT_QUEUED; - smsLog( pMac, LOG1, FL(" Disconnect cmd not queued, Roam command is not present" - " return with status %d"), status); + smsLog( pMac, LOGE, + FL("Disconnect not queued, Abort Scan for SSID")); } return (status); } |
