[PATCH v4 8/8] wifi: brcmsmac: ampdu: document IEEE 802.11n TID requirement

Shivesh <[email protected]> Fri, 31 Jul 2026 16:06:25 +0000
Newsgroups dev.linux.lists.brcm80211,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless
Message-ID <[email protected]>
An XXX comment in brcmsmac_ampdu_tx_add() questioned whether it is
necessary to reject frames whose QoS priority differs from the current
A-MPDU session. IEEE 802.11n (IEEE Std 802.11-2012, section 9.10.1)
requires that all MPDUs within an A-MPDU carry the same TID; mixing
TIDs would violate the Block ACK agreement and cause receiver-side
reassembly failures.

The existing behaviour of returning -ENOSPC to close the current
aggregate and start a new one is therefore required by the standard.
Replace the questioning XXX with a comment referencing the standard.

Signed-off-by: Shivesh <[email protected]>
---
 .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c   |  1 -
 .../net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c  | 11 +++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 2375c2f9d97a..dc4228fb31c1 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -4464,7 +4464,6 @@ brcmf_pmksa_v2_op(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
 	return brcmf_fil_iovar_data_set(ifp, "pmkid_info", list, sizeof(*list));
 }
 
-
 static __used s32
 brcmf_update_pmklist(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp)
 {
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
index fc7a5dd2e5d8..3fd8bdbd35e5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c
@@ -516,12 +516,11 @@ int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
 			return -ENOSPC;
 
 		/*
-		 * We aren't really out of space if the new frame is of
-		 * a different priority, but we want the same behaviour
-		 * so return -ENOSPC anyway.
-		 *
-		 * XXX: The old AMPDU code did this, but is it really
-		 * necessary?
+		 * IEEE 802.11n standard requires that all MPDUs within an
+		 * A-MPDU belong to the same TID (Traffic Identifier).
+		 * Since priority maps to TID, a different priority means
+		 * we must close the current aggregate and start a new one,
+		 * so we return -ENOSPC here.
 		 */
 		first = skb_peek(&session->skb_list);
 		if (p->priority != first->priority)
-- 
2.53.0