Skip to contentSkip to conversation

wireless: fix enabling channel 12 for custom regulatory domain

PATCH New Ganapathi Bhat 1 participant 1 message Dec 20, 2019 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wireless: fix enabling channel 12 for custom regulatory domain

'e33e2241e272 ("Revert "cfg80211: Use 5MHz bandwidth by default when checking usable channels"")' fixed a broken regulatory(which leave channel 12 open for AP). We need similar fix, in case of custom regulatory domain as well.

---
 net/wireless/reg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/wireless/reg.c +4 -3
index 446c76d..91fa3df 100644
@@ -2261,14 +2261,15 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator)
 
 static void handle_channel_custom(struct wiphy *wiphy,
 				  struct ieee80211_channel *chan,
-				  const struct ieee80211_regdomain *regd)
+				  const struct ieee80211_regdomain *regd,
+				  u32 min_bw)
 {
 	u32 bw_flags = 0;
 	const struct ieee80211_reg_rule *reg_rule = NULL;
 	const struct ieee80211_power_rule *power_rule = NULL;
 	u32 bw;
 
-	for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) {
+	for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) {
 		reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq),
 					      regd, bw);
 		if (!IS_ERR(reg_rule))
@@ -2325,7 +2326,7 @@ static void handle_band_custom(struct wiphy *wiphy,
 		return;
 
 	for (i = 0; i < sband->n_channels; i++)
-		handle_channel_custom(wiphy, &sband->channels[i], regd);
+		handle_channel_custom(wiphy, &sband->channels[i], regd, MHZ_TO_KHZ(20));
 }
 
 /* Used by drivers prior to wiphy registration */
Signature · 1 line
1.9.1