From ab1d6c2996a2d41ec335b538157bddad665b9039 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Wed, 6 May 2020 22:42:52 +0530 Subject: [PATCH] qcacld-3.0: Fill current oper freq in sw_target_freq During HT channel width change, host updates secondary channel number in "sw_target_freq" and not the primary channel frequency. LIM uses sw_target_freq to update the CSR sessions frequency which become invalid channel. During SAP start, as host uses this channel to check for SCC switch, the invalid frequency lead to invalid channel structure getting accessed. Hence, during HT channel width change, update sLimChannelSwitchInfo's sw_target_freq member with current operating frequency stored in pe_session's curr_op_freq. Change-Id: Ie7aaa2187d35dba74050263e1ebf6f72d106aa85 CRs-Fixed: 2680035 --- core/mac/src/pe/lim/lim_utils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index ad3ad8ff219f..733697b27686 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -3701,16 +3701,18 @@ static void lim_ht_switch_chnl_params(struct pe_session *pe_session) pe_session->curr_req_chan_freq = pe_session->curr_op_freq; pe_session->ch_center_freq_seg0 = center_freq; pe_session->gLimChannelSwitch.ch_center_freq_seg0 = center_freq; - pe_session->gLimChannelSwitch.sw_target_freq = center_freq; + pe_session->gLimChannelSwitch.sw_target_freq = + pe_session->curr_op_freq; pe_session->ch_width = ch_width; pe_session->gLimChannelSwitch.ch_width = ch_width; pe_session->gLimChannelSwitch.sec_ch_offset = pe_session->htSecondaryChannelOffset; pe_session->gLimChannelSwitch.ch_center_freq_seg1 = 0; - pe_debug("HT IE changed: Primary Channel: %d center chan: %d Channel Width: %d", + pe_debug("HT IE changed: Primary Channel: %d center chan: %d Channel Width: %d cur op freq %d", primary_channel, center_freq, - pe_session->htRecommendedTxWidthSet); + pe_session->htRecommendedTxWidthSet, + pe_session->gLimChannelSwitch.sw_target_freq); pe_session->channelChangeReasonCode = LIM_SWITCH_CHANNEL_HT_WIDTH; mac->lim.gpchangeChannelCallback = lim_switch_channel_cback;