summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_ht.c
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/ieee80211_ht.c
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/ieee80211_ht.c')
-rw-r--r--sys/net80211/ieee80211_ht.c20
1 files changed, 20 insertions, 0 deletions
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 */
OpenPOWER on IntegriCloud