Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Sep 2025 01:52:40 GMT
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 9bfb1405332c - main - net80211: add support for drivers to disable sending NULL data frames
Message-ID:  <202509090152.5891qequ058761@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=9bfb1405332c6c847dd29e4db4dd3afb56662021

commit 9bfb1405332c6c847dd29e4db4dd3afb56662021
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-08-27 17:03:22 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-09-09 01:48:10 +0000

    net80211: add support for drivers to disable sending NULL data frames
    
    net80211 has various places where null data / null qos data frames
    are sent.  However plenty of NICs shouldn't be sending them from
    net80211 and it may even upset their 802.11n window / sequence number
    tracking.
    
    So add support here.
    
    Differential Revision:  https://reviews.freebsd.org/D52297
    Reviewed by:    bz
---
 sys/net80211/ieee80211_output.c | 6 ++++++
 sys/net80211/ieee80211_var.h    | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 57fe687adffe..116fc76a9ce1 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1082,6 +1082,12 @@ ieee80211_send_nulldata(struct ieee80211_node *ni)
 	uint8_t *frm;
 	int ret;
 
+	/* Don't send NULL frames if we've been configured not to do so. */
+	if ((ic->ic_flags_ext & IEEE80211_FEXT_NO_NULLDATA) != 0) {
+		ieee80211_node_decref(ni);
+		return (0);
+	}
+
 	if (vap->iv_state == IEEE80211_S_CAC) {
 		IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_DOTH,
 		    ni, "block %s frame in CAC state", "null data");
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index a0293f814899..b9bc2357428d 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -700,13 +700,14 @@ MALLOC_DECLARE(M_80211_VAP);
 #define	IEEE80211_FEXT_QUIET_IE	0x00800000	/* STATUS: quiet IE in a beacon has been added */
 #define	IEEE80211_FEXT_UAPSD	0x01000000	/* CONF: enable U-APSD */
 #define	IEEE80211_FEXT_AMPDU_OFFLOAD	0x02000000	/* CONF: driver/fw handles AMPDU[-TX] itself */
+#define	IEEE80211_FEXT_NO_NULLDATA	0x04000000	/* CONF: don't originate NULL data frames from net80211 */
 
 #define	IEEE80211_FEXT_BITS \
 	"\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
 	"\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \
 	"\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD\25SEQNO_OFFLOAD" \
 	    "\26FRAG_OFFLOAD\27VHT" \
-	"\30QUIET_IE\31UAPSD\32AMPDU_OFFLOAD"
+	"\30QUIET_IE\31UAPSD\32AMPDU_OFFLOAD\33NO_NULLDATA"
 
 /* ic_flags_ht/iv_flags_ht */
 #define	IEEE80211_FHT_NONHT_PR	 0x00000001	/* STATUS: non-HT sta present */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509090152.5891qequ058761>