From 489346578fd9fa22f03b923bf1192bd48dbcbcd8 Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Fri, 30 Oct 2020 10:09:23 +0530 Subject: [PATCH] qcacld-3.0: Validate and Update invalid dot11 mode based on band Currently during get_ch_info dot11 mode is fetched from mlme_cfg and used to calculate phy mode without any band validation which may cause errorneous behaviour in below cases due to invalid band and dot11 mode combination: a.) Band 2g and dot11 mode 11a b.) Band 5g and dot11 mode 11g c.) Band 5g and dot11 mode 11g_only c.) Band 5g and dot11 mode 11b Fix is to update modes in case mlme_cfg mode and frequency combination is invalid. Change-Id: I6390677cb196ebec3695d73cfe1e67086a67a8c0 CRs-Fixed: 2802679 --- core/wma/src/wma_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 35dbea694ad0..a3b6939295ba 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2756,6 +2756,18 @@ void wma_get_fw_phy_mode_for_freq_cb(uint32_t freq, uint32_t chan_width, } dot11_mode = mac->mlme_cfg->dot11_mode.dot11_mode; + + /* Update invalid dot11 modes to valid dot11 modes */ + if (WLAN_REG_IS_24GHZ_CH_FREQ(freq) && + dot11_mode == MLME_DOT11_MODE_11A) + dot11_mode = MLME_DOT11_MODE_11G; + + if (WLAN_REG_IS_5GHZ_CH_FREQ(freq) && + (dot11_mode == MLME_DOT11_MODE_11B || + dot11_mode == MLME_DOT11_MODE_11G || + dot11_mode == MLME_DOT11_MODE_11G_ONLY)) + dot11_mode = MLME_DOT11_MODE_11A; + host_phy_mode = wma_chan_phy_mode(freq, chan_width, dot11_mode); *phy_mode = wma_host_to_fw_phymode(host_phy_mode); }