diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index 1ec23972f283..1559b66a7c7d 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -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); diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index eb83d0a40a33..e62b8c16d68f 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -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 */