aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2025-12-15 03:45:36 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2026-02-11 06:02:49 +0000
commit7a5288a023baeac2f0c3128506178f89fda3cc0d (patch)
tree81829333daf2f6757622ab9c9528bde413286beb
parent5b398611607b0dab2f2550ef73f62d41dab6fac5 (diff)
net80211: clean up time comparison in HT code
There's at least one place where the time comparison is wrong, leading to some bad beahaviour around deciding to try and establish/reestablish AMPDU TX sessions. Start addressing these! Differential Revision: https://reviews.freebsd.org/D54390
-rw-r--r--sys/net80211/ieee80211_ht.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 88e614e266a1..38568674a792 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -1130,7 +1130,8 @@ again:
*/
if (rap->rxa_qframes != 0) {
/* XXX honor batimeout? */
- if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
+ if (ieee80211_time_after(ticks - rap->rxa_age,
+ ieee80211_ampdu_age)) {
/*
* Too long since we received the first
* frame; flush the reorder buffer.
@@ -1392,7 +1393,8 @@ ieee80211_ht_node_age(struct ieee80211_node *ni)
* See above for more details on what's happening here.
*/
/* XXX honor batimeout? */
- if (ticks - rap->rxa_age > ieee80211_ampdu_age) {
+ if (ieee80211_time_after(ticks - rap->rxa_age,
+ ieee80211_ampdu_age)) {
/*
* Too long since we received the first
* frame; flush the reorder buffer.
@@ -2824,7 +2826,7 @@ ieee80211_ampdu_request(struct ieee80211_node *ni,
/* defer next try so we don't slam the driver with requests */
tap->txa_attempts = ieee80211_addba_maxtries;
/* NB: check in case driver wants to override */
- if (tap->txa_nextrequest <= ticks)
+ if (ieee80211_time_before_eq(tap->txa_nextrequest, ticks))
tap->txa_nextrequest = ticks + ieee80211_addba_backoff;
return 0;
}