Kaynağa Gözat

qcacld-3.0: Disable non-20 mhz 2G world regulatory channels

The minimum bandwidth supported is 5 MHZ. Kernel API
wiphy_apply_custom_regulatory can enable channels 12/13
with BW 5/10 even for reg rule 2402-2472. Circumvent the issue
by doing a check in the driver.

Change-Id: I9ad600eda2e507312a3016aa6d1fe6fdc41724f2
CRs-Fixed: 1079851
Amar Singhal 8 yıl önce
ebeveyn
işleme
b7fe2611ea
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 13 0
      core/hdd/src/wlan_hdd_regulatory.c

+ 13 - 0
core/hdd/src/wlan_hdd_regulatory.c

@@ -230,6 +230,8 @@ static void hdd_regulatory_wiphy_init(hdd_context_t *hdd_ctx,
 				     struct wiphy *wiphy)
 {
 	const struct ieee80211_regdomain *reg_rules;
+	int chan_num;
+	struct ieee80211_channel chan;
 
 	if (hdd_is_world_regdomain(reg->reg_domain)) {
 		reg_rules = hdd_get_world_regrules(reg);
@@ -248,6 +250,17 @@ static void hdd_regulatory_wiphy_init(hdd_context_t *hdd_ctx,
 	hdd_ctx->reg.reg_flags = wiphy->regulatory_flags;
 	wiphy_apply_custom_regulatory(wiphy, reg_rules);
 
+	/*
+	 * disable 2.4 Ghz channels that dont have 20 mhz bw
+	 */
+	for (chan_num = 0;
+	     chan_num < wiphy->bands[IEEE80211_BAND_2GHZ]->n_channels;
+	     chan_num++) {
+		chan = wiphy->bands[IEEE80211_BAND_2GHZ]->channels[chan_num];
+		if (chan.flags & IEEE80211_CHAN_NO_20MHZ)
+			chan.flags |= IEEE80211_CHAN_DISABLED;
+	}
+
 	/*
 	 * restore the driver regulatory flags since
 	 * wiphy_apply_custom_regulatory may have