net80211 / LinuxKPI: 802.11: revert / redo enum ieee80211_sta_rx_bw

The initial thought of migrating the LinuxKPI 802.11 enum into net80211
for shared use did not work out well.  Currently in the need for yet
another adjustment, I decided to undo/de-couple net80211 and
LinuxKPI 802.11 again.

The enum name now gets used in LinuxKPI based wifi drivers and it
turns out it is spelt differntly than what I used initially.
This creates a conflict.

net80211 still in the need to be able to express BW_320 in an uint8_t
will likely be fine with the current solution as well.  Rename the
enum and prefixes in net80211 to "net80211" instead of "ieee80211".
Apart from the names/prefix we leave the values the same.

In LinuxKPI add the enum with the expected name and use it there
throughout to make modern versions of LinuxKPI based wifi drivers
compile.

Sponsored by:	The FreeBSD Foundation
Fixes:		ca389486a9, 2c8b0d6205
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D52064
This commit is contained in:
Bjoern A. Zeeb 2025-08-14 01:28:29 +00:00
parent 0490757142
commit 06527b2818
16 changed files with 83 additions and 75 deletions

View file

@ -408,6 +408,14 @@ enum ieee80211_sta_state {
IEEE80211_STA_AUTHORIZED = 4, /* 802.1x */
};
enum ieee80211_sta_rx_bandwidth {
IEEE80211_STA_RX_BW_20 = 0,
IEEE80211_STA_RX_BW_40,
IEEE80211_STA_RX_BW_80,
IEEE80211_STA_RX_BW_160,
IEEE80211_STA_RX_BW_320,
};
enum ieee80211_tx_info_flags {
/* XXX TODO .. right shift numbers - not sure where that came from? */
IEEE80211_TX_CTL_AMPDU = BIT(0),

View file

@ -737,7 +737,7 @@ struct ieee80211_link_sta {
struct ieee80211_he_6ghz_capa he_6ghz_capa;
struct ieee80211_sta_eht_cap eht_cap;
uint8_t rx_nss;
enum ieee80211_sta_rx_bw bandwidth;
enum ieee80211_sta_rx_bandwidth bandwidth;
enum ieee80211_smps_mode smps_mode;
struct ieee80211_sta_agg agg;
struct ieee80211_sta_txpwr txpwr;

View file

@ -401,7 +401,7 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS)
return (0);
}
static enum ieee80211_sta_rx_bw
static enum ieee80211_sta_rx_bandwidth
lkpi_cw_to_rx_bw(enum nl80211_chan_width cw)
{
switch (cw) {
@ -425,7 +425,7 @@ lkpi_cw_to_rx_bw(enum nl80211_chan_width cw)
}
static enum nl80211_chan_width
lkpi_rx_bw_to_cw(enum ieee80211_sta_rx_bw rx_bw)
lkpi_rx_bw_to_cw(enum ieee80211_sta_rx_bandwidth rx_bw)
{
switch (rx_bw) {
case IEEE80211_STA_RX_BW_20:
@ -446,7 +446,7 @@ lkpi_sync_chanctx_cw_from_rx_bw(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{
struct ieee80211_chanctx_conf *chanctx_conf;
enum ieee80211_sta_rx_bw old_bw;
enum ieee80211_sta_rx_bandwidth old_bw;
uint32_t changed;
chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf,
@ -551,7 +551,7 @@ static void
lkpi_sta_sync_vht_from_ni(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct ieee80211_node *ni)
{
enum ieee80211_sta_rx_bw bw;
enum ieee80211_sta_rx_bandwidth bw;
uint32_t width;
int rx_nss;
uint16_t rx_mcs_map;

View file

@ -179,7 +179,7 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *sc,
const struct txschedule *sched = &sn->sched[rix0];
int max_pkt_length = 65530; // ATH_AGGR_MAXSIZE
// Note: this may not be true in all cases; need to check?
int is_ht40 = (an->an_node.ni_chw == IEEE80211_STA_RX_BW_40);
int is_ht40 = (an->an_node.ni_chw == NET80211_STA_RX_BW_40);
// Note: not great, but good enough..
int idx = is_ht40 ? MCS_HT40 : MCS_HT20;
@ -979,7 +979,7 @@ update_stats(struct ath_softc *sc, struct ath_node *an,
const int size_bin = size_to_bin(frame_size);
const int size = bin_to_size(size_bin);
int tt;
int is_ht40 = (an->an_node.ni_chw == IEEE80211_STA_RX_BW_40);
int is_ht40 = (an->an_node.ni_chw == NET80211_STA_RX_BW_40);
int pct;
if (!IS_RATE_DEFINED(sn, rix0))
@ -1365,7 +1365,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
continue;
printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix),
calc_usecs_unicast_packet(sc, 1600, rix, 0,0,
(ni->ni_chw == IEEE80211_STA_RX_BW_40)));
(ni->ni_chw == NET80211_STA_RX_BW_40)));
}
printf("\n");
}
@ -1396,7 +1396,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
sn->stats[y][rix].perfect_tx_time =
calc_usecs_unicast_packet(sc, size, rix, 0, 0,
(ni->ni_chw == IEEE80211_STA_RX_BW_40));
(ni->ni_chw == NET80211_STA_RX_BW_40));
sn->stats[y][rix].average_tx_time =
sn->stats[y][rix].perfect_tx_time;
}

View file

@ -283,7 +283,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf)
if (IS_HT_RATE(rate)) {
rc[i].flags |= ATH_RC_HT_FLAG;
if (ni->ni_chw == IEEE80211_STA_RX_BW_40)
if (ni->ni_chw == NET80211_STA_RX_BW_40)
rc[i].flags |= ATH_RC_CW40_FLAG;
/*
@ -295,13 +295,13 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf)
* and doesn't return the fractional part, so
* we are always "out" by some amount.
*/
if (ni->ni_chw == IEEE80211_STA_RX_BW_40 &&
if (ni->ni_chw == NET80211_STA_RX_BW_40 &&
ieee80211_ht_check_tx_shortgi_40(ni) &&
(bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) {
rc[i].flags |= ATH_RC_SGI_FLAG;
}
if (ni->ni_chw == IEEE80211_STA_RX_BW_20 &&
if (ni->ni_chw == NET80211_STA_RX_BW_20 &&
ieee80211_ht_check_tx_shortgi_20(ni) &&
(bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) {
rc[i].flags |= ATH_RC_SGI_FLAG;

View file

@ -4017,7 +4017,7 @@ mkpeerinfo(MWL_HAL_PEERINFO *pi, const struct ieee80211_node *ni)
pi->HTCapabilitiesInfo &= ~IEEE80211_HTCAP_SHORTGI40;
if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0)
pi->HTCapabilitiesInfo &= ~IEEE80211_HTCAP_SHORTGI20;
if (ni->ni_chw != IEEE80211_STA_RX_BW_40)
if (ni->ni_chw != NET80211_STA_RX_BW_40)
pi->HTCapabilitiesInfo &= ~IEEE80211_HTCAP_CHWIDTH40;
}
return pi;

View file

@ -101,12 +101,12 @@ r12a_tx_set_vht_bw(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
prim_chan = r12a_get_primary_channel(sc, ni->ni_chan);
if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_80)) {
if (ieee80211_vht_check_tx_bw(ni, NET80211_STA_RX_BW_80)) {
txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW,
R12A_TXDW5_DATA_BW80));
txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN,
prim_chan));
} else if (ieee80211_vht_check_tx_bw(ni, IEEE80211_STA_RX_BW_40)) {
} else if (ieee80211_vht_check_tx_bw(ni, NET80211_STA_RX_BW_40)) {
txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_BW,
R12A_TXDW5_DATA_BW40));
txd->txdw5 |= htole32(SM(R12A_TXDW5_DATA_PRIM_CHAN,

View file

@ -296,7 +296,7 @@ _db_show_sta(const struct ieee80211_node *ni)
ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan);
db_printf("\thtopmode 0x%x htstbc 0x%x chw %d (%s)\n",
ni->ni_htopmode, ni->ni_htstbc,
ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw));
ni->ni_chw, net80211_ni_chw_to_str(ni->ni_chw));
/* XXX ampdu state */
for (i = 0; i < WME_NUM_TID; i++)

View file

@ -1476,7 +1476,7 @@ ieee80211_ht_wds_init(struct ieee80211_node *ni)
ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI20;
if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {
ni->ni_htcap |= IEEE80211_HTCAP_CHWIDTH40;
ni->ni_chw = IEEE80211_STA_RX_BW_40;
ni->ni_chw = NET80211_STA_RX_BW_40;
if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan))
ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_ABOVE;
else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))
@ -1484,7 +1484,7 @@ ieee80211_ht_wds_init(struct ieee80211_node *ni)
if (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40)
ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI40;
} else {
ni->ni_chw = IEEE80211_STA_RX_BW_20;
ni->ni_chw = NET80211_STA_RX_BW_20;
ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_NONE;
}
ni->ni_htctlchan = ni->ni_chan->ic_ieee;
@ -1580,7 +1580,7 @@ ieee80211_ht_node_join(struct ieee80211_node *ni)
if (ni->ni_flags & IEEE80211_NODE_HT) {
vap->iv_ht_sta_assoc++;
if (ni->ni_chw == IEEE80211_STA_RX_BW_40)
if (ni->ni_chw == NET80211_STA_RX_BW_40)
vap->iv_ht40_sta_assoc++;
}
htinfo_update(vap);
@ -1598,7 +1598,7 @@ ieee80211_ht_node_leave(struct ieee80211_node *ni)
if (ni->ni_flags & IEEE80211_NODE_HT) {
vap->iv_ht_sta_assoc--;
if (ni->ni_chw == IEEE80211_STA_RX_BW_40)
if (ni->ni_chw == NET80211_STA_RX_BW_40)
vap->iv_ht40_sta_assoc--;
}
htinfo_update(vap);
@ -1827,7 +1827,7 @@ htinfo_update_chw(struct ieee80211_node *ni, int htflags, int vhtflags)
done:
/* update node's (11n) tx channel width */
ni->ni_chw = IEEE80211_IS_CHAN_HT40(ni->ni_chan) ?
IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;
NET80211_STA_RX_BW_40 : NET80211_STA_RX_BW_20;
return (ret);
}
@ -2689,11 +2689,11 @@ ht_recv_action_ht_txchwidth(struct ieee80211_node *ni,
* here.
*/
chw = (frm[2] == IEEE80211_A_HT_TXCHWIDTH_2040) ?
IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;
NET80211_STA_RX_BW_40 : NET80211_STA_RX_BW_20;
IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni,
"%s: HT txchwidth, width %d%s (%s)", __func__,
chw, ni->ni_chw != chw ? "*" : "", ieee80211_ni_chw_to_str(chw));
chw, ni->ni_chw != chw ? "*" : "", net80211_ni_chw_to_str(chw));
if (chw != ni->ni_chw) {
/* XXX does this need to change the ht40 station count? */
ni->ni_chw = chw;
@ -3832,5 +3832,5 @@ ieee80211_ht_check_tx_ht40(const struct ieee80211_node *ni)
return (IEEE80211_IS_CHAN_HT40(bss_chan) &&
IEEE80211_IS_CHAN_HT40(ni->ni_chan) &&
(ni->ni_chw == IEEE80211_STA_RX_BW_40));
(ni->ni_chw == NET80211_STA_RX_BW_40));
}

View file

@ -2673,7 +2673,7 @@ ieee80211_dump_node(struct ieee80211_node_table *nt __unused,
ni->ni_htctlchan, ni->ni_ht2ndchan);
net80211_printf("\thtopmode %x htstbc %x htchw %d (%s)\n",
ni->ni_htopmode, ni->ni_htstbc,
ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw));
ni->ni_chw, net80211_ni_chw_to_str(ni->ni_chw));
net80211_printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n",
ni->ni_vhtcap, (int) ni->ni_vht_chan1, (int) ni->ni_vht_chan2,
(int) ni->ni_vht_basicmcs);
@ -2831,7 +2831,7 @@ ieee80211_node_join(struct ieee80211_node *ni, int resp)
ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : "",
/* XXX update for VHT string */
ni->ni_flags & IEEE80211_NODE_HT ?
(ni->ni_chw == IEEE80211_STA_RX_BW_40 ? ", HT40" : ", HT20") : "",
(ni->ni_chw == NET80211_STA_RX_BW_40 ? ", HT40" : ", HT20") : "",
ni->ni_flags & IEEE80211_NODE_AMPDU ? " (+AMPDU)" : "",
ni->ni_flags & IEEE80211_NODE_AMSDU ? " (+AMSDU)" : "",
ni->ni_flags & IEEE80211_NODE_MIMO_RTS ? " (+SMPS-DYN)" :

View file

@ -109,33 +109,33 @@ enum ieee80211_mesh_mlstate {
"\20\1IDLE\2OPENSNT\2OPENRCV\3CONFIRMRCV\4ESTABLISHED\5HOLDING"
/*
* This structure is shared with LinuxKPI 802.11 code describing up-to
* which channel width the station can receive.
* This enum was shared with the LinuxKPI enum ieee80211_sta_rx_bandwidth
* describing up-to which channel width the station can receive.
* Rather than using hardcoded MHz values for the channel width use an enum with
* flags. This allows us to keep the uint8_t slot for ni_chw in
* struct ieee80211_node and means we do not have to sync to the value for
* LinuxKPI.
* struct ieee80211_node it means we do not have to sync to the value for
* LinuxKPI (just the names).
*
* NB: BW_20 needs to 0 and values need to be sorted! Cannot make it
* bitfield-alike for use with %b.
*/
enum ieee80211_sta_rx_bw {
IEEE80211_STA_RX_BW_20 = 0x00,
IEEE80211_STA_RX_BW_40,
IEEE80211_STA_RX_BW_80,
IEEE80211_STA_RX_BW_160,
IEEE80211_STA_RX_BW_320,
enum net80211_sta_rx_bw {
NET80211_STA_RX_BW_20 = 0x00,
NET80211_STA_RX_BW_40,
NET80211_STA_RX_BW_80,
NET80211_STA_RX_BW_160,
NET80211_STA_RX_BW_320,
} __packed;
static inline const char *
ieee80211_ni_chw_to_str(enum ieee80211_sta_rx_bw bw)
net80211_ni_chw_to_str(enum net80211_sta_rx_bw bw)
{
switch (bw) {
case IEEE80211_STA_RX_BW_20: return ("BW_20");
case IEEE80211_STA_RX_BW_40: return ("BW_40");
case IEEE80211_STA_RX_BW_80: return ("BW_80");
case IEEE80211_STA_RX_BW_160: return ("BW_160");
case IEEE80211_STA_RX_BW_320: return ("BW_320");
case NET80211_STA_RX_BW_20: return ("BW_20");
case NET80211_STA_RX_BW_40: return ("BW_40");
case NET80211_STA_RX_BW_80: return ("BW_80");
case NET80211_STA_RX_BW_160: return ("BW_160");
case NET80211_STA_RX_BW_320: return ("BW_320");
}
}
@ -285,7 +285,7 @@ struct ieee80211_node {
uint8_t ni_ht2ndchan; /* HT 2nd channel */
uint8_t ni_htopmode; /* HT operating mode */
uint8_t ni_htstbc; /* HT */
enum ieee80211_sta_rx_bw ni_chw; /* negotiated channel width */
enum net80211_sta_rx_bw ni_chw; /* negotiated channel width */
struct ieee80211_htrateset ni_htrates; /* negotiated ht rate set */
struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_TID];
struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID];

View file

@ -658,26 +658,26 @@ static uint16_t ieee80211_vht_mcs_allowed_list_160[] = {
*
* See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details.
*
* @param bw channel bandwidth, via enum ieee80211_sta_rx_bw
* @param bw channel bandwidth, via enum net80211_sta_rx_bw
* @param nss number of spatial streams, 1..8
* @returns bitmask of valid MCS rates from 0..9
*/
uint16_t
ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw bw, uint8_t nss)
ieee80211_phy_vht_get_mcs_mask(enum net80211_sta_rx_bw bw, uint8_t nss)
{
if (nss == 0 || nss > 8)
return (0);
switch (bw) {
case IEEE80211_STA_RX_BW_20:
case NET80211_STA_RX_BW_20:
return (ieee80211_vht_mcs_allowed_list_20[nss - 1]);
case IEEE80211_STA_RX_BW_40:
case NET80211_STA_RX_BW_40:
return (ieee80211_vht_mcs_allowed_list_40[nss - 1]);
case IEEE80211_STA_RX_BW_80:
case NET80211_STA_RX_BW_80:
return (ieee80211_vht_mcs_allowed_list_80[nss - 1]);
case IEEE80211_STA_RX_BW_160:
case NET80211_STA_RX_BW_160:
return (ieee80211_vht_mcs_allowed_list_160[nss - 1]);
case IEEE80211_STA_RX_BW_320:
case NET80211_STA_RX_BW_320:
/* invalid for VHT */
return (0);
}
@ -689,14 +689,14 @@ ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw bw, uint8_t nss)
*
* See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details.
*
* @param bw channel bandwidth, via enum ieee80211_sta_rx_bw
* @param bw channel bandwidth, via enum net80211_sta_rx_bw
* @param nss number of spatial streams, 1..8
* @param mcs MCS rate, 0..9
* @retval true if the NSS / MCS / bandwidth combination is valid
* @retval false if the NSS / MCS / bandwidth combination is not valid
*/
bool
ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw bw, uint8_t nss,
ieee80211_phy_vht_validate_mcs(enum net80211_sta_rx_bw bw, uint8_t nss,
uint8_t mcs)
{
uint16_t mask;
@ -737,7 +737,7 @@ static struct mcs_entry mcs_entries[] = {
/**
* @brief Calculate the bitrate of the given VHT MCS rate.
*
* @param bw Channel bandwidth (enum ieee80211_sta_rx_bw)
* @param bw Channel bandwidth (enum net80211_sta_rx_bw)
* @param nss Number of spatial streams, 1..8
* @param mcs MCS, 0..9
* @param is_shortgi True if short guard-interval (400nS)
@ -746,7 +746,7 @@ static struct mcs_entry mcs_entries[] = {
* @returns The bitrate in kbit/sec.
*/
uint32_t
ieee80211_phy_vht_get_mcs_kbit(enum ieee80211_sta_rx_bw bw,
ieee80211_phy_vht_get_mcs_kbit(enum net80211_sta_rx_bw bw,
uint8_t nss, uint8_t mcs, bool is_shortgi)
{
uint32_t sym_len, n_carriers;
@ -773,16 +773,16 @@ ieee80211_phy_vht_get_mcs_kbit(enum ieee80211_sta_rx_bw bw,
* See 802.11-2020 Table 21-5 (Timing-related constraints.)
*/
switch (bw) {
case IEEE80211_STA_RX_BW_20:
case NET80211_STA_RX_BW_20:
n_carriers = 52;
break;
case IEEE80211_STA_RX_BW_40:
case NET80211_STA_RX_BW_40:
n_carriers = 108;
break;
case IEEE80211_STA_RX_BW_80:
case NET80211_STA_RX_BW_80:
n_carriers = 234;
break;
case IEEE80211_STA_RX_BW_160:
case NET80211_STA_RX_BW_160:
n_carriers = 468;
break;
default:

View file

@ -221,13 +221,13 @@ uint32_t ieee80211_compute_duration_ht(uint32_t frameLen,
uint16_t rate, int streams, int isht40,
int isShortGI);
enum ieee80211_sta_rx_bw;
enum net80211_sta_rx_bw;
uint16_t ieee80211_phy_vht_get_mcs_mask(enum ieee80211_sta_rx_bw,
uint16_t ieee80211_phy_vht_get_mcs_mask(enum net80211_sta_rx_bw,
uint8_t);
bool ieee80211_phy_vht_validate_mcs(enum ieee80211_sta_rx_bw,
bool ieee80211_phy_vht_validate_mcs(enum net80211_sta_rx_bw,
uint8_t, uint8_t);
uint32_t ieee80211_phy_vht_get_mcs_kbit(enum ieee80211_sta_rx_bw,
uint32_t ieee80211_phy_vht_get_mcs_kbit(enum net80211_sta_rx_bw,
uint8_t, uint8_t, bool);
#endif /* _KERNEL */

View file

@ -1934,7 +1934,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
vap->iv_flags&IEEE80211_F_USEPROT ? ", protection" : "",
ni->ni_flags & IEEE80211_NODE_QOS ? ", QoS" : "",
ni->ni_flags & IEEE80211_NODE_HT ?
(ni->ni_chw == IEEE80211_STA_RX_BW_40 ? ", HT40" : ", HT20") : "",
(ni->ni_chw == NET80211_STA_RX_BW_40 ? ", HT40" : ", HT20") : "",
ni->ni_flags & IEEE80211_NODE_AMPDU ? " (+AMPDU)" : "",
ni->ni_flags & IEEE80211_NODE_AMSDU ? " (+AMSDU)" : "",
ni->ni_flags & IEEE80211_NODE_MIMO_RTS ? " (+SMPS-DYN)" :

View file

@ -974,7 +974,7 @@ ieee80211_vht_check_tx_vht40(const struct ieee80211_node *ni)
return (IEEE80211_IS_CHAN_VHT40(bss_chan) &&
IEEE80211_IS_CHAN_VHT40(ni->ni_chan) &&
(ni->ni_chw == IEEE80211_STA_RX_BW_40));
(ni->ni_chw == NET80211_STA_RX_BW_40));
}
/*
@ -1003,7 +1003,7 @@ ieee80211_vht_check_tx_vht80(const struct ieee80211_node *ni)
*/
return (IEEE80211_IS_CHAN_VHT80(bss_chan) &&
IEEE80211_IS_CHAN_VHT80(ni->ni_chan) &&
(ni->ni_chw != IEEE80211_STA_RX_BW_20));
(ni->ni_chw != NET80211_STA_RX_BW_20));
}
/*
@ -1030,7 +1030,7 @@ ieee80211_vht_check_tx_vht160(const struct ieee80211_node *ni)
* If a HT TX width action frame sets it to 20MHz
* then reject doing 160MHz.
*/
if (ni->ni_chw == IEEE80211_STA_RX_BW_20)
if (ni->ni_chw == NET80211_STA_RX_BW_20)
return (false);
if (IEEE80211_IS_CHAN_VHT160(bss_chan) &&
@ -1062,19 +1062,19 @@ ieee80211_vht_check_tx_vht160(const struct ieee80211_node *ni)
*/
bool
ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni,
enum ieee80211_sta_rx_bw bw)
enum net80211_sta_rx_bw bw)
{
switch (bw) {
case IEEE80211_STA_RX_BW_20:
case NET80211_STA_RX_BW_20:
return (ieee80211_vht_check_tx_vht(ni));
case IEEE80211_STA_RX_BW_40:
case NET80211_STA_RX_BW_40:
return (ieee80211_vht_check_tx_vht40(ni));
case IEEE80211_STA_RX_BW_80:
case NET80211_STA_RX_BW_80:
return (ieee80211_vht_check_tx_vht80(ni));
case IEEE80211_STA_RX_BW_160:
case NET80211_STA_RX_BW_160:
return (ieee80211_vht_check_tx_vht160(ni));
case IEEE80211_STA_RX_BW_320:
case NET80211_STA_RX_BW_320:
return (false);
default:
return (false);
@ -1096,7 +1096,7 @@ ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni,
*/
bool
ieee80211_vht_node_check_tx_valid_mcs(const struct ieee80211_node *ni,
enum ieee80211_sta_rx_bw bw, uint8_t nss, uint8_t mcs)
enum net80211_sta_rx_bw bw, uint8_t nss, uint8_t mcs)
{
uint8_t mc;

View file

@ -65,8 +65,8 @@ void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni,
bool ieee80211_vht_check_tx_vht(const struct ieee80211_node *);
bool ieee80211_vht_check_tx_bw(const struct ieee80211_node *,
enum ieee80211_sta_rx_bw);
enum net80211_sta_rx_bw);
bool ieee80211_vht_node_check_tx_valid_mcs(const struct ieee80211_node *,
enum ieee80211_sta_rx_bw bw, uint8_t, uint8_t);
enum net80211_sta_rx_bw bw, uint8_t, uint8_t);
#endif /* _NET80211_IEEE80211_VHT_H_ */