summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2016-01-06 09:17:42 +0000
committerstsp <stsp@openbsd.org>2016-01-06 09:17:42 +0000
commitfaa927c78353f3b51909457c20216a46ac0fcba7 (patch)
treeeffff74216ca602d9c4549528b002dfea0d23fc5
parentiwm(4) adjusts the firmware's tx rate retry table dynamically so we must (diff)
downloadwireguard-openbsd-faa927c78353f3b51909457c20216a46ac0fcba7.tar.xz
wireguard-openbsd-faa927c78353f3b51909457c20216a46ac0fcba7.zip
Ensure that iwn(4) always uses a CCK rate as last fallback in the firmware's
tx rate retry table. This will hopefully make 11n mode work in very noisy environments. iwm(4) already does the same. ok kettenis@
-rw-r--r--sys/dev/pci/if_iwn.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index 3ffd6052c97..cc7bf093c9c 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.150 2016/01/05 18:41:15 stsp Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.151 2016/01/06 09:17:42 stsp Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -3399,9 +3399,21 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni)
}
/* Fill the rest with MCS 0. */
rinfo = &iwn_rates[iwn_mcs2ridx[0]];
- while (i < IWN_MAX_TX_RETRIES) {
+ while (i < IWN_MAX_TX_RETRIES - 1) {
linkq.retry[i].plcp = rinfo->ht_plcp;
linkq.retry[i].rflags = rinfo->ht_flags;
+ linkq.retry[i].rflags |= IWN_RFLAG_ANT(txant);
+ i++;
+ }
+
+ /* Fill the last slot with the lowest legacy rate. */
+ if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan))
+ rinfo = &iwn_rates[IWN_RIDX_OFDM6];
+ else
+ rinfo = &iwn_rates[IWN_RIDX_CCK1];
+ while (i < IWN_MAX_TX_RETRIES) {
+ linkq.retry[i].plcp = rinfo->plcp;
+ linkq.retry[i].rflags = rinfo->flags;
linkq.retry[i].rflags |= IWN_RFLAG_ANT(txant);
i++;
}