summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_node.h
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2019-03-01 08:13:12 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2019-03-01 08:13:12 +0000
commite826a25aebe3aae1673a3788255fc95d4b8e40a0 (patch)
treeb9956430965d7eb43ec68b230e44f70287cb6e55 /sys/net80211/ieee80211_node.h
parentaa21243eb375f73fd9bb774b507b89fe1991c1c9 (diff)
Improve handling of HT protection for 'mode 11n' hostap.
Consider the mere presence of HTCAP IEs as indicator of 11n support, rather than checking advertised Rx MCS. Fixes some devices being misclassified as 11a/g, causing HT protection to be enabled even though it is not needed. Use CTS-to-self frames for HT protection instead of RTS/CTS. These changes make my athn(4) AR9280 hostap perform much better. ok phessler@
Diffstat (limited to 'sys/net80211/ieee80211_node.h')
-rw-r--r--sys/net80211/ieee80211_node.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index a012f6cb745..0b891938db0 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.h,v 1.79 2019/02/19 08:12:30 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.h,v 1.80 2019/03/01 08:13:11 stsp Exp $ */
/* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */
/*-
@@ -368,6 +368,7 @@ struct ieee80211_node {
#define IEEE80211_NODE_HT_SGI20 0x4000 /* SGI on 20 MHz negotiated */
#define IEEE80211_NODE_HT_SGI40 0x8000 /* SGI on 40 MHz negotiated */
#define IEEE80211_NODE_VHT 0x10000 /* VHT negotiated */
+#define IEEE80211_NODE_HTCAP 0x20000 /* claims to support HT */
/* If not NULL, this function gets called when ni_refcnt hits zero. */
void (*ni_unref_cb)(struct ieee80211com *,
@@ -427,13 +428,14 @@ ieee80211_unref_node(struct ieee80211_node **ni)
/*
* Check if the peer supports HT.
- * Require at least one of the mandatory MCS.
+ * Require a HT capabilities IE and at least one of the mandatory MCS.
* MCS 0-7 are mandatory but some APs have particular MCS disabled.
*/
static inline int
ieee80211_node_supports_ht(struct ieee80211_node *ni)
{
- return (ni->ni_rxmcs[0] & 0xff);
+ return ((ni->ni_flags & IEEE80211_NODE_HTCAP) &&
+ ni->ni_rxmcs[0] & 0xff);
}
/* Check if the peer supports HT short guard interval (SGI) on 20 MHz. */