PERFORCE change 149547 for review

Sam Leffler sam at FreeBSD.org
Wed Sep 10 17:24:24 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=149547

Change 149547 by sam at sam_ebb on 2008/09/10 17:23:55

	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.

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_ddb.c#26 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ht.c#47 edit
.. //depot/projects/vap/sys/net80211/ieee80211_node.h#28 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_ddb.c#26 (text+ko) ====

@@ -90,7 +90,7 @@
 
 #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"

==== //depot/projects/vap/sys/net80211/ieee80211_ht.c#47 (text+ko) ====

@@ -1247,7 +1247,7 @@
 /*
  * Handle 11n MIMO PS switch.
  */
-static int
+static __inline int
 htcap_update_mimo_ps(struct ieee80211_node *ni)
 {
 	uint16_t oflags = ni->ni_flags;
@@ -1271,6 +1271,24 @@
 }
 
 /*
+ * 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.
  */
@@ -1285,6 +1303,7 @@
 	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;
@@ -1323,6 +1342,7 @@
 	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 */

==== //depot/projects/vap/sys/net80211/ieee80211_node.h#28 (text+ko) ====

@@ -100,21 +100,23 @@
 	u_int			ni_refcnt;	/* count of held references */
 	u_int			ni_scangen;	/* gen# for timeout scan */
 	u_int			ni_flags;
-#define	IEEE80211_NODE_AUTH	0x0001		/* authorized for data */
-#define	IEEE80211_NODE_QOS	0x0002		/* QoS enabled */
-#define	IEEE80211_NODE_ERP	0x0004		/* ERP enabled */
+#define	IEEE80211_NODE_AUTH	0x000001	/* authorized for data */
+#define	IEEE80211_NODE_QOS	0x000002	/* QoS enabled */
+#define	IEEE80211_NODE_ERP	0x000004	/* ERP enabled */
 /* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */
-#define	IEEE80211_NODE_PWR_MGT	0x0010		/* power save mode enabled */
-#define	IEEE80211_NODE_AREF	0x0020		/* authentication ref held */
-#define	IEEE80211_NODE_HT	0x0040		/* HT enabled */
-#define	IEEE80211_NODE_HTCOMPAT	0x0080		/* HT setup w/ vendor OUI's */
-#define	IEEE80211_NODE_WPS	0x0100		/* WPS association */
-#define	IEEE80211_NODE_TSN	0x0200		/* TSN association */
-#define	IEEE80211_NODE_AMPDU_RX	0x0400		/* AMPDU rx enabled */
-#define	IEEE80211_NODE_AMPDU_TX	0x0800		/* AMPDU tx enabled */
-#define	IEEE80211_NODE_MIMO_PS	0x1000		/* MIMO power save enabled */
-#define	IEEE80211_NODE_MIMO_RTS	0x2000		/* send RTS in MIMO PS */
-#define	IEEE80211_NODE_RIFS	0x4000		/* RIFS enabled */
+#define	IEEE80211_NODE_PWR_MGT	0x000010	/* power save mode enabled */
+#define	IEEE80211_NODE_AREF	0x000020	/* authentication ref held */
+#define	IEEE80211_NODE_HT	0x000040	/* HT enabled */
+#define	IEEE80211_NODE_HTCOMPAT	0x000080	/* HT setup w/ vendor OUI's */
+#define	IEEE80211_NODE_WPS	0x000100	/* WPS association */
+#define	IEEE80211_NODE_TSN	0x000200	/* TSN association */
+#define	IEEE80211_NODE_AMPDU_RX	0x000400	/* AMPDU rx enabled */
+#define	IEEE80211_NODE_AMPDU_TX	0x000800	/* AMPDU tx enabled */
+#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 @@
 #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)
 


More information about the p4-projects mailing list