diff options
| author | Subramanyam Nalli <nalli@qti.qualcomm.com> | 2014-02-27 13:09:15 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-03-03 10:38:28 -0800 |
| commit | 7d3de7b64211ef5344107aefc03ebbf659d8e92b (patch) | |
| tree | 86c2a6861c0d5f90fb13dfc7c3a7a07d438ff971 | |
| parent | d01b837bedb9774d351a56ac788937266e83f620 (diff) | |
qcacld : Request for full power mode before channel change
Currently for BMPS and IMPS enabled case, once after
receiving CSA event, host is requesting for Full power
mode before issuing VDEV RESTART if the device is PS mode.
Here instead of calling offload api, non offload api is
getting called and returning error. This patch addresses
the issue and calls correct offload api.
Change-Id: I866eacef6a27da6196e5fdc3c2c010377af6e874
CRs-fixed: 594942
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 70 |
1 files changed, 63 insertions, 7 deletions
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index fbb9ade935e0..74d2416a8037 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -103,7 +103,7 @@ eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); -eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); +eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal, void *pMsgBuf); eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); @@ -2430,11 +2430,17 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) break; #endif // WLAN_FEATURE_PACKET_FILTERING case eWNI_SME_PRE_SWITCH_CHL_IND: - { - status = sme_HandlePreChannelSwitchInd(pMac); + if(pMsg->bodyptr) + { + status = sme_HandlePreChannelSwitchInd(pMac,pMsg->bodyptr); + vos_mem_free(pMsg->bodyptr); + } + else + { + smsLog(pMac, LOGE, "Empty rsp message for meas " + "(eWNI_SME_PRE_SWITCH_CHL_IND), nothing to process"); + } break; - } - case eWNI_SME_POST_SWITCH_CHL_IND: { status = sme_HandlePostChannelSwitchInd(pMac); @@ -8160,20 +8166,70 @@ void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, } /* --------------------------------------------------------------------------- + \fn sme_PreChannelSwitchIndOffloadFullPowerCB + \brief call back function for the PMC full power request because of pre + channel switch for offload case. + \param callbackContext + \param sessionId + \param status + ---------------------------------------------------------------------------*/ +void sme_PreChannelSwitchIndOffloadFullPowerCB(void *callbackContext,tANI_U32 sessionId, + eHalStatus status) +{ + tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; + tSirMbMsg *pMsg; + tANI_U16 msgLen; + + msgLen = (tANI_U16)(sizeof( tSirMbMsg )); + pMsg = vos_mem_malloc(msgLen); + if ( NULL != pMsg ) + { + vos_mem_set(pMsg, msgLen, 0); + pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); + pMsg->msgLen = pal_cpu_to_be16(msgLen); + status = palSendMBMessage(pMac->hHdd, pMsg); + } + + return; +} + +/* --------------------------------------------------------------------------- \fn sme_HandlePreChannelSwitchInd \brief Processes the indcation from PE for pre-channel switch. \param hHal + \param void *pMsgBuf to carry session id \- The handle returned by macOpen. return eHalStatus ---------------------------------------------------------------------------*/ -eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) +eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal, void *pMsgBuf) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tpSirSmePreSwitchChannelInd pPreSwitchChInd = (tpSirSmePreSwitchChannelInd)pMsgBuf; + status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, + + if(!pMac->psOffloadEnabled) + { + status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); + } + else + { + if (NULL != pPreSwitchChInd) + { + status = pmcOffloadRequestFullPower(hHal, pPreSwitchChInd->sessionId, + sme_PreChannelSwitchIndOffloadFullPowerCB, + pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); + } + else + { + smsLog(pMac, LOGE, "Empty pMsgBuf message for channel switch " + "(eWNI_SME_PRE_SWITCH_CHL_IND), nothing to process"); + } + } + sme_ReleaseGlobalLock( &pMac->sme ); } |
