From nobody Tue Nov 19 04:52:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XssYw2Y4Vz5dYlt; Tue, 19 Nov 2024 04:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XssYw1YcJz4Cb0; Tue, 19 Nov 2024 04:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731991972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60mee6Ja4kW9jNANwXCY9qJypOSj0GEr4rlF5+K9Ty0=; b=T7Mn5G0+UL09KWnaJC6PvrzwjJeOHMVESajxV0IAVFVZdu7Mm7ElGWZWDHMk03ffd2X0xF O5VMLoLsdSXWVunno4fsn+7Gn74KmU3CCsYLdUlAAYPTyY8RU2wa9QB1SfsGoViXIStc2U 3oerW7vwjQoP8jTpMx75jRp27jirSIZ/Xn6UsYL3cuN3nni0jwIOs4wujiATiPK+l2/nQ7 kqPVryj9KHyfvmH9DZXRts43MOpO6ZSUZNMmRNp4v2tNYcoW+rrpLbx6Mmeb/UeN5DB0ui Hy0tlEFc+X/OI5nln8E3WMTGF8Lq4UzTUpDYgotevkxLIrlkE3rPqzoT+aSGvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731991972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=60mee6Ja4kW9jNANwXCY9qJypOSj0GEr4rlF5+K9Ty0=; b=a3Dv+QRYUQXFB3NgER6ie+u3Gsr5S+xqfLgp9Ay4cYtXydTHwz1tFGrD58O7NCgxeYz+Y/ n02GWr67D5oj3HLZzilWw1Q0N4KLlxerHz7iw7c1YqzwAA4gTH8idNlV7aS/CGRuN71Ax2 sg5jPe9YhiuptIeQMcEt+fWymNNGdUpPRODfkp4STYB97VWQqLNPjoEEL89VIzObHTKUU+ AjOT4nw4fhDY308J//465Z86dfTcZH08tgsKt2GExjwzT/HQ8VGSFaUR9guzlz2SQK6U9j qkqJvdqAx/razP4HvgfDxxr7ZwiGwGtZoAaXFCGaTEhQGGGItCBG36DJrlifIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731991972; a=rsa-sha256; cv=none; b=WNRXM6J9YPnR/uc2XVluWTFRV8zcAO/sCF3YN+bLQ73RMaHxy70dtoKfkQNbH1FFf5ULow 6vY9dF9aMm6Tt4X2cmSzmmdPwZp5+HaMV69VyLB6oC9ZpCy1qCVa0fgJ+qlMQiGrCHi0qx tKKUGuom8s2jic0qLBv2PReakFtLANRQ24SSPUfS8xZ1H3I4Ax7t5iHaj32mSdbHnMILxO noWGRO09k9pQgsjqLvD9ys2gR2+3PS53uvz8rIynDVGy9q2fSfVpYMxer+fUYsHBp5cCl/ Bkw7zN3wAyPiUQhx/asiHalZ+B/bbYCwrrKggCCgNDYRH5QjZnPc3cHM3OmQ4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XssYw16j0z19l8; Tue, 19 Nov 2024 04:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AJ4qqDt066353; Tue, 19 Nov 2024 04:52:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJ4qqIN066350; Tue, 19 Nov 2024 04:52:52 GMT (envelope-from git) Date: Tue, 19 Nov 2024 04:52:52 GMT Message-Id: <202411190452.4AJ4qqIN066350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 1375790a15b1 - main - net80211: add IEEE80211_IS_QOS_NULL() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1375790a15b122518b779b111c18ee2da5702728 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=1375790a15b122518b779b111c18ee2da5702728 commit 1375790a15b122518b779b111c18ee2da5702728 Author: Adrian Chadd AuthorDate: 2024-11-17 06:06:11 +0000 Commit: Adrian Chadd CommitDate: 2024-11-19 04:50:17 +0000 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 --- sys/dev/ath/if_ath_tx.c | 4 ++-- sys/net80211/ieee80211.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) 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 */