Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2026 01:33:08 +0000
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: e3b4dbb80577 - main - net80211: create ieee80211_ht_check_bar_exceed_retry_count()
Message-ID:  <6a13a6d4.43f82.20743414@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by adrian:

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

commit e3b4dbb80577fcecb74566d2c1a219dac146f541
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2026-05-17 18:40:03 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2026-05-25 01:32:04 +0000

    net80211: create ieee80211_ht_check_bar_exceed_retry_count()
    
    Create a function to check if the BAR retry limit has been reached.
    Use this in if_ath_tx instead of a hard-coded value.
    
    I've been meaning to do this for a long time.
    
    Differential Revision: https://reviews.freebsd.org/D57055
---
 sys/dev/ath/if_ath_tx.c     |  3 ++-
 sys/net80211/ieee80211_ht.c | 20 +++++++++++++++++++-
 sys/net80211/ieee80211_ht.h |  2 ++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c
index 9ac591c14943..d37210723680 100644
--- a/sys/dev/ath/if_ath_tx.c
+++ b/sys/dev/ath/if_ath_tx.c
@@ -6225,7 +6225,8 @@ ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
 	 * Also, don't call it if bar_tx/bar_wait are 0; something
 	 * has beaten us to the punch? (XXX figure out what?)
 	 */
-	if (status == 0 || attempts == 50) {
+	if (status == 0 ||
+	    ieee80211_ht_check_bar_exceed_retry_count(ni, attempts)) {
 		ATH_TX_LOCK(sc);
 		if (atid->bar_tx == 0 || atid->bar_wait == 0)
 			DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 9b2b0df33785..8ebfbbae6377 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -2899,7 +2899,7 @@ bar_timeout(void *arg)
 	if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) == 0)
 		return;
 	/* XXX ? */
-	if (tap->txa_attempts >= ieee80211_bar_maxtries) {
+	if (ieee80211_ht_check_bar_exceed_retry_count(ni, tap->txa_attempts)) {
 		struct ieee80211com *ic = ni->ni_ic;
 
 		ni->ni_vap->iv_stats.is_ampdu_bar_tx_fail++;
@@ -3845,3 +3845,21 @@ ieee80211_ht_check_tx_ht40(const struct ieee80211_node *ni)
 	    IEEE80211_IS_CHAN_HT40(ni->ni_chan) &&
 	    (ni->ni_chw == NET80211_STA_RX_BW_40));
 }
+
+/**
+ * @brief Return whether the given BAR retry count exceeds the configured count
+ *
+ * @param ni ieee80211_node to check against
+ * @param count BAR retry count
+ * @returns true if the count has exceeded the configured count, false if not
+ */
+bool
+ieee80211_ht_check_bar_exceed_retry_count(const struct ieee80211_node *ni __unused,
+    int count)
+{
+	/*
+	 * Note: ni isn't used here because the BAR limit is currently
+	 * global.  It's here for future work.
+	 */
+	return (count >= ieee80211_bar_maxtries);
+}
diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h
index c31bb8700289..505b39628dcf 100644
--- a/sys/net80211/ieee80211_ht.h
+++ b/sys/net80211/ieee80211_ht.h
@@ -247,5 +247,7 @@ bool	ieee80211_ht_check_tx_shortgi_20(const struct ieee80211_node *ni);
 bool	ieee80211_ht_check_tx_shortgi_40(const struct ieee80211_node *ni);
 bool	ieee80211_ht_check_tx_ht40(const struct ieee80211_node *ni);
 bool	ieee80211_ht_check_tx_ht(const struct ieee80211_node *ht);
+bool	ieee80211_ht_check_bar_exceed_retry_count(const struct ieee80211_node *,
+	    int);
 
 #endif /* _NET80211_IEEE80211_HT_H_ */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a13a6d4.43f82.20743414>