diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2014-07-08 20:43:58 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-07-25 10:37:01 -0700 |
| commit | ec12be97f99b225a78da9eeda7b92b1d34484cb6 (patch) | |
| tree | 6b0004c7acada764920f420c34abc233d8255573 | |
| parent | 4471bae18267d24818122b93ad7d666a531867e8 (diff) | |
qcacld: dont send connect result to kernel,if HDD's discon is pending
If HDD has initiated the disconnect command i.e connState is set to
eConnectionState_Disconnecting, do not send the connect
success/failure or disconnect indication to kernel.
This is already handled in kernel as part of __cfg80211_disconnect
after driver return from disconnect ops sucessfully.
The connect success/failure or disconnect indication sent by driver
will be queued in workqueue of kernel, which might get scheduled
after kernel gets the next connect command from supplicant,
this leads to driver and supplicant in unsync state.
Change-Id: I7184a260709175e92b16226702bafd8f083dc498
CRs-Fixed: 689884
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 158 |
1 files changed, 100 insertions, 58 deletions
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index a907c7ed06b2..ecb660c7b30a 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -882,6 +882,7 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); v_U8_t sta_id; + v_BOOL_t sendDisconInd = TRUE; // Sanity check if(dev == NULL) @@ -912,6 +913,17 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } #endif /* QCA_PKT_PROTO_TRACE */ + /* HDD has initiated disconnect, do not send disconnect indication + * to kernel as it will be handled by __cfg80211_disconnect. + */ + if ( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL(" HDD has initiated a disconnect, no need to send" + " disconnect indication to kernel")); + sendDisconInd = FALSE; + } + if(pHddStaCtx->conn_info.connState != eConnectionState_Disconnecting) { INIT_COMPLETION(pAdapter->disconnect_comp_var); @@ -961,16 +973,19 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } #endif - /* To avoid wpa_supplicant sending "HANGED" CMD to ICS UI */ - if( eCSR_ROAM_LOSTLINK == roamStatus ) + /*Only send indication to kernel if not initiated by kernel*/ + if ( sendDisconInd ) { - cfg80211_disconnected(dev, pRoamInfo->reasonCode, NULL, 0, GFP_KERNEL); - } - else - { - cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); + /* To avoid wpa_supplicant sending "HANGED" CMD to ICS UI */ + if( eCSR_ROAM_LOSTLINK == roamStatus ) + { + cfg80211_disconnected(dev, pRoamInfo->reasonCode, NULL, 0, GFP_KERNEL); + } + else + { + cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); + } } - //If the Device Mode is Station // and the P2P Client is Connected //Enable BMPS @@ -1371,19 +1386,37 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs int ft_carrier_on = FALSE; #endif int status; + v_BOOL_t hddDisconInProgress = FALSE; + #ifdef WLAN_FEATURE_ROAM_OFFLOAD if (pRoamInfo && pRoamInfo->roamSynchInProgress) { /* change logging before release */ hddLog(VOS_TRACE_LEVEL_DEBUG, "LFR3:hdd_AssociationCompletionHandler"); } #endif - if ( eCSR_ROAM_RESULT_ASSOCIATED == roamResult ) + + /* HDD has initiated disconnect, do not send connect result indication + * to kernel as it will be handled by __cfg80211_disconnect. + */ + if(( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) && + (( eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || + ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)) ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_Associated", - __func__); - hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Associated ); - pAdapter->maxRateFlags = pRoamInfo->maxRateFlags; + FL(" Disconnect from HDD in progress ")); + hddDisconInProgress = TRUE; + } + + if ( eCSR_ROAM_RESULT_ASSOCIATED == roamResult ) + { + if ( !hddDisconInProgress ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Set HDD connState to eConnectionState_Associated", + __func__); + hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Associated ); + pAdapter->maxRateFlags = pRoamInfo->maxRateFlags; + } // Save the connection info from CSR... hdd_connSaveConnectInfo( pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE ); @@ -1552,15 +1585,18 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs if(ft_carrier_on) { - hddLog(LOG1, "%s ft_carrier_on is %d, sending roamed " - "indication", __FUNCTION__, ft_carrier_on); - chan = ieee80211_get_channel(pAdapter->wdev.wiphy, - (int)pRoamInfo->pBssDesc->channelId); - hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, - assocRsplen); - cfg80211_roamed(dev,chan, pRoamInfo->bssid, - pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, - GFP_KERNEL); + if ( !hddDisconInProgress ) + { + hddLog(LOG1, "%s ft_carrier_on is %d, sending roamed " + "indication", __FUNCTION__, ft_carrier_on); + chan = ieee80211_get_channel(pAdapter->wdev.wiphy, + (int)pRoamInfo->pBssDesc->channelId); + hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, + assocRsplen); + cfg80211_roamed(dev,chan, pRoamInfo->bssid, + pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, + GFP_KERNEL); + } if (sme_GetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId)) { @@ -1579,7 +1615,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs pHddStaCtx->roam_info.deferKeyComplete = TRUE; } } - else + else if ( !hddDisconInProgress ) { hddLog(LOG1, "%s ft_carrier_on is %d, sending connect " "indication", __FUNCTION__, ft_carrier_on); @@ -1603,46 +1639,52 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs pAdapter->sessionId, &rspRsnLength, rspRsnIe); + if ( !hddDisconInProgress ) + { #if defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - if(ft_carrier_on) - hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); - else + if(ft_carrier_on) + hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); + else #endif /* FEATURE_WLAN_ESE */ - { - hddLog(VOS_TRACE_LEVEL_INFO, - "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d", - __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), - roamResult, roamStatus); - - /* inform connect result to nl80211 */ - cfg80211_connect_result(dev, pRoamInfo->bssid, - reqRsnIe, reqRsnLength, - rspRsnIe, rspRsnLength, - WLAN_STATUS_SUCCESS, - GFP_KERNEL); + { + hddLog(VOS_TRACE_LEVEL_INFO, + "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d", + __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), + roamResult, roamStatus); + + /* inform connect result to nl80211 */ + cfg80211_connect_result(dev, pRoamInfo->bssid, + reqRsnIe, reqRsnLength, + rspRsnIe, rspRsnLength, + WLAN_STATUS_SUCCESS, + GFP_KERNEL); + } } } - cfg80211_put_bss( + if ( !hddDisconInProgress ) + { + cfg80211_put_bss( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - pHddCtx->wiphy, + pHddCtx->wiphy, #endif - bss); - - // perform any WMM-related association processing - hdd_wmm_assoc(pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE); + bss); - /* Start the Queue - Start tx queues before hdd_roamRegisterSTA, - since hdd_roamRegisterSTA will flush any cached data frames - immediately */ - netif_tx_wake_all_queues(dev); + // perform any WMM-related association processing + hdd_wmm_assoc(pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE); - // Register the Station with TL after associated... - vosStatus = hdd_roamRegisterSTA( pAdapter, - pRoamInfo, - pHddStaCtx->conn_info.staId[ 0 ], - NULL, - pRoamInfo->pBssDesc ); + /* Start the Queue - Start tx queues before hdd_roamRegisterSTA, + since hdd_roamRegisterSTA will flush any cached data frames + immediately */ + netif_tx_wake_all_queues(dev); + + // Register the Station with TL after associated... + vosStatus = hdd_roamRegisterSTA( pAdapter, + pRoamInfo, + pHddStaCtx->conn_info.staId[ 0 ], + NULL, + pRoamInfo->pBssDesc ); + } } else { @@ -1730,11 +1772,11 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /* Set connection state to eConnectionState_NotConnected only when CSR * has completed operation - with a ASSOCIATION_FAILURE status */ - if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus ) + if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_NotConnected", - __func__); + "%s: Set HDD connState to eConnectionState_NotConnected", + __func__); hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected); } if((pHddCtx->concurrency_mode <= 1) && @@ -1781,7 +1823,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /* CR465478: Only send up a connection failure result when CSR has * completed operation - with a ASSOCIATION_FAILURE status.*/ - if (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus) + if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) { if (pRoamInfo) hddLog(VOS_TRACE_LEVEL_ERROR, |
