diff options
| author | Kiran Kumar Lokere <klokere@qca.qualcomm.com> | 2014-01-24 13:06:47 -0800 |
|---|---|---|
| committer | Prakash Dhavali <pdhavali@qca.qualcomm.com> | 2014-01-26 00:02:54 -0800 |
| commit | 2b4584f2c3ec7b18549d158e7f4a78d0b2b950be (patch) | |
| tree | d712b7d9a67e41161948d8929f4b4b6bc39ed78e | |
| parent | 74dfecbe62ce7d093b70d6e852b4159b86444950 (diff) | |
Fix SAP channel width issue after DFS channel switch
Fixes SAP channel width issue when DFS channel switch happens.
SAP was coming up with 20MHz channel width after DFS channel
switch happend.
Change-Id: I8866a61fff5e6eb1e42fc458366a92e2f91b2345
CRs-Fixed: 600131
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 90 | ||||
| -rw-r--r-- | CORE/SAP/src/sapModule.c | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/csrInternal.h | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 4 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 19 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 7 |
7 files changed, 97 insertions, 32 deletions
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index a2750c146f2e..bf50c844fbe7 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4752,6 +4752,7 @@ typedef struct sSirChanChangeRequest tANI_U16 messageLen; tANI_U8 sessionId; tANI_U8 targetChannel; + tANI_U8 cbMode; }tSirChanChangeRequest, *tpSirChanChangeRequest; typedef struct sSirChanChangeResponse diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 45b62e18b086..ca3323b72a0f 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -5836,6 +5836,10 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) tpPESession psessionEntry; tANI_U8 sessionId; //PE sessionID tPowerdBm maxTxPwr; +#ifdef WLAN_FEATURE_11AC + tANI_U32 centerChan; + tANI_U32 chanWidth; +#endif if( pMsg == NULL ) { limLog(pMac, LOGE,FL("pMsg is NULL")); @@ -5863,14 +5867,6 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) && maxTxPwr != WDA_MAX_TXPOWER_INVALID) { - /* - * Issue a set channel request with - * with channel bonding mode as - * PHY_SINGLE_CHANNEL_CENTERED - * TODO:Handle the channel bonding mode - * 40Mhz and 80Mhz Channel width for SAP - * channel change. - */ /* Store the New Channel Params in psessionEntry */ if (psessionEntry->currentOperChannel != @@ -5880,25 +5876,73 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) psessionEntry->currentOperChannel, pChannelChangeReq->targetChannel); - limSetChannel(pMac, pChannelChangeReq->targetChannel, - PHY_SINGLE_CHANNEL_CENTERED, - maxTxPwr, - psessionEntry->peSessionId); - psessionEntry->currentOperChannel = - pChannelChangeReq->targetChannel; +#ifdef WLAN_FEATURE_11AC + if(psessionEntry->vhtCapability) + { + + if (wlan_cfgGetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, + &chanWidth) != eSIR_SUCCESS) + { + limLog(pMac, LOGP, + FL("Unable to retrieve Channel Width from CFG")); + } + + if(chanWidth == eHT_CHANNEL_WIDTH_20MHZ || chanWidth == eHT_CHANNEL_WIDTH_40MHZ) + { + if (cfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) + != eSIR_SUCCESS) + { + limLog(pMac, LOGP, FL("could not set WNI_CFG_CHANNEL_BONDING_MODE at CFG")); + } + } + if (chanWidth == eHT_CHANNEL_WIDTH_80MHZ) + { + if (cfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) + != eSIR_SUCCESS) + { + limLog(pMac, LOGP, FL("could not set WNI_CFG_CHANNEL_BONDING_MODE at CFG")); + } + + centerChan = limGetCenterChannel(pMac, pChannelChangeReq->targetChannel, + pChannelChangeReq->cbMode,WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ); + if(centerChan != eSIR_CFG_INVALID_ID) + { + limLog(pMac, LOGW, FL("***Center Channel for 80MHZ channel width = %d"),centerChan); + psessionEntry->apCenterChan = centerChan; + if (cfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1, centerChan) + != eSIR_SUCCESS) + { + limLog(pMac, LOGP, FL("could not set WNI_CFG_CHANNEL_BONDING_MODE at CFG")); + } + } + } + + /* All the translation is done by now for gVhtChannelWidth from .ini file to + * the actual values as defined in spec. So, grabing the spec value which is + * updated in .dat file by the above logic */ + if (wlan_cfgGetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, + &chanWidth) != eSIR_SUCCESS) + { + limLog(pMac, LOGP, + FL("Unable to retrieve Channel Width from CFG")); + } + psessionEntry->vhtTxChannelWidthSet = chanWidth; + psessionEntry->apChanWidth = chanWidth; + } + psessionEntry->htSecondaryChannelOffset = limGetHTCBState(pChannelChangeReq->cbMode); + psessionEntry->htSupportedChannelWidthSet = (pChannelChangeReq->cbMode ? 1 : 0); - /* - *TODO:As of now the supported Channel width - * is only 20Mhz. AP Channel Bonding Mode for - * 40 Mhz and 80Mhz is pending implementation. - */ - psessionEntry->htSecondaryChannelOffset = - PHY_SINGLE_CHANNEL_CENTERED; - psessionEntry->htSupportedChannelWidthSet = - WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; + psessionEntry->currentOperChannel = + pChannelChangeReq->targetChannel; + + limSetChannel(pMac, pChannelChangeReq->targetChannel, + pChannelChangeReq->cbMode, + maxTxPwr, + psessionEntry->peSessionId); +#endif } } diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index e94f3eb53a54..731ea68c4ca8 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -2414,8 +2414,8 @@ WLANSAP_ChannelChangeRequest(v_PVOID_t pSapCtx, tANI_U8 tArgetChannel) return VOS_STATUS_E_FAULT; } - halStatus = sme_RoamChannelChangeReq( hHal, - sapContext->sessionId, tArgetChannel); + halStatus = sme_RoamChannelChangeReq( hHal, sapContext->sessionId, tArgetChannel, + sapConvertSapPhyModeToCsrPhyMode(sapContext->csrRoamProfile.phyMode)); if (halStatus == eHAL_STATUS_SUCCESS) { diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index 4c0cf4cbe865..879c119c22de 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -1428,8 +1428,8 @@ tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId); /* Post Channel Change Indication */ -eHalStatus csrRoamChannelChangeReq( tpAniSirGlobal pMac, - tANI_U32 sessionId, tANI_U8 targetChannel); +eHalStatus csrRoamChannelChangeReq(tpAniSirGlobal pMac, tANI_U32 sessionId, + tANI_U8 targetChannel, tANI_U8 cbMode); /* Post Beacon Tx Start Indication */ eHalStatus csrRoamStartBeaconReq( tpAniSirGlobal pMac, diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 93d62b0c047b..7d3e2e85fcb7 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -3280,8 +3280,8 @@ eHalStatus sme_AddChAvoidCallback ); #endif /* FEATURE_WLAN_CH_AVOID */ -eHalStatus sme_RoamChannelChangeReq( tHalHandle hHal, - tANI_U8 sessionId, tANI_U8 targetChannel); +eHalStatus sme_RoamChannelChangeReq( tHalHandle hHal, tANI_U8 sessionId, + tANI_U8 targetChannel, eCsrPhyMode phyMode); eHalStatus sme_RoamStartBeaconReq( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 dfsCacWaitStatus); diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 34c33b88a57b..c9822ff8d062 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -17280,7 +17280,7 @@ VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp) */ eHalStatus csrRoamChannelChangeReq( tpAniSirGlobal pMac, tANI_U32 sessionId, - tANI_U8 targetChannel) + tANI_U8 targetChannel, tANI_U8 cbMode) { eHalStatus status = eHAL_STATUS_SUCCESS; tSirChanChangeRequest *pMsg; @@ -17301,10 +17301,27 @@ csrRoamChannelChangeReq( tpAniSirGlobal pMac, tANI_U32 sessionId, vos_mem_set((void *)pMsg, sizeof( tSirChanChangeRequest ), 0); +#ifdef WLAN_FEATURE_11AC + // cbMode = 1 in cfg.ini is mapped to PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3 + // in function csrConvertCBIniValueToPhyCBState() + // So, max value for cbMode in 40MHz mode is 3 (MAC\src\include\sirParams.h) + if(cbMode > PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) + { + if(!WDA_getFwWlanFeatCaps(DOT11AC)) { + cbMode = csrGetHTCBStateFromVHTCBState(cbMode); + } + else + { + ccmCfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH, pMac->roam.configParam.nVhtChannelWidth, NULL, eANI_BOOLEAN_FALSE); + } + } +#endif + pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANNEL_CHANGE_REQ); pMsg->messageLen = sizeof(tSirChanChangeRequest); pMsg->sessionId = pSession->sessionId; pMsg->targetChannel = targetChannel; + pMsg->cbMode = cbMode; status = palSendMBMessage(pMac->hHdd, pMsg); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index af6b33cdff84..6df7077457a9 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -10916,14 +10916,17 @@ eHalStatus sme_AddChAvoidCallback \return eHalStatus ---------------------------------------------------------------------------*/ eHalStatus sme_RoamChannelChangeReq( tHalHandle hHal, - tANI_U8 sessionId, tANI_U8 targetChannel ) + tANI_U8 sessionId, tANI_U8 targetChannel, eCsrPhyMode phyMode) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrRoamChannelChangeReq( pMac, sessionId, targetChannel); + sme_SelectCBMode(hHal, phyMode, targetChannel); + + status = csrRoamChannelChangeReq( pMac, sessionId, targetChannel, + pMac->roam.configParam.channelBondingMode5GHz); sme_ReleaseGlobalLock( &pMac->sme ); } |
