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
This commit is contained in:
@@ -285,8 +285,4 @@ void csr_process_set_dual_mac_config(tpAniSirGlobal mac, tSmeCmd *command);
|
||||
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 ) */
|
||||
|
@@ -9823,18 +9823,6 @@ void sme_update_enable_ssr(tHalHandle hHal, bool enableSSR)
|
||||
return;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@@ -12602,6 +12602,8 @@ 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 ch_params = {0};
|
||||
|
||||
if (WLAN_REG_IS_24GHZ_CH(primaryChn)) {
|
||||
ChannelBondingMode =
|
||||
pMac->roam.configParam.channelBondingMode24GHz;
|
||||
@@ -12665,12 +12667,16 @@ 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;
|
||||
|
||||
wlan_reg_set_channel_params(pMac->pdev, primaryChn,
|
||||
0, &ch_params);
|
||||
if (ch_params.ch_width == CH_WIDTH_20MHZ) {
|
||||
sme_err("40Mhz not supported for channel %d, continue with 20Mhz",
|
||||
centerChn);
|
||||
eRet = PHY_SINGLE_CHANNEL_CENTERED;
|
||||
}
|
||||
}
|
||||
return eRet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user