diff options
| author | Abhishek Singh <absingh@qti.qualcomm.com> | 2015-12-01 12:28:59 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-12-28 16:01:27 +0530 |
| commit | 5c153ad8decd8dd59ee8f6c7f252b010f18d331f (patch) | |
| tree | 88d403c07e473bdf93811972834f1aa2f6063abb | |
| parent | ac08f949532057544b355bf09497d12606d08cdb (diff) | |
qcacld-2.0: Update the protStatusCode in Re/assoc response in case of failure
prima to qcacld-2.0 propagation
If deauth is received just after Assoc rsp from AP in addSTA
response Re/assoc confirm is sent with status failure.
But protStatusCode in assoc confirm is not updated and thus the
pRoamInfo->reasonCode may have garbage value.
In case of Wep connection failure reason code,
pRoamInfo->reasonCode, is sent to the supplicant in connect
result. Now if pRoamInfo->reasonCode is 0 supplicant receives
connection success though connection have actually failed.
To avoid this update protStatusCode, before sending Re/assoc
failure.
Also properly derive if connection is WEP from roamProfile before
clearing it.
CRs-Fixed: 926572
Change-Id: I5ae0832d37746be16696f521bddd5b67307b1ee4
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 38 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c | 3 |
2 files changed, 27 insertions, 14 deletions
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 075b551f52e3..fbaa7630aec3 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -1854,7 +1854,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs { hddLog(VOS_TRACE_LEVEL_INFO, - "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d", + "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " result:%d and Status:%d", __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), roamResult, roamStatus); @@ -1971,12 +1971,12 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); if (pRoamInfo) pr_info("wlan: connection failed with " MAC_ADDRESS_STR - " reason:%d and Status:%d\n", + " result:%d and Status:%d\n", MAC_ADDR_ARRAY(pRoamInfo->bssid), roamResult, roamStatus); else pr_info("wlan: connection failed with " MAC_ADDRESS_STR - " reason:%d and Status:%d\n", + " result:%d and Status:%d\n", MAC_ADDR_ARRAY(pWextState->req_bssId), roamResult, roamStatus); @@ -2041,18 +2041,15 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs { if (pRoamInfo) hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: send connect failure to nl80211: for bssid " MAC_ADDRESS_STR" reason:%d and Status:%d " , + "%s: send connect failure to nl80211: for bssid " MAC_ADDRESS_STR" result:%d and Status:%d reasonCode %d" , __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), - roamResult, roamStatus); + roamResult, roamStatus, pRoamInfo->reasonCode); else hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: connect failed: for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d " , + "%s: connect failed: for bssid " MAC_ADDRESS_STR " result:%d and Status:%d " , __func__, MAC_ADDR_ARRAY(pWextState->req_bssId), roamResult, roamStatus); - /* Clear the roam profile */ - hdd_clearRoamProfileIe(pAdapter); - /* inform association failure event to nl80211 */ if ( eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL == roamResult ) { @@ -2071,9 +2068,18 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs { if (pRoamInfo) { eCsrAuthType authType = - pWextState->roamProfile.AuthType.authType[0]; - v_BOOL_t isWep = (authType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || - (authType == eCSR_AUTH_TYPE_SHARED_KEY); + pWextState->roamProfile.AuthType.authType[0]; + eCsrEncryptionType encryptionType = + pWextState->roamProfile.EncryptionType.encryptionType[0]; + v_BOOL_t isWep = + (((authType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || + (authType == eCSR_AUTH_TYPE_SHARED_KEY)) && + ((encryptionType == eCSR_ENCRYPT_TYPE_WEP40) || + (encryptionType == eCSR_ENCRYPT_TYPE_WEP104) || + (encryptionType == + eCSR_ENCRYPT_TYPE_WEP40_STATICKEY) || + (encryptionType == + eCSR_ENCRYPT_TYPE_WEP104_STATICKEY))); /* In case of OPEN-WEP or SHARED-WEP authentication, * send exact protocol reason code. This enables user @@ -2082,8 +2088,9 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs */ hdd_connect_result(dev, pRoamInfo->bssid, NULL, 0, NULL, 0, - isWep ? pRoamInfo->reasonCode : - WLAN_STATUS_UNSPECIFIED_FAILURE, + (isWep && pRoamInfo->reasonCode) ? + pRoamInfo->reasonCode : + WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_KERNEL); } else hdd_connect_result(dev, pWextState->req_bssId, @@ -2091,6 +2098,9 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_KERNEL); } + /* Clear the roam profile */ + hdd_clearRoamProfileIe(pAdapter); + } if (pRoamInfo) { diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c index da37bf89549f..32c71f9cac12 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c @@ -2039,6 +2039,7 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess mlmAssocCnf.resultCode = (tSirResultCodes) eSIR_SME_JOIN_DEAUTH_FROM_AP_DURING_ADD_STA; psessionEntry->staId = pAddStaParams->staIdx; + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; goto end; } } @@ -2127,6 +2128,7 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess mlmAssocCnf.resultCode = (tSirResultCodes)eSIR_SME_FT_REASSOC_FAILURE; else mlmAssocCnf.resultCode = (tSirResultCodes)eSIR_SME_REFUSED; + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; } end: if( 0 != limMsgQ->bodyptr ) @@ -3280,6 +3282,7 @@ limProcessStaMlmAddBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession ps } else { limLog(pMac, LOGP, FL("SessionId:%d ADD_BSS failed!"), psessionEntry->peSessionId); + mlmAssocCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; /* Return Assoc confirm to SME with failure */ // Return Assoc confirm to SME with failure if(eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState) |
