summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwm.c
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2019-02-27 04:10:41 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2019-02-27 04:10:41 +0000
commit4d49875fcbb7f5a708f96da85fa6d01beb67c4d2 (patch)
tree38e0db5ba2839877ae71b24db24cef40c0cf846d /sys/dev/pci/if_iwm.c
parent0145c7d62cfc50c753206f441c6aec8e5ea73161 (diff)
Implement support for dynamic RTS threshold in MiRA.
Improves throughput and latency on 11n networks. Tested by myself, jmc@, jcs@, phessler@, benno@
Diffstat (limited to 'sys/dev/pci/if_iwm.c')
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index 7d7f0697a2b..bfa9a7bf47a 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.235 2019/02/24 09:37:18 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.236 2019/02/27 04:10:38 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -4216,7 +4216,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
bus_dma_segment_t *seg;
uint8_t tid, type;
int i, totlen, err, pad;
- int hdrlen2;
+ int hdrlen2, rtsthres = ic->ic_rtsthreshold;
wh = mtod(m, struct ieee80211_frame *);
hdrlen = ieee80211_get_hdrlen(wh);
@@ -4292,9 +4292,13 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
flags |= IWM_TX_CMD_FLG_ACK;
}
+ if (ni->ni_flags & IEEE80211_NODE_HT)
+ rtsthres = ieee80211_mira_get_rts_threshold(&in->in_mn, ic, ni,
+ totlen + IEEE80211_CRC_LEN);
+
if (type == IEEE80211_FC0_TYPE_DATA &&
!IEEE80211_IS_MULTICAST(wh->i_addr1) &&
- (totlen + IEEE80211_CRC_LEN > ic->ic_rtsthreshold ||
+ (totlen + IEEE80211_CRC_LEN > rtsthres ||
(ic->ic_flags & IEEE80211_F_USEPROT)))
flags |= IWM_TX_CMD_FLG_PROT_REQUIRE;