git: bb53dafe145d - stable/13 - LinuxKPI: 802.11 correct enum ieee80211_channel_flags

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 20 Jan 2022 14:46:17 UTC
The branch stable/13 has been updated by bz:

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

commit bb53dafe145d47d77a306d676544634dd4416b47
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-20 14:05:37 +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][2].
    It will hopefully also fix the one or other oddity.
    
    Reported by:    ambrisko, Mike Tancsa (mike sentex.net) [1]
    Confirmed to fix by: ambrisko, Mike Tancsa (mike sentex.net) [2]
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit d7ce88aafc870944d5eda477b125478f56844f81)
---
 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)