Browse Source

qcacld-3.0: Update BW in case of 2.4ghz ACS

The ini gChannelBondingMode24GHz specifies
that should the driver go for 40Mhz BW
in case of 2.4ghz or not by doing channel
bonding. If disabled (value 0) then driver
is supposed not to pick up 40Mhz for 2.4ghz
channels.
Currently in ACS request if there are 2.4ghz
channels only or in other sceanrios such as
concurrency where other channels are stripped
out, there may become a case where only 2.4ghz
are left out in the freq list which comes from
hostapd, the BW is not updated accordingly and
the results for ACS may still give the BW as 40
in case of 2.4ghz channel selection.

Fix is to modify the BW according to the ini
if there are only 2.4ghz frequencies present
so that driver limits the same while informing
the best channel to the hostapd.

Change-Id: Ib49726bf5e4245a63a696e41fee1d12d9a7a7909
CRs-Fixed: 2789358
gaurank kathpalia 4 years ago
parent
commit
65a9397c93
1 changed files with 12 additions and 5 deletions
  1. 12 5
      core/hdd/src/wlan_hdd_cfg80211.c

+ 12 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -3282,12 +3282,19 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 		sap_config->acs_cfg.ch_width = ch_width;
 	}
 
-	/* No VHT80 in 2.4G so perform ACS accordingly */
+	/* Check 2.4ghz cbmode and update BW if only 2.4 channels are present */
 	if (sap_config->acs_cfg.end_ch_freq <=
-		WLAN_REG_CH_TO_FREQ(CHAN_ENUM_2484) &&
-	    sap_config->acs_cfg.ch_width == eHT_CHANNEL_WIDTH_80MHZ) {
-		sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_40MHZ;
-		hdd_debug("resetting to 40Mhz in 2.4Ghz");
+	    WLAN_REG_CH_TO_FREQ(CHAN_ENUM_2484) &&
+	    sap_config->acs_cfg.ch_width >= eHT_CHANNEL_WIDTH_40MHZ) {
+		uint32_t channel_bonding_mode;
+
+		ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+						    &channel_bonding_mode);
+		sap_config->acs_cfg.ch_width = channel_bonding_mode ?
+			eHT_CHANNEL_WIDTH_40MHZ : eHT_CHANNEL_WIDTH_20MHZ;
+
+		hdd_debug("Only 2.4ghz channels, resetting BW to %d 2.4 cbmode %d",
+			  sap_config->acs_cfg.ch_width, channel_bonding_mode);
 	}
 
 	hdd_nofl_debug("ACS Config country %s ch_width %d hw_mode %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d band %d",