summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2017-03-17 11:18:40 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-03-24 19:07:27 -0700
commit0b46849cafba08e0b3a3cc4254e44b6800687ff6 (patch)
treee7fe45de4a57fea37bed49d7688e2daca3d1e9c9
parent604eac9339f4167bf92fed3fc2d5c7255ffc7751 (diff)
qcacld-3.0: Fix QDF ASSERT in wma_chan_phy_mode during driver load
If channel received in OEM channel info req is invalid for the current country code the channel width received will be invalid. When this invalid channel width is passed to wma_chan_phy_mode, it cause QDF ASSERT. To fix this if channel width is invalid set the phy mode invalid. Change-Id: Iafa29be61c94ac6138162d47c8efda7504f0acf2 CRs-Fixed: 2021053
-rw-r--r--core/hdd/src/wlan_hdd_oemdata.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c
index a0d5d0680ef1..e9059ec77408 100644
--- a/core/hdd/src/wlan_hdd_oemdata.c
+++ b/core/hdd/src/wlan_hdd_oemdata.c
@@ -447,15 +447,27 @@ static void hdd_update_channel_bw_info(hdd_context_t *hdd_ctx,
ch_params.ch_width = CH_WIDTH_MAX;
cds_set_channel_params(chan, sec_ch_2g, &ch_params);
+
if (ch_params.center_freq_seg0)
hdd_chan_info->band_center_freq1 =
cds_chan_to_freq(ch_params.center_freq_seg0);
- hdd_info("chan %d dot11_mode %d ch_width %d sec offset %d freq_seg0 %d",
+ if (ch_params.ch_width < CH_WIDTH_INVALID)
+ phy_mode = wma_chan_phy_mode(chan,
+ ch_params.ch_width, wni_dot11_mode);
+ else
+ /*
+ * If channel width is CH_WIDTH_INVALID, It mean channel is
+ * invalid and should not have been received in channel info
+ * req. Set invalid phymode in this case.
+ */
+ phy_mode = MODE_UNKNOWN;
+
+ hdd_info("chan %d dot11_mode %d ch_width %d sec offset %d freq_seg0 %d phy_mode %d",
chan, wni_dot11_mode, ch_params.ch_width,
- ch_params.sec_ch_offset, hdd_chan_info->band_center_freq1);
+ ch_params.sec_ch_offset,
+ hdd_chan_info->band_center_freq1, phy_mode);
- phy_mode = wma_chan_phy_mode(chan, ch_params.ch_width, wni_dot11_mode);
WMI_SET_CHANNEL_MODE(hdd_chan_info, phy_mode);
}