summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-09-22 00:14:50 +0000
committersam <sam@FreeBSD.org>2008-09-22 00:14:50 +0000
commita839de9034bb40651d0230e279964e91fdf845bb (patch)
tree9b527427de17e6ea6b2b16d7b830476b5f526e57 /sys/net80211
parent03a86e750748dce8c5d36001ad245b97ea457b9e (diff)
downloadFreeBSD-src-a839de9034bb40651d0230e279964e91fdf845bb.zip
FreeBSD-src-a839de9034bb40651d0230e279964e91fdf845bb.tar.gz
Fix handling of shortgi: use the local configuration (and implicitly
device capabilities) to decide whether to use short gi. Drivers inspect ni_flags to decide whether to send a frame w/ short sgi.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_ddb.c2
-rw-r--r--sys/net80211/ieee80211_ht.c20
-rw-r--r--sys/net80211/ieee80211_node.h5
3 files changed, 25 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c
index 76a7119..6e83235 100644
--- a/sys/net80211/ieee80211_ddb.c
+++ b/sys/net80211/ieee80211_ddb.c
@@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$");
#define IEEE80211_NODE_BITS \
"\20\1AUTH\2QOS\3ERP\5PWR_MGT\6AREF\7HT\10HTCOMPAT\11WPS\12TSN" \
- "\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS"
+ "\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS\20SGI20\21SGI40"
#define IEEE80211_ERP_BITS \
"\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE"
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index eef537b..321566b 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -1270,6 +1270,24 @@ htcap_update_mimo_ps(struct ieee80211_node *ni)
}
/*
+ * Update short GI state according to received htcap
+ * and local settings.
+ */
+static __inline void
+htcap_update_shortgi(struct ieee80211_node *ni)
+{
+ struct ieee80211vap *vap = ni->ni_vap;
+
+ ni->ni_flags &= ~(IEEE80211_NODE_SGI20|IEEE80211_NODE_SGI40);
+ if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) &&
+ (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI20))
+ ni->ni_flags |= IEEE80211_NODE_SGI20;
+ if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) &&
+ (vap->iv_flags_ext & IEEE80211_FEXT_SHORTGI40))
+ ni->ni_flags |= IEEE80211_NODE_SGI40;
+}
+
+/*
* Parse and update HT-related state extracted from
* the HT cap and info ie's.
*/
@@ -1284,6 +1302,7 @@ ieee80211_ht_updateparams(struct ieee80211_node *ni,
ieee80211_parse_htcap(ni, htcapie);
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
htcap_update_mimo_ps(ni);
+ htcap_update_shortgi(ni);
if (htinfoie[0] == IEEE80211_ELEMID_VENDOR)
htinfoie += 4;
@@ -1322,6 +1341,7 @@ ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie)
ieee80211_parse_htcap(ni, htcapie);
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS)
htcap_update_mimo_ps(ni);
+ htcap_update_shortgi(ni);
/* NB: honor operating mode constraint */
/* XXX 40 MHZ intolerant */
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index 045bd15..2aaec0a 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -115,6 +115,8 @@ struct ieee80211_node {
#define IEEE80211_NODE_MIMO_PS 0x001000 /* MIMO power save enabled */
#define IEEE80211_NODE_MIMO_RTS 0x002000 /* send RTS in MIMO PS */
#define IEEE80211_NODE_RIFS 0x004000 /* RIFS enabled */
+#define IEEE80211_NODE_SGI20 0x008000 /* Short GI in HT20 enabled */
+#define IEEE80211_NODE_SGI40 0x010000 /* Short GI in HT40 enabled */
uint16_t ni_associd; /* association ID */
uint16_t ni_vlan; /* vlan tag */
uint16_t ni_txpower; /* current transmit power */
@@ -199,7 +201,8 @@ MALLOC_DECLARE(M_80211_NODE_IE);
#define IEEE80211_NODE_HT_ALL \
(IEEE80211_NODE_HT | IEEE80211_NODE_HTCOMPAT | \
IEEE80211_NODE_AMPDU | IEEE80211_NODE_MIMO_PS | \
- IEEE80211_NODE_MIMO_RTS | IEEE80211_NODE_RIFS)
+ IEEE80211_NODE_MIMO_RTS | IEEE80211_NODE_RIFS | \
+ IEEE80211_NODE_SGI20 | IEEE80211_NODE_SGI40)
#define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd)
OpenPOWER on IntegriCloud