summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2020-04-17 07:09:06 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2020-04-17 07:09:06 +0000
commit1b18f41b07a679f2065290eb85b36a9c8cbc28a2 (patch)
tree58986f718bab6678f6af3e25e8b446acd9ab8524
parent71d07418f0465e63dc8edc0cdfadcc5f8e4d4aae (diff)
Prevent MiRA from jumping from very high to very low rates while
switching ratesets when probing. Fixes iwm(4) switching from MCS 15 down to MCS 0, rather than switching to a comparable rate in the next rateset, such as MCS 7. This wasn't supposed to happen but did because of a MiRA implementation bug. ok jmatthew@
-rw-r--r--sys/net80211/ieee80211_mira.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_mira.c b/sys/net80211/ieee80211_mira.c
index 29df16879e0..23bfcf0a331 100644
--- a/sys/net80211/ieee80211_mira.c
+++ b/sys/net80211/ieee80211_mira.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_mira.c,v 1.28 2020/04/11 13:47:53 stsp Exp $ */
+/* $OpenBSD: ieee80211_mira.c,v 1.29 2020/04/17 07:09:05 stsp Exp $ */
/*
* Copyright (c) 2016 Stefan Sperling <stsp@openbsd.org>
@@ -670,6 +670,9 @@ ieee80211_mira_probe_next_rateset(struct ieee80211_mira_node *mn,
break;
}
}
+ /* If all rates are lower the maximum rate is the closest match. */
+ if (i == rsnext->nrates)
+ ni->ni_txmcs = rsnext->max_mcs;
/* Add rates from the next rateset as candidates. */
mn->candidate_rates |= (1 << ni->ni_txmcs);