summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2016-07-21 08:38:33 +0000
committerstsp <stsp@openbsd.org>2016-07-21 08:38:33 +0000
commit5098e9a8bc705acede48947dddce273b7f8be4e7 (patch)
tree24626fe6a89ae762a064d8608c578abbcdeee26e
parentTurn ofp*_debug functions into ofp*_validate functions to follow a (diff)
downloadwireguard-openbsd-5098e9a8bc705acede48947dddce273b7f8be4e7.tar.xz
wireguard-openbsd-5098e9a8bc705acede48947dddce273b7f8be4e7.zip
Make rtwn(4) and urtwn(4) respect the RTS threshold set by net80211.
ok mpi@
-rw-r--r--sys/dev/pci/if_rtwn.c7
-rw-r--r--sys/dev/usb/if_urtwn.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/pci/if_rtwn.c b/sys/dev/pci/if_rtwn.c
index 9836bde7c90..a50eec59b52 100644
--- a/sys/dev/pci/if_rtwn.c
+++ b/sys/dev/pci/if_rtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtwn.c,v 1.22 2016/06/17 10:53:55 stsp Exp $ */
+/* $OpenBSD: if_rtwn.c,v 1.23 2016/07/21 08:38:33 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -985,7 +985,10 @@ rtwn_tx(void *cookie, struct mbuf *m, struct ieee80211_node *ni)
SM(R92C_TXDW1_RAID, raid) |
R92C_TXDW1_AGGBK);
- if (ic->ic_flags & IEEE80211_F_USEPROT) {
+ if (m->m_pkthdr.len + IEEE80211_CRC_LEN > ic->ic_rtsthreshold) {
+ txd->txdw4 |= htole32(R92C_TXDW4_RTSEN |
+ R92C_TXDW4_HWRTSEN);
+ } else if (ic->ic_flags & IEEE80211_F_USEPROT) {
if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) {
txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF |
R92C_TXDW4_HWRTSEN);
diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c
index 5ef068006b7..cc00ea9365b 100644
--- a/sys/dev/usb/if_urtwn.c
+++ b/sys/dev/usb/if_urtwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urtwn.c,v 1.65 2016/06/17 10:53:55 stsp Exp $ */
+/* $OpenBSD: if_urtwn.c,v 1.66 2016/07/21 08:38:33 stsp Exp $ */
/*-
* Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -1299,7 +1299,10 @@ urtwn_tx(void *cookie, struct mbuf *m, struct ieee80211_node *ni)
SM(R92C_TXDW1_RAID, raid) | R92C_TXDW1_AGGBK);
}
- if (ic->ic_flags & IEEE80211_F_USEPROT) {
+ if (m->m_pkthdr.len + IEEE80211_CRC_LEN > ic->ic_rtsthreshold) {
+ txd->txdw4 |= htole32(R92C_TXDW4_RTSEN |
+ R92C_TXDW4_HWRTSEN);
+ } else if (ic->ic_flags & IEEE80211_F_USEPROT) {
if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) {
txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF |
R92C_TXDW4_HWRTSEN);