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
This commit is contained in:
Bjoern A. Zeeb 2022-08-17 21:59:07 +00:00
parent bd29f81763
commit 8d37116489
2 changed files with 8 additions and 23 deletions

View File

@ -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 */

View File

@ -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;