diff options
| author | Krishna Kumaar Natarajan <kknatara@qca.qualcomm.com> | 2014-12-02 13:03:06 -0800 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-12-05 14:56:51 +0530 |
| commit | ac37481e90a906ece12ae47696487fcfc91b8486 (patch) | |
| tree | 8364867e292bc9573ca196df4793599418571016 | |
| parent | e175c56636ebf61b3b84eaca6c884456596a0a55 (diff) | |
qcacld: Fix to advertise HT40 capabilities only when allowed
Currently SAP advertises HT40 capabilities for country code ID and
CR in 2.4GHZ. ID and CR allows only HT20 in 2.4GHz.
This change set fix the issue by validating the 40MHz channel against
the regulatory domain and advertise HT40 capabilities only if allowed.
Change-Id: Id90b68d35c30371de3fdf43ecd5e4e1a1b1fb0bf
CRs-Fixed: 766085
| -rw-r--r-- | CORE/SME/inc/smeInside.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/CORE/SME/inc/smeInside.h b/CORE/SME/inc/smeInside.h index 101849f3135a..30002c99f87a 100644 --- a/CORE/SME/inc/smeInside.h +++ b/CORE/SME/inc/smeInside.h @@ -245,6 +245,7 @@ eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, tReques void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); VOS_STATUS csrIsValidChannel(tpAniSirGlobal pMac, tANI_U8 chnNum); +tANI_BOOLEAN csrRoamIsValid40MhzChannel(tpAniSirGlobal pMac, tANI_U8 chnNum); eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme); eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index feced783b8cd..8f96b1de6939 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -11565,6 +11565,9 @@ static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, tANI_U8 i, startChan = channel, chanCnt = 0, chanBitmap = 0; tANI_BOOLEAN violation = VOS_FALSE; tANI_U32 newMode, mode; + tANI_U8 center_chan = channel; + /* to validate 40MHz channels against the regulatory domain */ + tANI_BOOLEAN ht40_phymode = VOS_FALSE; /* get the bonding mode */ mode = (channel <= 14) ? smeConfig->csrConfig.channelBondingMode24GHz : @@ -11581,10 +11584,14 @@ static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: startChan = channel - step; chanCnt = 2; + center_chan = channel - CSR_CB_CENTER_CHANNEL_OFFSET; + ht40_phymode = VOS_TRUE; break; case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: startChan = channel; chanCnt=2; + center_chan = channel + CSR_CB_CENTER_CHANNEL_OFFSET; + ht40_phymode = VOS_TRUE; break; #ifdef WLAN_FEATURE_11AC case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: @@ -11610,8 +11617,7 @@ static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, } /* find violation; also map valid channels to a bitmap */ - for (i = 0; i < chanCnt; i++) - { + for (i = 0; i < chanCnt; i++) { if (csrIsValidChannel(pMac, (startChan + (i * step))) == VOS_STATUS_SUCCESS) chanBitmap = chanBitmap | 1 << i; @@ -11619,6 +11625,12 @@ static VOS_STATUS sme_AdjustCBMode(tAniSirGlobal* pMac, violation = VOS_TRUE; } + /* validate if 40MHz channel is allowed */ + if (ht40_phymode) { + if (!csrRoamIsValid40MhzChannel(pMac, center_chan)) + violation = VOS_TRUE; + } + /* no channels are valid */ if (chanBitmap == 0) { |
