qcacld-3.0: Set proper sec channel offset if CSA Wide BW IE is present
If CSA Wide BW IE is present the sec channel offset is always set to
csa_params->sec_chan_offset which is always 0 and thus for next CSA the
BW will always be set to 20 MHz.
To fix this set proper sec channel offset if CSA Wide BW IE is present.
Change-Id: I813b04683cbce3f4f933562c23511de92ce4bcef
CRs-Fixed: 2062475
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index e1faecc..61c3b0b 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -2188,7 +2188,16 @@
lim_process_csa_wbw_ie(mac_ctx, csa_params,
chnl_switch_info, session_entry);
lim_ch_switch->sec_ch_offset =
- csa_params->sec_chan_offset;
+ PHY_SINGLE_CHANNEL_CENTERED;
+ if (chnl_switch_info->newChanWidth) {
+ if (csa_params->channel <
+ csa_params->new_ch_freq_seg1)
+ lim_ch_switch->sec_ch_offset =
+ PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
+ else
+ lim_ch_switch->sec_ch_offset =
+ PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
+ }
} else if (csa_params->ies_present_flag
& lim_xcsa_ie_present) {
chan_space =
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index b6a29be..c08ead8 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -2662,7 +2662,6 @@
uint8_t ch_center_freq_seg1,
enum phy_ch_width ch_width)
{
- uint8_t subband = 0;
/* Assign the callback to resume TX once channel is changed. */
psessionEntry->currentReqChannel = newChannel;
@@ -2686,7 +2685,8 @@
if (psessionEntry->htSecondaryChannelOffset !=
psessionEntry->gLimChannelSwitch.sec_ch_offset) {
pe_warn("switch old sec chnl: %d --> new sec chnl: %d",
- psessionEntry->htSecondaryChannelOffset, subband);
+ psessionEntry->htSecondaryChannelOffset,
+ psessionEntry->gLimChannelSwitch.sec_ch_offset);
psessionEntry->htSecondaryChannelOffset =
psessionEntry->gLimChannelSwitch.sec_ch_offset;
if (psessionEntry->htSecondaryChannelOffset ==