summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-02-01 12:45:56 +0000
committerstsp <stsp@openbsd.org>2017-02-01 12:45:56 +0000
commit4b798cb4bd4f081b324e8f2ca16c2c3c539dc71a (patch)
treed0d246077de40702e3a978d40f0e56211d666490
parentSUDO is doas (diff)
downloadwireguard-openbsd-4b798cb4bd4f081b324e8f2ca16c2c3c539dc71a.tar.xz
wireguard-openbsd-4b798cb4bd4f081b324e8f2ca16c2c3c539dc71a.zip
In athn(4), if multi-rate retry is disabled due to RTS being used, then do
not tell rate scaling algos about failed retries. All attempts use the same rate anyway, so checking whether the frame succeeded or failed is good enough. ok mpi@
-rw-r--r--sys/dev/ic/ar5008.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c
index 14c8182ada7..7cfea5a114c 100644
--- a/sys/dev/ic/ar5008.c
+++ b/sys/dev/ic/ar5008.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5008.c,v 1.41 2017/01/30 10:57:00 stsp Exp $ */
+/* $OpenBSD: ar5008.c,v 1.42 2017/02/01 12:45:56 stsp Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -997,11 +997,17 @@ ar5008_tx_process(struct athn_softc *sc, int qid)
/*
* NB: the data fail count contains the number of un-acked tries
* for the final series used. We must add the number of tries for
- * each series that was fully processed.
+ * each series that was fully processed to punish transmit rates in
+ * the earlier series which did not perform well.
+ * If RTS/CTS was used, each series used the same transmit rate.
+ * Ignore the series count in this case, since each series had
+ * the same chance of success.
*/
failcnt = MS(ds->ds_status1, AR_TXS1_DATA_FAIL_CNT);
- /* NB: Assume two tries per series. */
- failcnt += MS(ds->ds_status9, AR_TXS9_FINAL_IDX) * 2;
+ if (!(ds->ds_ctl0 & (AR_TXC0_RTS_ENABLE | AR_TXC0_CTS_ENABLE))) {
+ /* NB: Assume two tries per series. */
+ failcnt += MS(ds->ds_status9, AR_TXS9_FINAL_IDX) * 2;
+ }
/* Update rate control statistics. */
if (ni->ni_flags & IEEE80211_NODE_HT) {