diff options
| author | Paul Zhang <paulz@codeaurora.org> | 2017-05-24 14:53:57 +0800 |
|---|---|---|
| committer | Paul Zhang <paulz@codeaurora.org> | 2017-05-24 14:53:57 +0800 |
| commit | 980736facbf2fe6f9cf47c76f25c52b3df7c5d7c (patch) | |
| tree | 1be808b1e46495e49f819f1614b75fe431450625 | |
| parent | 6c657c4ba350ed4fc26d16a5b8841385c404d4ca (diff) | |
qcacld-2.0: Retry Auth if MAX_ASSOC_STA_REACHED
propagation from prima to qcacld-2.0
This is IOT issue with the AP who has 5G prefer feature.
The AP rejects with eSIR_MAC_MAX_ASSOC_STA_REACHED_STATUS
in AUTH frame when the 2.4G STA tries AUTH process for
the first 2 times. If STA tries the 3rd time in 2.4G,
then the AUTH process will success.
Change-Id: I8afa43cb9728f73172f543bfb9aac65b0b225aa2
CRs-Fixed: 1111136
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 20 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 16 | ||||
| -rw-r--r-- | CORE/MAC/inc/aniGlobal.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/include/limSession.h | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c | 80 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSecurityUtils.c | 31 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limTypes.h | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrNeighborRoam.c | 12 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 3 |
10 files changed, 114 insertions, 57 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 131cb45331ad..010325a032ac 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1306,6 +1306,25 @@ enum #define CFG_ENABLE_RAMDUMP_COLLECTION_MAX ( 1 ) #define CFG_ENABLE_RAMDUMP_COLLECTION_DEFAULT ( 1 ) +/* + * gStaAuthRetriesForCode17 + * It is for an IOT issue. + * When DUT receives MAX_ASSOC_STA_REACHED_STATUS as + * response for Auth frame this ini decides how many + * times DUT has to retry. + * + * This is mainly for an AP where it wants to force + * the Station to connect to its 5G profile session + * (Dual band AP) by rejecting the Auth on 2.4G band. + * But if a station is only 2.4G capable it can try + * 3 times where third time AP will allow the + * station to connect to this AP. + */ +#define CFG_STA_AUTH_RETRIES_FOR_CODE17_NAME "gStaAuthRetriesForCode17" +#define CFG_STA_AUTH_RETRIES_FOR_CODE17_MIN ( 0 ) +#define CFG_STA_AUTH_RETRIES_FOR_CODE17_MAX ( 5 ) +#define CFG_STA_AUTH_RETRIES_FOR_CODE17_DEFAULT ( 0 ) + typedef enum { eHDD_LINK_SPEED_REPORT_ACTUAL = 0, @@ -5465,6 +5484,7 @@ struct hdd_config { uint32_t arp_ac_category; /* parameter to control probe resp offloads */ bool sap_probe_resp_offload; + uint32_t sta_auth_retries_for_code17; }; typedef struct hdd_config hdd_config_t; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 26a3e6dc7ef6..6ddeee490ff2 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -5028,6 +5028,13 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_SAP_PROBE_RESP_OFFLOAD_DEFAULT, CFG_SAP_PROBE_RESP_OFFLOAD_MIN, CFG_SAP_PROBE_RESP_OFFLOAD_MAX), + + REG_VARIABLE( CFG_STA_AUTH_RETRIES_FOR_CODE17_NAME, WLAN_PARAM_Integer, + hdd_config_t, sta_auth_retries_for_code17, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_STA_AUTH_RETRIES_FOR_CODE17_DEFAULT, + CFG_STA_AUTH_RETRIES_FOR_CODE17_MIN, + CFG_STA_AUTH_RETRIES_FOR_CODE17_MAX ), }; @@ -5770,6 +5777,10 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) "Name = [gEnableDumpCollect] Value = [%u]", pHddCtx->cfg_ini->is_ramdump_enabled); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [sta_auth_retries_for_code17] Value = [%u] ", + pHddCtx->cfg_ini->sta_auth_retries_for_code17); + hddLog(LOG2, "Name = [gP2PListenDeferInterval] Value = [%u]", pHddCtx->cfg_ini->p2p_listen_defer_interval); @@ -6028,7 +6039,6 @@ static VOS_STATUS hdd_cfg_get_config(REG_TABLE_ENTRY *reg_table, #else printk(KERN_INFO "%s", configStr); #endif // RETURN_IN_BUFFER - } #ifndef RETURN_IN_BUFFER @@ -7994,6 +8004,9 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->sub20_dynamic_channelwidth = hdd_cfg_get_sub20_dyn_capabilities(pHddCtx); + smeConfig->csrConfig.sta_auth_retries_for_code17 = + pHddCtx->cfg_ini->sta_auth_retries_for_code17; + halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) { @@ -8005,7 +8018,6 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) return status; } - /**--------------------------------------------------------------------------- \brief hdd_execute_config_command() - diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h index d548e414fc0e..53e01d23e794 100644 --- a/CORE/MAC/inc/aniGlobal.h +++ b/CORE/MAC/inc/aniGlobal.h @@ -1293,6 +1293,7 @@ typedef struct sAniSirGlobal uint8_t sub20_dynamic_channelwidth; uint8_t sta_sub20_current_channelwidth; bool max_power_cmd_pending; + uint32_t sta_auth_retries_for_code17; } tAniSirGlobal; typedef enum diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h index f70d26986646..068d48a974ca 100644 --- a/CORE/MAC/src/pe/include/limSession.h +++ b/CORE/MAC/src/pe/include/limSession.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -514,6 +514,7 @@ typedef struct sPESession // Added to Support BT-AMP uint8_t sub20_channelwidth; /* Number of STAs that do not support ECSA capability */ uint8_t lim_non_ecsa_cap_num; + uint32_t sta_auth_retries_for_code17; } tPESession, *tpPESession; /*------------------------------------------------------------------------- diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index f847d203240d..0b43fc173400 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -712,8 +712,47 @@ void limSetDFSChannelList(tpAniSirGlobal pMac,tANI_U8 channelNum, tSirDFSChannel return; } +void limDoSendAuthMgmtFrame(tpAniSirGlobal pMac, tpPESession psessionEntry) +{ + tSirMacAuthFrameBody authFrameBody; + //Prepare & send Authentication frame + authFrameBody.authAlgoNumber = + (tANI_U8) pMac->lim.gpLimMlmAuthReq->authType; + authFrameBody.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; + authFrameBody.authStatusCode = 0; + pMac->auth_ack_status = LIM_AUTH_ACK_NOT_RCD; +#ifdef FEATURE_WLAN_DIAG_SUPPORT + limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_START_EVENT, psessionEntry, + eSIR_SUCCESS, authFrameBody.authStatusCode); +#endif + + limSendAuthMgmtFrame(pMac, + &authFrameBody, + pMac->lim.gpLimMlmAuthReq->peerMacAddr, + LIM_NO_WEP_IN_FC, psessionEntry, eSIR_TRUE); + if (tx_timer_activate(&pMac->lim.limTimers.gLimAuthFailureTimer) + != TX_SUCCESS) { + //Could not start Auth failure timer. + //Log error + limLog(pMac, LOGP, + FL("could not start Auth failure timer")); + //Cleanup as if auth timer expired + limProcessAuthFailureTimeout(pMac); + } else { + MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, + psessionEntry->peSessionId, eLIM_AUTH_RETRY_TIMER)); + //Activate Auth Retry timer + if (tx_timer_activate + (&pMac->lim.limTimers.g_lim_periodic_auth_retry_timer) + != TX_SUCCESS) { + limLog(pMac, LOGP, + FL("could not activate Auth Retry timer")); + } + } + return; +} /* * Creates a Raw frame to be sent before every Scan, if required. @@ -2256,7 +2295,6 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { tANI_U32 numPreAuthContexts; tSirMacAddr currentBssId; - tSirMacAuthFrameBody authFrameBody; tLimMlmAuthCnf mlmAuthCnf; struct tLimPreAuthNode *preAuthNode; tpDphHashNode pStaDs; @@ -2377,21 +2415,6 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->limMlmState = eLIM_MLM_WT_AUTH_FRAME2_STATE; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); - /// Prepare & send Authentication frame - authFrameBody.authAlgoNumber = - (tANI_U8) pMac->lim.gpLimMlmAuthReq->authType; - authFrameBody.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; - authFrameBody.authStatusCode = 0; -#ifdef FEATURE_WLAN_DIAG_SUPPORT - limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_START_EVENT, psessionEntry, - eSIR_SUCCESS, authFrameBody.authStatusCode); -#endif - pMac->auth_ack_status = LIM_AUTH_ACK_NOT_RCD; - limSendAuthMgmtFrame(pMac, - &authFrameBody, - pMac->lim.gpLimMlmAuthReq->peerMacAddr, - LIM_NO_WEP_IN_FC, psessionEntry, eSIR_TRUE); - //assign appropriate sessionId to the timer object pMac->lim.limTimers.gLimAuthFailureTimer.sessionId = sessionId; @@ -2400,26 +2423,9 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limDeactivateAndChangeTimer(pMac, eLIM_AUTH_RETRY_TIMER); /* Activate Auth failure timer */ MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_AUTH_FAIL_TIMER)); - if (tx_timer_activate(&pMac->lim.limTimers.gLimAuthFailureTimer) - != TX_SUCCESS) - { - /// Could not start Auth failure timer. - // Log error - limLog(pMac, LOGP, - FL("could not start Auth failure timer")); - /* Clean up as if auth timer expired */ - limProcessAuthFailureTimeout(pMac); - } else { - MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, - psessionEntry->peSessionId, eLIM_AUTH_RETRY_TIMER)); - /* Activate Auth Retry timer */ - if (tx_timer_activate - (&pMac->lim.limTimers.g_lim_periodic_auth_retry_timer) - != TX_SUCCESS) { - limLog(pMac, LOGP, FL("could not activate Auth Retry timer")); - } - } - return; + + limDoSendAuthMgmtFrame(pMac, psessionEntry); + return; } else { diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c index d788cbfe0646..d34bfb86f0ef 100644 --- a/CORE/MAC/src/pe/lim/limSecurityUtils.c +++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -456,10 +456,6 @@ limDeletePreAuthNode(tpAniSirGlobal pMac, tSirMacAddr macAddr) } /*** end limDeletePreAuthNode() ***/ - - - - /** * limRestoreFromPreAuthState * @@ -504,13 +500,6 @@ limRestoreFromAuthState(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U1 /* Update PE session ID*/ mlmAuthCnf.sessionId = sessionEntry->peSessionId; - /// Free up buffer allocated - /// for pMac->lim.gLimMlmAuthReq - vos_mem_free(pMac->lim.gpLimMlmAuthReq); - pMac->lim.gpLimMlmAuthReq = NULL; - - sessionEntry->limMlmState = sessionEntry->limPrevMlmState; - MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, sessionEntry->peSessionId, sessionEntry->limMlmState)); /* Set the authAckStatus status flag as sucess as * host have received the auth rsp and no longer auth @@ -529,9 +518,25 @@ limRestoreFromAuthState(tpAniSirGlobal pMac, tSirResultCodes resultCode, tANI_U1 pMac->lim.gLimPreAuthChannelNumber = 0; } - limPostSmeMessage(pMac, + if ((protStatusCode == eSIR_MAC_MAX_ASSOC_STA_REACHED_STATUS) + && (sessionEntry->sta_auth_retries_for_code17 < + pMac->sta_auth_retries_for_code17)) { + limLog(pMac, LOG1, FL("Retry Auth ")); + limDoSendAuthMgmtFrame(pMac, sessionEntry); + sessionEntry->sta_auth_retries_for_code17++; + } else { + /// Free up buffer allocated + /// for pMac->lim.gLimMlmAuthReq + vos_mem_free(pMac->lim.gpLimMlmAuthReq); + pMac->lim.gpLimMlmAuthReq = NULL; + + sessionEntry->limMlmState = sessionEntry->limPrevMlmState; + + limPostSmeMessage(pMac, LIM_MLM_AUTH_CNF, (tANI_U32 *) &mlmAuthCnf); + sessionEntry->sta_auth_retries_for_code17 = 0; + } } /*** end limRestoreFromAuthState() ***/ diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h index 3e6bbe871933..f6db9724b2e1 100644 --- a/CORE/MAC/src/pe/lim/limTypes.h +++ b/CORE/MAC/src/pe/lim/limTypes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -700,6 +700,8 @@ void limSendDeauthMgmtFrame(tpAniSirGlobal, tANI_U16, tSirMacAddr, tpPESession, void limSendSmeDisassocDeauthNtf(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *pCtx); +void limDoSendAuthMgmtFrame(tpAniSirGlobal, tpPESession); + void limContinueChannelScan(tpAniSirGlobal); tSirResultCodes limMlmAddBss(tpAniSirGlobal, tLimMlmStartReq *,tpPESession psessionEntry); diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index af1100152621..64558140d8c2 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -1370,6 +1370,7 @@ typedef struct tagCsrConfigParam uint32_t edca_bk_aifs; uint32_t edca_be_aifs; struct csr_sta_roam_policy_params sta_roam_policy_params; + uint32_t sta_auth_retries_for_code17; }tCsrConfigParam; //Tush diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 86463b2e06d6..633f1ac93720 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -1580,15 +1580,21 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pNeighborBssNode = NULL; tListElem *pEntry; bool is_dis_pending = false; + uint32_t retries; + + retries = pMac->sta_auth_retries_for_code17 > + CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES ? + pMac->sta_auth_retries_for_code17 : + CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES; smsLog(pMac, LOGE, FL("Preauth failed retry number %d, status = 0x%x"), pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries, limStatus); /* Preauth failed. Add the bssId to the preAuth failed list MAC Address. Also remove the AP from roam able AP list */ - if ((pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries >= - CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES) || - (eSIR_LIM_MAX_STA_REACHED_ERROR == limStatus)) + if ((pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries >= retries) || + ((eSIR_LIM_MAX_STA_REACHED_ERROR == limStatus) && + (pMac->sta_auth_retries_for_code17 == 0))) { /* We are going to remove the node as it fails for more than MAX tries. Reset this count to 0 */ pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 6f6aa0442e5e..eea9317b93f7 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -1890,6 +1890,9 @@ eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) pMac->sub20_dynamic_channelwidth = pSmeConfigParams->sub20_dynamic_channelwidth; + pMac->sta_auth_retries_for_code17 = + pSmeConfigParams->csrConfig.sta_auth_retries_for_code17; + return status; } |
