diff options
| author | Edhar, Mahesh Kumar <c_medhar@qti.qualcomm.com> | 2015-04-27 17:56:53 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2015-04-29 14:28:43 -0700 |
| commit | 003e2153c1731f02cd87b9e4825b4082430a507d (patch) | |
| tree | 9ecc5bc90bbeb372a5af5583d824b0778e4af1d9 | |
| parent | f3c7fc593f97a6d183f5476edfe1fd47e8525821 (diff) | |
qcacld-2.0: Changes to handle error scenario in set link state
currently protocol stack is not handling failure scenarios during peer
creation on receiving WMA_SET_LINK_STATE resulting in sme command
timeout issues. changes are made to handle the above scenario and post
the sme command response properly.
Change-Id: Ib28b04f00e5d29e384c9a90da5e072019564668e
CRs-Fixed: 827988
| -rw-r--r-- | CORE/MAC/src/pe/lim/limFT.c | 123 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limP2P.c | 5 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMessageQueue.c | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c | 83 | ||||
| -rw-r--r-- | CORE/WDA/inc/legacy/halMsgApi.h | 3 |
5 files changed, 159 insertions, 58 deletions
diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c index 473c165213b0..c5370312652e 100644 --- a/CORE/MAC/src/pe/lim/limFT.c +++ b/CORE/MAC/src/pe/lim/limFT.c @@ -1279,6 +1279,72 @@ void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, } } +/** + * lim_ft_reassoc_set_link_state_callback()- registered callback to perform post + * peer creation operations + * + * @mac: pointer to global mac structure + * @callback_arg: registered callback argument + * @status: peer creation status + * + * this is registered callback function during ft reassoc scenario to perform + * post peer creation operation based on the peer creation status + * + * Return: none + */ +void lim_ft_reassoc_set_link_state_callback(tpAniSirGlobal mac, + void *callback_arg, bool status) +{ + tpPESession session_entry; + tSirMsgQ msg_q; + tLimMlmReassocReq *mlm_reassoc_req = (tLimMlmReassocReq *) callback_arg; + tSirRetStatus ret_code = eSIR_SME_RESOURCES_UNAVAILABLE; + tLimMlmReassocCnf mlm_reassoc_cnf = {0}; + session_entry = peFindSessionBySessionId(mac, + mlm_reassoc_req->sessionId); + if (!status) { + limLog(mac, LOGE, FL("Failed to find pe session for session id:%d"), + mlm_reassoc_req->sessionId); + goto failure; + } + + /* + * we need to defer the message until we get the + * response back from HAL + */ + SET_LIM_PROCESS_DEFD_MESGS(mac, false); + + msg_q.type = SIR_HAL_ADD_BSS_REQ; + msg_q.reserved = 0; + msg_q.bodyptr = session_entry->ftPEContext.pAddBssReq; + msg_q.bodyval = 0; + +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + limLog(mac, LOG1, FL("Sending SIR_HAL_ADD_BSS_REQ...")); +#endif + MTRACE(macTraceMsgTx(mac, session_entry->peSessionId, msg_q.type)); + ret_code = wdaPostCtrlMsg(mac, &msg_q); + if(eSIR_SUCCESS != ret_code) { + vos_mem_free(session_entry->ftPEContext.pAddBssReq); + limLog(mac, LOGE, FL("Post ADD_BSS_REQ failed reason=%X"), + ret_code); + session_entry->ftPEContext.pAddBssReq = NULL; + goto failure; + } + + session_entry->pLimMlmReassocReq = mlm_reassoc_req; + session_entry->ftPEContext.pAddBssReq = NULL; + return; + +failure: + vos_mem_free(mlm_reassoc_req); + mlm_reassoc_cnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; + mlm_reassoc_cnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + /* Update PE session Id*/ + mlm_reassoc_cnf.sessionId = session_entry->peSessionId; + limPostSmeMessage(mac, LIM_MLM_REASSOC_CNF, + (tANI_U32 *) &mlm_reassoc_cnf); +} /*------------------------------------------------------------------ * @@ -1294,9 +1360,8 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, tLimMlmReassocReq *pMlmReassocReq; tANI_U16 caps; tANI_U32 val; - tSirMsgQ msgQ; - tSirRetStatus retCode; tANI_U32 teleBcnEn = 0; + tLimMlmReassocCnf mlm_reassoc_cnf = {0}; chanNum = psessionEntry->currentOperChannel; limGetSessionInfo(pMac,(tANI_U8*)pMsgBuf, &smeSessionId, &transactionId); @@ -1317,13 +1382,13 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, if (NULL == psessionEntry->ftPEContext.pAddBssReq) { limLog(pMac, LOGE, FL("pAddBssReq is NULL")); - return; + goto end; } pMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); if (NULL == pMlmReassocReq) { limLog(pMac, LOGE, FL("call to AllocateMemory failed for mlmReassocReq")); - return; + goto end; } vos_mem_copy(pMlmReassocReq->peerMacAddr, @@ -1340,7 +1405,7 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, limLog(pMac, LOGE, FL("could not retrieve ReassocFailureTimeout value")); vos_mem_free(pMlmReassocReq); - return; + goto end; } if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) { @@ -1350,7 +1415,7 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, */ limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); vos_mem_free(pMlmReassocReq); - return; + goto end; } pMlmReassocReq->capabilityInfo = caps; @@ -1364,7 +1429,7 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, eSIR_SUCCESS) { limLog(pMac, LOGP, FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN")); vos_mem_free(pMlmReassocReq); - return; + goto end; } if (teleBcnEn) { @@ -1376,7 +1441,7 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, */ limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); vos_mem_free(pMlmReassocReq); - return; + goto end; } } else { @@ -1387,39 +1452,27 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, */ limLog(pMac, LOGE, FL("could not retrieve ListenInterval")); vos_mem_free(pMlmReassocReq); - return; + goto end; } } - if (limSetLinkState(pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId, - psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) { - vos_mem_free(pMlmReassocReq); - return; - } pMlmReassocReq->listenInterval = (tANI_U16) val; - psessionEntry->pLimMlmReassocReq = pMlmReassocReq; - - /* we need to defer the message until we get the response back from HAL */ - SET_LIM_PROCESS_DEFD_MESGS(pMac, false); - - msgQ.type = SIR_HAL_ADD_BSS_REQ; - msgQ.reserved = 0; - msgQ.bodyptr = psessionEntry->ftPEContext.pAddBssReq; - msgQ.bodyval = 0; - -#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); -#endif - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); - retCode = wdaPostCtrlMsg( pMac, &msgQ ); - if( eSIR_SUCCESS != retCode) { - vos_mem_free(psessionEntry->ftPEContext.pAddBssReq); - limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"), - retCode ); + if (limSetLinkState(pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId, + psessionEntry->selfMacAddr, + lim_ft_reassoc_set_link_state_callback, + pMlmReassocReq) != eSIR_SUCCESS) { + vos_mem_free(pMlmReassocReq); + goto end; } - - psessionEntry->ftPEContext.pAddBssReq = NULL; return; + +end: + mlm_reassoc_cnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE; + mlm_reassoc_cnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + /* Update PE session Id*/ + mlm_reassoc_cnf.sessionId = psessionEntry->peSessionId; + limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, + (tANI_U32 *) &mlm_reassoc_cnf); } /*------------------------------------------------------------------ diff --git a/CORE/MAC/src/pe/lim/limP2P.c b/CORE/MAC/src/pe/lim/limP2P.c index b1558371924a..8d7f0443da38 100644 --- a/CORE/MAC/src/pe/lim/limP2P.c +++ b/CORE/MAC/src/pe/lim/limP2P.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -88,7 +88,8 @@ eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess); * P2P of limSetLinkState * *------------------------------------------------------------------*/ -void limSetLinkStateP2PCallback(tpAniSirGlobal pMac, void *callbackArg) +void limSetLinkStateP2PCallback(tpAniSirGlobal pMac, void *callbackArg, + bool status) { //Send Ready on channel indication to SME if(pMac->lim.gpLimRemainOnChanReq) diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 804ef6423159..7f5a4e418252 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -1985,7 +1985,8 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) #endif if( linkStateParams->callback ) { - linkStateParams->callback( pMac, linkStateParams->callbackArg ); + linkStateParams->callback(pMac, linkStateParams->callbackArg, + linkStateParams->status); } vos_mem_free((v_VOID_t *)(limMsg->bodyptr)); limMsg->bodyptr = NULL; diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index 39232d504142..7774f13def2b 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -2037,6 +2037,67 @@ static void limProcessMlmOemDataReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } #endif //FEATURE_OEM_DATA_SUPPORT +/** + * lim_post_join_set_link_state_callback()- registered callback to perform post + * peer creation operations + * + * @mac: pointer to global mac structure + * @callback_arg: registered callback argument + * @status: peer creation status + * + * this is registered callback function during association to perform + * post peer creation operation based on the peer creation status + * + * Return: none + */ +void lim_post_join_set_link_state_callback(tpAniSirGlobal mac, + void *callback_arg, bool status) +{ + uint8_t chan_num, sec_chan_offset; + tpPESession session_entry = (tpPESession) callback_arg; + tLimMlmJoinCnf mlm_join_cnf; + + limLog(mac, LOG1, FL("Sessionid %d set link state(%d) cb status:%d"), + session_entry->peSessionId, session_entry->limMlmState, + status); + + if (!status) { + limLog(mac, LOGE, FL("failed to find pe session for session id:%d"), + session_entry->peSessionId); + goto failure; + } + + if (session_entry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) { + chan_num = session_entry->currentOperChannel; + sec_chan_offset = session_entry->htSecondaryChannelOffset; + /* + * store the channel switch sessionEntry in the lim + * global variable + */ + session_entry->channelChangeReasonCode = + LIM_SWITCH_CHANNEL_JOIN; +#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) + session_entry->pLimMlmReassocRetryReq = NULL; +#endif + limLog(mac, LOG1, FL("[limProcessMlmJoinReq]: suspend link on sessionid: %d setting channel to: %d with secChanOffset:%d and maxtxPower: %d"), + session_entry->peSessionId, chan_num, + sec_chan_offset, + session_entry->maxTxPower); + limSetChannel(mac, chan_num, sec_chan_offset, + session_entry->maxTxPower, + session_entry->peSessionId); + return; + } + +failure: + MTRACE(macTrace(mac, TRACE_CODE_MLM_STATE, session_entry->peSessionId, + session_entry->limMlmState)); + session_entry->limMlmState = eLIM_MLM_IDLE_STATE; + mlm_join_cnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; + mlm_join_cnf.sessionId = session_entry->peSessionId; + mlm_join_cnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + limPostSmeMessage(mac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlm_join_cnf); +} /** * limProcessMlmPostJoinSuspendLink() @@ -2064,7 +2125,6 @@ static void limProcessMlmOemDataReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) static void limProcessMlmPostJoinSuspendLink(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *ctx) { - tANI_U8 chanNum, secChanOffset; tLimMlmJoinCnf mlmJoinCnf; tpPESession psessionEntry = (tpPESession)ctx; tSirLinkState linkState; @@ -2093,7 +2153,8 @@ limProcessMlmPostJoinSuspendLink(tpAniSirGlobal pMac, eHalStatus status, tANI_U3 if (limSetLinkState(pMac, linkState, psessionEntry->pLimMlmJoinReq->bssDescription.bssId, - psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS ) + psessionEntry->selfMacAddr, lim_post_join_set_link_state_callback, + psessionEntry) != eSIR_SUCCESS ) { limLog(pMac, LOGE, FL("SessionId:%d limSetLinkState to eSIR_LINK_PREASSOC_STATE Failed!!"), @@ -2106,30 +2167,14 @@ limProcessMlmPostJoinSuspendLink(tpAniSirGlobal pMac, eHalStatus status, tANI_U3 goto error; } - chanNum = psessionEntry->currentOperChannel; - secChanOffset = psessionEntry->htSecondaryChannelOffset; - //store the channel switch sessionEntry in the lim global var - psessionEntry->channelChangeReasonCode = LIM_SWITCH_CHANNEL_JOIN; -#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - psessionEntry->pLimMlmReassocRetryReq = NULL; -#endif - limLog(pMac, LOG1, FL("[limProcessMlmJoinReq]: suspend link success(%d) " - "on sessionid: %d setting channel to: %d with secChanOffset:%d " - "and maxtxPower: %d"), status, psessionEntry->peSessionId, - chanNum, secChanOffset, psessionEntry->maxTxPower); - limSetChannel(pMac, chanNum, secChanOffset, psessionEntry->maxTxPower, psessionEntry->peSessionId); - return; error: mlmJoinCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; mlmJoinCnf.sessionId = psessionEntry->peSessionId; mlmJoinCnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; limPostSmeMessage(pMac, LIM_MLM_JOIN_CNF, (tANI_U32 *) &mlmJoinCnf); - } - - /** * limProcessMlmJoinReq() * diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index b182023975d0..293dccc12ff8 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1040,7 +1040,8 @@ typedef struct CSAOffloadParams { tSirMacAddr bssId; }*tpCSAOffloadParams, tCSAOffloadParams; -typedef void (*tpSetLinkStateCallback)(tpAniSirGlobal pMac, void *msgParam ); +typedef void (*tpSetLinkStateCallback)(tpAniSirGlobal pMac, void *msgParam, + bool status); typedef struct sLinkStateParams { |
