git: 8d3711648981 - main - net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 18 Aug 2022 20:36:51 UTC
The branch main has been updated by bz:

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

commit 8d371164898141673ad3bfe6ee771931569e07d2
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-08-17 21:59:07 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-08-18 20:34:30 +0000

    net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*
    
    Rather than defining the same values in two places and having to do
    conflict resulution on the name in LKPI, change the defines to an
    enum in net80211.  In addition to de-duplication this also gives us
    value checks in certain cases.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    adrian
    Differential Revision: https://reviews.freebsd.org/D36250
---
 sys/compat/linuxkpi/common/include/net/cfg80211.h | 19 -------------------
 sys/net80211/ieee80211.h                          | 12 ++++++++----
 2 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h
index 15040ead3707..e7301e7b85cb 100644
--- a/sys/compat/linuxkpi/common/include/net/cfg80211.h
+++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h
@@ -129,12 +129,6 @@ struct linuxkpi_ieee80211_channel {
 	int	orig_mpwr;
 };
 
-enum ieee80211_vht_mcs_support {
-	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_7,
-	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_8,
-	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_9,
-};
-
 struct cfg80211_bitrate_mask {
 	/* TODO FIXME */
 	/* This is so weird but nothing else works out...*/
@@ -1700,19 +1694,6 @@ cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
 #ifndef LINUXKPI_NET80211
 #define	ieee80211_channel		linuxkpi_ieee80211_channel
 #define	ieee80211_regdomain		linuxkpi_ieee80211_regdomain
-/* net80211::IEEE80211_VHT_MCS_SUPPORT_0_n() conflicts */
-#if defined(IEEE80211_VHT_MCS_SUPPORT_0_7)
-#undef	IEEE80211_VHT_MCS_SUPPORT_0_7
-#endif
-#if defined(IEEE80211_VHT_MCS_SUPPORT_0_8)
-#undef	IEEE80211_VHT_MCS_SUPPORT_0_8
-#endif
-#if defined(IEEE80211_VHT_MCS_SUPPORT_0_9)
-#undef	IEEE80211_VHT_MCS_SUPPORT_0_9
-#endif
-#define	IEEE80211_VHT_MCS_SUPPORT_0_7	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_7
-#define	IEEE80211_VHT_MCS_SUPPORT_0_8	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_8
-#define	IEEE80211_VHT_MCS_SUPPORT_0_9	LKPI_IEEE80211_VHT_MCS_SUPPORT_0_9
 #endif
 
 #endif	/* _LINUXKPI_NET_CFG80211_H */
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h
index 1125810ee6ac..d2a3d9b6ddbc 100644
--- a/sys/net80211/ieee80211.h
+++ b/sys/net80211/ieee80211.h
@@ -769,10 +769,14 @@ struct ieee80211_ie_htinfo {
  * + rx_mcs_map/tx_mcs_map: bitmap of per-stream supported MCS;
  *    2 bits each.
  */
-#define	IEEE80211_VHT_MCS_SUPPORT_0_7		0	/* MCS0-7 */
-#define	IEEE80211_VHT_MCS_SUPPORT_0_8		1	/* MCS0-8 */
-#define	IEEE80211_VHT_MCS_SUPPORT_0_9		2	/* MCS0-9 */
-#define	IEEE80211_VHT_MCS_NOT_SUPPORTED		3	/* not supported */
+
+/* 802.11ac-2013, 8.4.2.160.3 Supported VHT-MCS and NSS Set field */
+enum ieee80211_vht_mcs_support {
+	IEEE80211_VHT_MCS_SUPPORT_0_7		= 0,	/* MCS0-7 */
+	IEEE80211_VHT_MCS_SUPPORT_0_8		= 1,	/* MCS0-8 */
+	IEEE80211_VHT_MCS_SUPPORT_0_9		= 2,	/* MCS0-9 */
+	IEEE80211_VHT_MCS_NOT_SUPPORTED		= 3	/* not supported */
+};
 
 struct ieee80211_vht_mcs_info {
 	uint16_t rx_mcs_map;