From af639b45bdebe668dd7bd00d57169fdf99cbc3b0 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 16 Jun 2017 14:14:36 +0530 Subject: [PATCH] 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 --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 11 ++++++++++- core/mac/src/pe/lim/lim_utils.c | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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 e1faeccac184..61c3b0b87a0a 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 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, 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 b6a29bebc603..c08ead8f820f 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2662,7 +2662,6 @@ void lim_switch_primary_secondary_channel(tpAniSirGlobal pMac, 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 @@ void lim_switch_primary_secondary_channel(tpAniSirGlobal pMac, 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 ==