git: d7ce88aafc87 - main - LinuxKPI: 802.11 correct enum ieee80211_channel_flags

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sun, 16 Jan 2022 22:31:12 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=d7ce88aafc870944d5eda477b125478f56844f81

commit d7ce88aafc870944d5eda477b125478f56844f81
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-01-16 22:22:23 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-01-16 22:30:38 +0000

    LinuxKPI: 802.11 correct enum ieee80211_channel_flags
    
    enum ieee80211_channel_flags are used as bit fields and not as 1..n.
    Correct the values using BIT(n).
    
    This is also hoped to fix problems with 7260 cards which come up and
    panic due to an empty channel list as all channels are set disabled [1].
    It will hopefully also fix the one or other oddity.
    
    Reported by:    ambrisko, Mike Tancsa (mike sentex.net) [1]
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/include/net/cfg80211.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index d0de3ec95086..8ec051e173a7 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -79,15 +79,15 @@ enum cfg80211_bss_ftypes {
 };
 
 enum ieee80211_channel_flags {
-	IEEE80211_CHAN_DISABLED			= 1,
-	IEEE80211_CHAN_INDOOR_ONLY,
-	IEEE80211_CHAN_IR_CONCURRENT,
-	IEEE80211_CHAN_RADAR,
-	IEEE80211_CHAN_NO_IR,
-	IEEE80211_CHAN_NO_HT40MINUS,
-	IEEE80211_CHAN_NO_HT40PLUS,
-	IEEE80211_CHAN_NO_80MHZ,
-	IEEE80211_CHAN_NO_160MHZ,
+	IEEE80211_CHAN_DISABLED			= BIT(0),
+	IEEE80211_CHAN_INDOOR_ONLY		= BIT(1),
+	IEEE80211_CHAN_IR_CONCURRENT		= BIT(2),
+	IEEE80211_CHAN_RADAR			= BIT(3),
+	IEEE80211_CHAN_NO_IR			= BIT(4),
+	IEEE80211_CHAN_NO_HT40MINUS		= BIT(5),
+	IEEE80211_CHAN_NO_HT40PLUS		= BIT(6),
+	IEEE80211_CHAN_NO_80MHZ			= BIT(7),
+	IEEE80211_CHAN_NO_160MHZ		= BIT(8),
 };
 #define	IEEE80211_CHAN_NO_HT40	(IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS)