Browse Source

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
sheenam monga 4 years ago
parent
commit
0146ef4dd4
1 changed files with 12 additions and 0 deletions
  1. 12 0
      core/wma/src/wma_main.c

+ 12 - 0
core/wma/src/wma_main.c

@@ -2749,6 +2749,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);
 }