2013-01-11 13:23:04

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Felix Fietkau <[email protected]>
---
net/wireless/reg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index a21d703..de02d63 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -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,
--
1.8.0.2



2013-01-11 13:31:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] wireless: fix regulatory HT40 allowed check

On Fri, 2013-01-11 at 14:22 +0100, Felix Fietkau wrote:
> 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