qcacld-3.0: Fix cb mode calculation for 2.4 GHz

If user configure to not use 40 MHz in 2.4 GHz, then avoid setting
40 MHz capability and use cb mode as
WNI_CFG_CHANNEL_BONDING_MODE_DISABLE for 2.4 GHz.

Change-Id: I4e9153e211e02f6b959e16dad4573c2b490cb215
CRs-Fixed: 3584510
This commit is contained in:
Abhishek Singh
2023-08-25 15:58:29 +05:30
committed by Rahul Choudhary
parent 4b86e41f32
commit 4f1ae8538d
5 changed files with 49 additions and 49 deletions

View File

@@ -285,16 +285,8 @@ void lim_process_beacon_eht_op(struct pe_session *session,
chan_id = wlan_reg_freq_to_chan(wlan_vdev_get_pdev(vdev), chan_id = wlan_reg_freq_to_chan(wlan_vdev_get_pdev(vdev),
bcn_ptr->chan_freq); bcn_ptr->chan_freq);
if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) { cb_mode = lim_get_cb_mode_for_freq(mac_ctx, session,
if (session->force_24ghz_in_ht20) session->curr_op_freq);
cb_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
else
cb_mode =
mac_ctx->roam.configParam.channelBondingMode24GHz;
} else {
cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz;
}
if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) {
/* /*
* if channel bonding is disabled from INI do not * if channel bonding is disabled from INI do not

View File

@@ -3811,26 +3811,39 @@ static void lim_ht_switch_chnl_req(struct pe_session *session)
} }
} }
uint8_t lim_get_cb_mode_for_freq(struct mac_context *mac,
struct pe_session *session,
qdf_freq_t chan_freq)
{
uint8_t cb_mode = mac->roam.configParam.channelBondingMode5GHz;
if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq)) {
if (session->force_24ghz_in_ht20) {
cb_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
pe_debug_rl("vdev %d force 20 Mhz in 2.4 GHz",
session->vdev_id);
} else {
cb_mode = mac->roam.configParam.channelBondingMode24GHz;
}
}
return cb_mode;
}
void lim_update_sta_run_time_ht_switch_chnl_params(struct mac_context *mac, void lim_update_sta_run_time_ht_switch_chnl_params(struct mac_context *mac,
tDot11fIEHTInfo *pHTInfo, tDot11fIEHTInfo *pHTInfo,
struct pe_session *pe_session) struct pe_session *pe_session)
{ {
qdf_freq_t chan_freq; qdf_freq_t chan_freq;
uint32_t self_cb_mode = mac->roam.configParam.channelBondingMode5GHz; uint8_t cb_mode;
if (WLAN_REG_IS_24GHZ_CH_FREQ(pe_session->curr_op_freq)) cb_mode = lim_get_cb_mode_for_freq(mac, pe_session,
self_cb_mode = mac->roam.configParam.channelBondingMode24GHz; pe_session->curr_op_freq);
/* If self capability is set to '20Mhz only', then do not change the CB mode. */ /* If self capability is set to '20Mhz only', then do not change the CB mode. */
if (self_cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) { if (cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) {
pe_debug("self_cb_mode 0 for freq %d", pe_debug_rl("self_cb_mode 0 for freq %d",
pe_session->curr_op_freq); pe_session->curr_op_freq);
return;
}
if (wlan_reg_is_24ghz_ch_freq(pe_session->curr_op_freq) &&
pe_session->force_24ghz_in_ht20) {
pe_debug("force_24ghz_in_ht20 is set and channel is 2.4 Ghz");
return; return;
} }
@@ -11184,10 +11197,8 @@ bool lim_update_channel_width(struct mac_context *mac_ctx,
enum phy_ch_width oper_mode; enum phy_ch_width oper_mode;
enum phy_ch_width fw_vht_ch_wd; enum phy_ch_width fw_vht_ch_wd;
if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) cb_mode = lim_get_cb_mode_for_freq(mac_ctx, session,
cb_mode = mac_ctx->roam.configParam.channelBondingMode24GHz; session->curr_op_freq);
else
cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz;
/* /*
* Do not update the channel bonding mode if channel bonding * Do not update the channel bonding mode if channel bonding
* mode is disabled in INI. * mode is disabled in INI.

View File

@@ -462,6 +462,18 @@ void lim_decide_sta_protection_on_assoc(struct mac_context *mac,
tpSchBeaconStruct pBeaconStruct, tpSchBeaconStruct pBeaconStruct,
struct pe_session *pe_session); struct pe_session *pe_session);
/**
* lim_get_cb_mode_for_freq() - Get cb mode depending on the freq
* @mac: pointer to Global MAC structure
* @pe_session: pe session
* @chan_freq: Freq to get cb mode for
*
* Return: cb mode allowed for the freq
*/
uint8_t lim_get_cb_mode_for_freq(struct mac_context *mac,
struct pe_session *session,
qdf_freq_t chan_freq);
/** /**
* lim_update_sta_run_time_ht_switch_chnl_params() - Process change in HT * lim_update_sta_run_time_ht_switch_chnl_params() - Process change in HT
* bandwidth * bandwidth

View File

@@ -433,8 +433,8 @@ sch_bcn_update_he_ies(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
static void static void
sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds, sch_bcn_update_opmode_change(struct mac_context *mac_ctx, tpDphHashNode sta_ds,
struct pe_session *session, tpSchBeaconStruct bcn, struct pe_session *session, tpSchBeaconStruct bcn,
tpSirMacMgmtHdr mac_hdr, uint8_t cb_mode) tpSirMacMgmtHdr mac_hdr)
{ {
enum phy_ch_width ch_bw; enum phy_ch_width ch_bw;
enum phy_ch_width ch_width = CH_WIDTH_20MHZ; enum phy_ch_width ch_width = CH_WIDTH_20MHZ;
@@ -550,23 +550,13 @@ sch_bcn_process_sta_opmode(struct mac_context *mac_ctx,
{ {
tpDphHashNode sta = NULL; tpDphHashNode sta = NULL;
uint16_t aid; uint16_t aid;
uint8_t cb_mode;
if (wlan_reg_is_24ghz_ch_freq(session->curr_op_freq)) {
if (session->force_24ghz_in_ht20)
cb_mode = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
else
cb_mode =
mac_ctx->roam.configParam.channelBondingMode24GHz;
} else
cb_mode = mac_ctx->roam.configParam.channelBondingMode5GHz;
/* check for VHT capability */ /* check for VHT capability */
sta = dph_lookup_hash_entry(mac_ctx, pMh->sa, &aid, sta = dph_lookup_hash_entry(mac_ctx, pMh->sa, &aid,
&session->dph.dphHashTable); &session->dph.dphHashTable);
if (!sta) if (!sta)
return; return;
sch_bcn_update_opmode_change(mac_ctx, sta, session, bcn, pMh, sch_bcn_update_opmode_change(mac_ctx, sta, session, bcn, pMh);
cb_mode);
sch_bcn_update_he_ies(mac_ctx, sta, session, bcn, pMh); sch_bcn_update_he_ies(mac_ctx, sta, session, bcn, pMh);
lim_detect_change_in_srp(mac_ctx, sta, session, bcn); lim_detect_change_in_srp(mac_ctx, sta, session, bcn);
return; return;

View File

@@ -989,6 +989,7 @@ populate_dot11f_ht_caps(struct mac_context *mac,
QDF_STATUS nSirStatus; QDF_STATUS nSirStatus;
uint8_t disable_high_ht_mcs_2x2 = 0; uint8_t disable_high_ht_mcs_2x2 = 0;
struct ch_params ch_params = {0}; struct ch_params ch_params = {0};
uint8_t cb_mode;
tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo;
tSirMacASCapabilityInfo *pASCapabilityInfo; tSirMacASCapabilityInfo *pASCapabilityInfo;
@@ -1017,10 +1018,11 @@ populate_dot11f_ht_caps(struct mac_context *mac,
pDot11f->shortGI20MHz = ht_cap_info->short_gi_20_mhz; pDot11f->shortGI20MHz = ht_cap_info->short_gi_20_mhz;
pDot11f->shortGI40MHz = ht_cap_info->short_gi_40_mhz; pDot11f->shortGI40MHz = ht_cap_info->short_gi_40_mhz;
} else { } else {
cb_mode = lim_get_cb_mode_for_freq(mac, pe_session,
pe_session->curr_op_freq);
if (WLAN_REG_IS_24GHZ_CH_FREQ(pe_session->curr_op_freq) && if (WLAN_REG_IS_24GHZ_CH_FREQ(pe_session->curr_op_freq) &&
LIM_IS_STA_ROLE(pe_session) && LIM_IS_STA_ROLE(pe_session) &&
WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != cb_mode != WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) {
mac->roam.configParam.channelBondingMode24GHz) {
pDot11f->supportedChannelWidthSet = 1; pDot11f->supportedChannelWidthSet = 1;
ch_params.ch_width = CH_WIDTH_40MHZ; ch_params.ch_width = CH_WIDTH_40MHZ;
wlan_reg_set_channel_params_for_pwrmode( wlan_reg_set_channel_params_for_pwrmode(
@@ -1158,14 +1160,7 @@ ePhyChanBondState wlan_get_cb_mode(struct mac_context *mac,
uint32_t self_cb_mode; uint32_t self_cb_mode;
struct ch_params ch_params = {0}; struct ch_params ch_params = {0};
if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) { self_cb_mode = lim_get_cb_mode_for_freq(mac, pe_session, ch_freq);
self_cb_mode =
mac->roam.configParam.channelBondingMode24GHz;
} else {
self_cb_mode =
mac->roam.configParam.channelBondingMode5GHz;
}
if (self_cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE) if (self_cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE)
return PHY_SINGLE_CHANNEL_CENTERED; return PHY_SINGLE_CHANNEL_CENTERED;