1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00

net80211: add IEEE80211_IS_QOS_NULL()

This will be useful when fixing up the sequence number generation
and checks, as the rules around how sequence numbers are generated
have been clarified in 802.11-2016 and later.  QoS-NULL frames are
explicitly marked as "any sequence number".

But for now, just create a macro and use it in the one place
it's currently being used as a check - ath(4).

* Add IEEE80211_IS_QOS_NULL().
* Change the "will this frame go into the TX block-ack window" check
  in the ath(4) transmit path.  Note this changes the check to be
  more specific, but both paths already had previous checks to ensure
  they're QoS data frames.

Locally tested:

* ath(4), AR9380, STA mode w/ AMPDU TX/RX enabled and negotiated

Differential Revision: https://reviews.freebsd.org/D47645
This commit is contained in:
Adrian Chadd 2024-11-16 22:06:11 -08:00
parent 21ca690b56
commit 1375790a15
2 changed files with 12 additions and 2 deletions

View File

@ -2050,7 +2050,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
*/
if (IEEE80211_QOS_HAS_SEQ(wh) &&
(! IEEE80211_IS_MULTICAST(wh->i_addr1)) &&
(subtype != IEEE80211_FC0_SUBTYPE_QOS_NULL)) {
(! IEEE80211_IS_QOS_NULL(wh))) {
bf->bf_state.bfs_dobaw = 1;
}
}
@ -2991,7 +2991,7 @@ ath_tx_tid_seqno_assign(struct ath_softc *sc, struct ieee80211_node *ni,
* RX side.
*/
subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
if (subtype == IEEE80211_FC0_SUBTYPE_QOS_NULL) {
if (IEEE80211_IS_QOS_NULL(wh)) {
/* XXX no locking for this TID? This is a bit of a problem. */
seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID];
INCR(ni->ni_txseqs[IEEE80211_NONQOS_TID], IEEE80211_SEQ_RANGE);

View File

@ -274,6 +274,16 @@ struct ieee80211_qosframe_addr4 {
IEEE80211_FC0_TYPE_DATA, \
IEEE80211_FC0_SUBTYPE_QOS_DATA))
/*
* Return true if this frame is a QoS NULL data frame.
*/
#define IEEE80211_IS_QOS_NULL(wh) \
(IEEE80211_IS_FC0_CHECK_VER_TYPE_SUBTYPE(wh, \
IEEE80211_FC0_VERSION_0, \
IEEE80211_FC0_TYPE_DATA, \
IEEE80211_FC0_SUBTYPE_QOS_NULL))
#define IEEE80211_FC1_DIR_MASK 0x03
#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */