From d35f19ff6637c902a337f7df8e115d55fa7332cb Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Tue, 14 Apr 2020 23:04:32 +0530 Subject: [PATCH] qcacld-3.0: Fill proper seg0 and seg1 values In the API lim_extract_ap_capability the driver depends on the value of seg0 and seg1 values from the AP and blindly fills that and sends that as part of vdev start params. There can be some APs which do not fill the seg0 and seg1 APs correctly and blindly depending upon those values can lead to wrong seg0 and seg1 thus leading to FW assert. Fix is to fill the seg0 value as centre channel of 80Mhz and seg1 as 0 in case of 80Mhz BW. Since these are unique values and dependent on channel number (primary) driver can fill that directly rather than depending on the AP for them. Change-Id: I46f2a81b443e1d0d62eb039878add15310595c8c CRs-Fixed: 2664405 --- core/mac/src/pe/lim/lim_prop_exts_utils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 0051df3c93..d4b064ddc5 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -398,6 +398,9 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, else if (center_freq_diff > 16) ap_bcon_ch_width = WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ; + else + ap_bcon_ch_width = + WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; } fw_vht_ch_wd = wma_get_vht_ch_width(); @@ -466,17 +469,14 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, */ vht_ch_wd = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; session->ch_center_freq_seg1 = 0; + session->ch_center_freq_seg0 = + lim_get_80Mhz_center_channel(channel); } } else if (vht_ch_wd == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) { /* DUT or AP supports only 80MHz */ - if (ap_bcon_ch_width == - WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ && - !new_ch_width_dfn) - /* AP is in 160MHz mode */ - session->ch_center_freq_seg0 = - lim_get_80Mhz_center_channel(channel); - else - session->ch_center_freq_seg1 = 0; + session->ch_center_freq_seg0 = + lim_get_80Mhz_center_channel(channel); + session->ch_center_freq_seg1 = 0; } session->ch_width = vht_ch_wd + 1; }