Skip to contentSkip to conversation

wireless: fix regulatory HT40 allowed check

PATCH Applied Felix Fietkau 2 participants 2 messages Jan 11, 2013 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wireless: fix regulatory HT40 allowed check

commit 1a9193185f462a51815fe48491f8a6fb6b942551 "regulatory: code cleanup" changed is_ht40_allowed without considering that IEEE80211_CHAN_NO_HT40 is not just one flag, but two.
This is causing HT40- to be blocked completely.

---
 net/wireless/reg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/wireless/reg.c +3 -1
index a21d703..de02d63 100644
@@ -1123,7 +1123,9 @@ static bool is_ht40_allowed(struct ieee80211_channel *chan)
 	if (chan->flags & IEEE80211_CHAN_DISABLED)
 		return false;
 	/* This would happen when regulatory rules disallow HT40 completely */
-	return !(chan->flags & IEEE80211_CHAN_NO_HT40);
+	if ((chan->flags & IEEE80211_CHAN_NO_HT40) == IEEE80211_CHAN_NO_HT40)
+		return false;
+	return true;
 }
 
 static void reg_process_ht_flags_channel(struct wiphy *wiphy,
Signature · 1 line
1.8.0.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Felix Fietkau

commit 1a9193185f462a51815fe48491f8a6fb6b942551 "regulatory: code cleanup" changed is_ht40_allowed without considering that IEEE80211_CHAN_NO_HT40 is not just one flag, but two.
This is causing HT40- to be blocked completely.

Applied, sorry about that.

johannes