diff options
| author | Abhishek Singh <absingh@codeaurora.org> | 2017-09-05 11:26:36 +0530 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-09-08 02:45:39 -0700 |
| commit | 7bbbb024ae787b5a57351337f0bd7c6447c3d11e (patch) | |
| tree | 4d5c75ad0e3d4ac4e6bed38238fc8764b0ceba7a | |
| parent | 94defbe3c40fc1298a10b36cf92e61f4f4ff81ed (diff) | |
qcacld-2.0: Use user provided BW for 2.4Ghz HT connection
prima to qcacld-2.0 propagation
Add support to use user provided BW for 2.4Ghz HT connection.
If HT capability in connect req indicate connection in HT20, force
the connection in 2.4Ghz to HT20 only even if AP support HT40.
Added ini override_ht20_40_24g to enable/disable this feature.
Change-Id: Ia03b67b9d6487e3e27f1cf8875afe95af1300b4f
CRs-Fixed: 2104231
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 6 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 9 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 47 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/include/limSession.h | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 6 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSerDesUtils.c | 8 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limUtils.c | 7 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/sch/schBeaconProcess.c | 14 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 14 |
11 files changed, 107 insertions, 7 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index d3e466c409f2..12308603b405 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -302,6 +302,11 @@ enum #define CFG_CHANNEL_BONDING_MODE_MAX WNI_CFG_CHANNEL_BONDING_MODE_STAMAX #define CFG_CHANNEL_BONDING_MODE_DEFAULT WNI_CFG_CHANNEL_BONDING_MODE_STADEF +#define CFG_OVERRIDE_HT40_20_24GHZ_NAME "override_ht20_40_24g" +#define CFG_OVERRIDE_HT40_20_24GHZ_MIN 0 +#define CFG_OVERRIDE_HT40_20_24GHZ_MAX 1 +#define CFG_OVERRIDE_HT40_20_24GHZ_DEFAULT 0 + #define CFG_CHANNEL_BONDING_MODE_5GHZ_NAME "gChannelBondingMode5GHz" #define CFG_CHANNEL_BONDING_MODE_MIN WNI_CFG_CHANNEL_BONDING_MODE_STAMIN #define CFG_CHANNEL_BONDING_MODE_MAX WNI_CFG_CHANNEL_BONDING_MODE_STAMAX @@ -4786,6 +4791,7 @@ struct hdd_config { v_U32_t nAutoBmpsTimerValue; eHddDot11Mode dot11Mode; v_U32_t nChannelBondingMode24GHz; + bool override_ht20_40_24g; v_U32_t nChannelBondingMode5GHz; v_U32_t MaxRxAmpduFactor; v_U16_t TxRate; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index f14733a2c83e..00602a1a528e 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -573,6 +573,13 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_CHANNEL_BONDING_MODE_MIN, CFG_CHANNEL_BONDING_MODE_MAX), + REG_VARIABLE(CFG_OVERRIDE_HT40_20_24GHZ_NAME, WLAN_PARAM_Integer, + hdd_config_t, override_ht20_40_24g, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_OVERRIDE_HT40_20_24GHZ_DEFAULT, + CFG_OVERRIDE_HT40_20_24GHZ_MIN, + CFG_OVERRIDE_HT40_20_24GHZ_MAX), + REG_VARIABLE( CFG_CHANNEL_BONDING_MODE_5GHZ_NAME, WLAN_PARAM_Integer, hdd_config_t, nChannelBondingMode5GHz, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -5442,6 +5449,8 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSBandSwitchThreshold] value = [%u]", pHddCtx->cfg_ini->acsBandSwitchThreshold); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [ChannelBondingMode] Value = [%u]",pHddCtx->cfg_ini->nChannelBondingMode24GHz); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [%s] Value = [%u] ", + CFG_OVERRIDE_HT40_20_24GHZ_NAME, pHddCtx->cfg_ini->override_ht20_40_24g); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [ChannelBondingMode] Value = [%u]",pHddCtx->cfg_ini->nChannelBondingMode5GHz); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [dot11Mode] Value = [%u]",pHddCtx->cfg_ini->dot11Mode); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [WmmMode] Value = [%u] ",pHddCtx->cfg_ini->WmmMode); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index a74802cbe886..d0ac872db49c 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -23485,6 +23485,51 @@ static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, } #endif +/** + * wlan_hdd_check_ht20_ht40_ind() - check if Supplicant has indicated to + * connect in HT20 mode + * @hdd_ctx: hdd context + * @adapter: Pointer to the HDD adapter + * @req: Pointer to the structure cfg_connect_params receieved from user space + * + * This function will check if supplicant has indicated to to connect in HT20 + * mode. this is currently applicable only for 2.4Ghz mode only. + * if feature is enabled and supplicant indicate HT20 set + * force_24ghz_in_ht20 to true to force 2.4Ghz in HT20 else set it to false. + * + * Return: void + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) +static void wlan_hdd_check_ht20_ht40_ind(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + struct cfg80211_connect_params *req) +{ + hdd_wext_state_t *wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + tCsrRoamProfile *roam_profile; + + roam_profile = &wext_state->roamProfile; + roam_profile->force_24ghz_in_ht20 = false; + if (hdd_ctx->cfg_ini->override_ht20_40_24g && + !(req->ht_capa.cap_info & + IEEE80211_HT_CAP_SUP_WIDTH_20_40)) + roam_profile->force_24ghz_in_ht20 = true; + + hddLog(LOG1, FL("req->ht_capa.cap_info %x override_ht20_40_24g %d"), + req->ht_capa.cap_info, hdd_ctx->cfg_ini->override_ht20_40_24g); +} +#else +static inline void wlan_hdd_check_ht20_ht40_ind(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + struct cfg80211_connect_params *req) +{ + hdd_wext_state_t *wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + tCsrRoamProfile *roam_profile; + + roam_profile = &wext_state->roamProfile; + roam_profile->force_24ghz_in_ht20 = false; +} +#endif + /* * FUNCTION: __wlan_hdd_cfg80211_connect * This function is used to start the association process @@ -23585,6 +23630,8 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, if (0 != status) hddLog(VOS_TRACE_LEVEL_ERROR, FL("scan abort failed")); + wlan_hdd_check_ht20_ht40_ind(pHddCtx, pAdapter, req); + status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, req->ssid_len, req->bssid, bssid_hint, channel); diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 6a75db81f9d9..e5b56a1dd1b6 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -1203,6 +1203,7 @@ typedef struct sSirSmeJoinReq tAniBool spectrumMgtIndicator; tSirMacPowerCapInfo powerCap; tSirSupChnl supportedChannels; + bool force_24ghz_in_ht20; uint8_t sub20_channelwidth; #ifdef WLAN_FEATURE_FILS_SK struct cds_fils_connection_info fils_con_info; diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h index 2b695a87ed75..a8eafaa348a4 100644 --- a/CORE/MAC/src/pe/include/limSession.h +++ b/CORE/MAC/src/pe/include/limSession.h @@ -525,6 +525,7 @@ typedef struct sPESession // Added to Support BT-AMP /* Number of STAs that do not support ECSA capability */ uint8_t lim_non_ecsa_cap_num; uint32_t sta_auth_retries_for_code17; + bool force_24ghz_in_ht20; #ifdef WLAN_FEATURE_FILS_SK struct pe_fils_session *fils_info; #endif diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index d756878523cc..fa18849ce826 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -2125,13 +2125,14 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->vdev_nss = vdev_type_nss->sta; limLog(pMac, LOG1, - FL("persona: %d, nss: %d cbMode: %d enableHtSmps: %d htSmps: %d supported NSS 1x1: %d"), + FL("persona: %d, nss: %d cbMode: %d enableHtSmps: %d htSmps: %d supported NSS 1x1: %d force_24ghz_in_ht20 %d"), psessionEntry->pePersona, psessionEntry->vdev_nss, pSmeJoinReq->cbMode, psessionEntry->enableHtSmps, psessionEntry->htSmpsvalue, - psessionEntry->supported_nss_1x1); + psessionEntry->supported_nss_1x1, + pSmeJoinReq->force_24ghz_in_ht20); #ifdef WLAN_FEATURE_11AC psessionEntry->vhtCapability = IS_DOT11_MODE_VHT(psessionEntry->dot11mode); @@ -2179,6 +2180,7 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->gLimPhyMode = pSmeJoinReq->bssDescription.nwType; handleHTCapabilityandHTInfo(pMac, psessionEntry); psessionEntry->htSupportedChannelWidthSet = (pSmeJoinReq->cbMode > 0)?1:0; // This is already merged value of peer and self - done by csr in csrGetCBModeFromIes + psessionEntry->force_24ghz_in_ht20 = pSmeJoinReq->force_24ghz_in_ht20; psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet; psessionEntry->htSecondaryChannelOffset = pSmeJoinReq->cbMode; diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c index 15ed4afcb443..795e42c41c80 100644 --- a/CORE/MAC/src/pe/lim/limSerDesUtils.c +++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c @@ -971,6 +971,14 @@ limJoinReqSerDes(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq, tANI_U8 *pBuf) limLog(pMac, LOGE, FL("remaining len %d is too short"), len); return eSIR_FAILURE; } + /* Extract force_24ghz_in_ht20 */ + pJoinReq->force_24ghz_in_ht20 = *pBuf++; + len--; + if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) + { + limLog(pMac, LOGE, FL("remaining len %d is too short"), len); + return eSIR_FAILURE; + } // Extract uapsdPerAcBitmask pJoinReq->uapsdPerAcBitmask = *pBuf++; diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index 912d13895f3b..bed9c41c1ba3 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -4650,6 +4650,13 @@ void limUpdateStaRunTimeHTSwitchChnlParams( tpAniSirGlobal pMac, if( !limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry )) return; + if ((RF_CHAN_14 >= psessionEntry->currentOperChannel) && + psessionEntry->force_24ghz_in_ht20) { + limLog(pMac, LOG1, + FL("force_24_gh_in_ht20 is set and channel is 2.4 Ghz")); + return; + } + #if !defined WLAN_FEATURE_VOWIFI if(wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint) != eSIR_SUCCESS) { limLog( pMac, LOGP, FL( "Unable to get Local Power Constraint from cfg" )); diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c index 2b103449bbc5..9228840fad27 100644 --- a/CORE/MAC/src/pe/sch/schBeaconProcess.c +++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c @@ -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. * @@ -359,10 +359,16 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; - if (RF_CHAN_14 >= psessionEntry->currentOperChannel) - cbMode = pMac->roam.configParam.channelBondingMode24GHz; - else + if (RF_CHAN_14 >= psessionEntry->currentOperChannel) { + if (psessionEntry->force_24ghz_in_ht20) + cbMode = + WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + else + cbMode = + pMac->roam.configParam.channelBondingMode24GHz; + } else { cbMode = pMac->roam.configParam.channelBondingMode5GHz; + } if (LIM_IS_IBSS_ROLE(psessionEntry)) { limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry); diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 15b0f9e66310..d221f97b8ef4 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -1051,6 +1051,7 @@ typedef struct tagCsrRoamProfile tSirMacRateSet supported_rates; tSirMacRateSet extended_rates; uint8_t sub20_channelwidth; + bool force_24ghz_in_ht20; tCsrBssid bssid_hint; #ifdef WLAN_FEATURE_FILS_SK bool fils_connection; diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 1a832574870e..64122a0d1f66 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -3566,6 +3566,12 @@ eHalStatus csrRoamPrepareBssConfig(tpAniSirGlobal pMac, tCsrRoamProfile *pProfil } //validate CB pBssConfig->cbMode = csrGetCBModeFromIes(pMac, pBssDesc->channelId, pIes); + if (CSR_IS_CHANNEL_24GHZ(pBssDesc->channelId) && + pProfile->force_24ghz_in_ht20) { + pBssConfig->cbMode = PHY_SINGLE_CHANNEL_CENTERED; + smsLog(pMac, LOG1, + FL("force_24ghz_in_ht20 is set so set cbmode to 0")); + } }while(0); return (status); } @@ -7187,6 +7193,8 @@ eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, pDstProfile->ieee80211d = pSrcProfile->ieee80211d; pDstProfile->sap_dot11mc = pSrcProfile->sap_dot11mc; pDstProfile->do_not_roam = pSrcProfile->do_not_roam; + pDstProfile->force_24ghz_in_ht20 = + pSrcProfile->force_24ghz_in_ht20; vos_mem_copy(&pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys)); #ifdef WLAN_FEATURE_VOWIFI_11R @@ -14479,9 +14487,13 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe //CBMode *pBuf = (tANI_U8)pSession->bssParams.cbMode; pBuf += sizeof(ePhyChanBondState); + *pBuf = (tANI_U8)pProfile->force_24ghz_in_ht20; + pBuf++; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - FL("CSR PERSONA=%d CSR CbMode %d"), pProfile->csrPersona, pSession->bssParams.cbMode); + FL("CSR PERSONA=%d CSR CbMode %d force_24ghz_in_ht20 %d "), + pProfile->csrPersona, pSession->bssParams.cbMode, + pProfile->force_24ghz_in_ht20); // uapsdPerAcBitmask *pBuf = pProfile->uapsd_mask; |
