summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2017-08-21 12:30:39 +0530
committersnandini <snandini@codeaurora.org>2017-08-23 16:01:40 -0700
commitb6449c5ae1906ea59f403bac65bb2cddd315e162 (patch)
treecdbd6a6bce46268803172319bf10e071013425fb
parent699f1318e9ed5ac75dfa3d180b162d47ec21b04e (diff)
qcacld-3.0: Connect in 20Mhz when country code restrict channel in 20Mhz
Even if channel is restricted to 20Mhz in a country code, the device connect in 40-80Mhz. Fix this by checking the max bandwidth supported by the country code while calculating the CB mode. Change-Id: Ibbf538309191b25fe944062ea618033c818095da CRs-Fixed: 2095247
-rw-r--r--core/sme/inc/sme_inside.h3
-rw-r--r--core/sme/src/common/sme_api.c13
-rw-r--r--core/sme/src/csr/csr_api_roam.c15
3 files changed, 9 insertions, 22 deletions
diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h
index a3c9e49e0742..7aebd87117cf 100644
--- a/core/sme/inc/sme_inside.h
+++ b/core/sme/inc/sme_inside.h
@@ -337,7 +337,4 @@ void csr_process_set_antenna_mode(tpAniSirGlobal mac, tSmeCmd *command);
void csr_process_set_hw_mode(tpAniSirGlobal mac, tSmeCmd *command);
void csr_process_nss_update_req(tpAniSirGlobal mac, tSmeCmd *command);
-QDF_STATUS sme_check_ch_in_band(tpAniSirGlobal mac_ctx, uint8_t start_ch,
- uint8_t ch_cnt);
-
#endif /* #if !defined( __SMEINSIDE_H ) */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 014551a47eb5..8a6febec38ba 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -10958,19 +10958,6 @@ void sme_update_enable_ssr(tHalHandle hHal, bool enableSSR)
}
}
-QDF_STATUS sme_check_ch_in_band(tpAniSirGlobal mac_ctx, uint8_t start_ch,
- uint8_t ch_cnt)
-{
- uint8_t i;
-
- for (i = 0; i < ch_cnt; i++) {
- if (QDF_STATUS_SUCCESS != csr_is_valid_channel(mac_ctx,
- (start_ch + i*4)))
- return QDF_STATUS_E_FAILURE;
- }
- return QDF_STATUS_SUCCESS;
-}
-
/*convert the ini value to the ENUM used in csr and MAC for CB state*/
ePhyChanBondState sme_get_cb_phy_state_from_cb_ini_value(uint32_t cb_ini_value)
{
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index cf8732eacbec..4da52f6131ab 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -12985,6 +12985,7 @@ static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac,
ePhyChanBondState eRet = PHY_SINGLE_CHANNEL_CENTERED;
uint8_t centerChn;
uint32_t ChannelBondingMode;
+ struct ch_params_s ch_params = {0};
if (CDS_IS_CHANNEL_24GHZ(primaryChn)) {
ChannelBondingMode =
@@ -13049,12 +13050,14 @@ static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac,
break;
}
- if ((PHY_SINGLE_CHANNEL_CENTERED != eRet) &&
- (QDF_STATUS_SUCCESS != sme_check_ch_in_band(pMac,
- centerChn - 2, 2))) {
- sme_err("Invalid center channel (%d), disable 40MHz mode",
- centerChn);
- eRet = PHY_SINGLE_CHANNEL_CENTERED;
+ if (PHY_SINGLE_CHANNEL_CENTERED != eRet) {
+ ch_params.ch_width = CH_WIDTH_MAX;
+ cds_set_channel_params(primaryChn, 0, &ch_params);
+ if (ch_params.ch_width == CH_WIDTH_20MHZ) {
+ sme_err("40Mhz not supported for channel %d, continue with 20Mhz",
+ primaryChn);
+ eRet = PHY_SINGLE_CHANNEL_CENTERED;
+ }
}
return eRet;
}