Prechádzať zdrojové kódy

qcacld-3.0: Reject SAP start on 6 GHz channel if band bitmask not set

Currently host doesn't check if 6 GHz band bitmask is set
when receives SAP start on a 6 GHz channel. This can cause
SAP start on a 6 GHz channel when set_fcc_channel is set.

To avoid this issue, reject SAP start on a 6 GHz channel
if 6 GHz band bitmask is not set.

Change-Id: I0dd2b1fac7c4293498f7747665302bd72b7aaa23
CRs-Fixed: 3481002
Asutosh Mohapatra 1 rok pred
rodič
commit
e77ff11865
1 zmenil súbory, kde vykonal 12 pridanie a 0 odobranie
  1. 12 0
      core/hdd/src/wlan_hdd_hostapd.c

+ 12 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -3366,6 +3366,12 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_chan_freq,
 		return -EBUSY;
 	}
 
+	if (wlan_reg_is_6ghz_chan_freq(target_chan_freq) &&
+	    !wlan_reg_is_6ghz_band_set(hdd_ctx->pdev)) {
+		hdd_err("6 GHz band disabled");
+		return -EINVAL;
+	}
+
 	ret = hdd_validate_channel_and_bandwidth(adapter,
 						 target_chan_freq, target_bw);
 	if (ret) {
@@ -7704,6 +7710,12 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 	channel_width = wlan_hdd_get_channel_bw(params->chandef.width);
 	freq = (qdf_freq_t)params->chandef.chan->center_freq;
 
+	if (wlan_reg_is_6ghz_chan_freq(freq) &&
+	    !wlan_reg_is_6ghz_band_set(hdd_ctx->pdev)) {
+		hdd_err("6 GHz band disabled.");
+		return -EINVAL;
+	}
+
 	chandef = &params->chandef;
 	if ((adapter->device_mode == QDF_SAP_MODE ||
 	     adapter->device_mode == QDF_P2P_GO_MODE) &&