Quellcode durchsuchen

qcacld-3.0: Assign acs_cfg->end_ch before use

In __wlan_hdd_cfg80211_do_acs(), when gAP11ACOverride is 1,
it sets vht_enabled to 1, hw_mode to 11ac and acs_cfg->ch_width
to the value of ini gVhtChannelWidth. If acs_cfg->end_ch is less
than 14 and acs_cfg->ch_width is 80Mhz, set acs_cfg->ch_width to
40Mhz. As acs_cfg->end_ch is not assigned yet, it is 0 due to
which acs_cfg->ch_width gets assigned to 40Mhz.

Assign acs_cfg->end_ch before use when gAP11ACOverride is 1 in
__wlan_hdd_cfg80211_do_acs().

Change-Id: If8bcc7470c1693791dfc64ec0b6059c09747d739
CRs-Fixed: 2184017
Himanshu Agarwal vor 7 Jahren
Ursprung
Commit
1ed8bffa9e
1 geänderte Dateien mit 14 neuen und 10 gelöschten Zeilen
  1. 14 10
      core/hdd/src/wlan_hdd_cfg80211.c

+ 14 - 10
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2655,13 +2655,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 				  pcl_channels_weight_list[i]);
 	}
 
-	status = wlan_hdd_set_acs_ch_range(sap_config, hw_mode,
-					   ht_enabled, vht_enabled);
-	if (status) {
-		hdd_err("set acs channel range failed");
-		goto out;
-	}
-
 	if (hdd_ctx->config->force_sap_acs) {
 		hdd_debug("forcing SAP acs start and end channel");
 		status = wlan_hdd_reset_force_acs_chan_range(hdd_ctx,
@@ -2685,19 +2678,30 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 		sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
 		sap_config->acs_cfg.ch_width =
 					hdd_ctx->config->vhtChannelWidth;
-		ch_width = 80;
+		status = wlan_hdd_set_acs_ch_range(sap_config, hw_mode,
+						   ht_enabled, vht_enabled);
+		if (status) {
+			hdd_err("set acs channel range failed");
+			goto out;
+		}
 		/* No VHT80 in 2.4G so perform ACS accordingly */
 		if (sap_config->acs_cfg.end_ch <= 14 &&
 		    sap_config->acs_cfg.ch_width == eHT_CHANNEL_WIDTH_80MHZ) {
 			sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_40MHZ;
-			ch_width = 40;
 			hdd_debug("resetting to 40Mhz in 2.4Ghz");
 		}
+	} else {
+		status = wlan_hdd_set_acs_ch_range(sap_config, hw_mode,
+						   ht_enabled, vht_enabled);
+		if (status) {
+			hdd_err("set acs channel range failed");
+			goto out;
+		}
 	}
 
 	hdd_debug("ACS Config for %s: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d band %d",
 		adapter->dev->name, sap_config->acs_cfg.hw_mode,
-		ch_width, ht_enabled, vht_enabled,
+		sap_config->acs_cfg.ch_width, ht_enabled, vht_enabled,
 		sap_config->acs_cfg.start_ch, sap_config->acs_cfg.end_ch,
 		sap_config->acs_cfg.band);