Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2009 21:29:04 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190455 - head/sys/net80211
Message-ID:  <200903262129.n2QLT4T0038153@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Thu Mar 26 21:29:03 2009
New Revision: 190455
URL: http://svn.freebsd.org/changeset/base/190455

Log:
  o move tdma+superg protocol defs out of public view
  o add #ifdef _KERNEL to superg+tdma include files so they can be used
    by user code to get the protocol defs

Modified:
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_superg.c
  head/sys/net80211/ieee80211_superg.h
  head/sys/net80211/ieee80211_tdma.c
  head/sys/net80211/ieee80211_tdma.h

Modified: head/sys/net80211/ieee80211.h
==============================================================================
--- head/sys/net80211/ieee80211.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -733,28 +733,6 @@ struct ieee80211_csa_ie {
 	uint8_t		csa_count;		/* Channel Switch Count */
 } __packed;
 
-/*
- * Atheros advanced capability information element.
- */
-struct ieee80211_ath_ie {
-	uint8_t		ath_id;			/* IEEE80211_ELEMID_VENDOR */
-	uint8_t		ath_len;		/* length in bytes */
-	uint8_t		ath_oui[3];		/* 0x00, 0x03, 0x7f */
-	uint8_t		ath_oui_type;		/* OUI type */
-	uint8_t		ath_oui_subtype;	/* OUI subtype */
-	uint8_t		ath_version;		/* spec revision */
-	uint8_t		ath_capability;		/* capability info */
-#define	ATHEROS_CAP_TURBO_PRIME		0x01	/* dynamic turbo--aka Turbo' */
-#define	ATHEROS_CAP_COMPRESSION		0x02	/* data compression */
-#define	ATHEROS_CAP_FAST_FRAME		0x04	/* fast (jumbo) frames */
-#define	ATHEROS_CAP_XR			0x08	/* Xtended Range support */
-#define	ATHEROS_CAP_AR			0x10	/* Advanded Radar support */
-#define	ATHEROS_CAP_BURST		0x20	/* Bursting - not negotiated */
-#define	ATHEROS_CAP_WME			0x40	/* CWMin tuning */
-#define	ATHEROS_CAP_BOOST		0x80	/* use turbo/!turbo mode */
-	uint8_t		ath_defkeyix[2];
-} __packed;
-
 /* rate set entries are in .5 Mb/s units, and potentially marked as basic */
 #define	IEEE80211_RATE_BASIC		0x80
 #define	IEEE80211_RATE_VAL		0x7f
@@ -768,9 +746,11 @@ struct ieee80211_ath_ie {
 	"\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE"
 
 #define	ATH_OUI			0x7f0300	/* Atheros OUI */
-#define	ATH_OUI_TYPE		0x01
-#define	ATH_OUI_SUBTYPE		0x01
-#define	ATH_OUI_VERSION		0x00
+#define	ATH_OUI_TYPE		0x01		/* Atheros protocol ie */
+
+/* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */
+#define	TDMA_OUI		ATH_OUI
+#define	TDMA_OUI_TYPE		0x02		/* TDMA protocol ie */
 
 #define	BCM_OUI			0x4c9000	/* Broadcom OUI */
 #define	BCM_OUI_HTCAP		51		/* pre-draft HTCAP ie */
@@ -1048,71 +1028,4 @@ struct ieee80211_duration {
 				 IEEE80211_DUR_DS_SLOW_PLCPHDR + \
 				 IEEE80211_DUR_DIFS)
 
-/*
- * Atheros fast-frame encapsulation format.
- * FF max payload:
- * 802.2 + FFHDR + HPAD + 802.3 + 802.2 + 1500 + SPAD + 802.3 + 802.2 + 1500:
- *   8   +   4   +  4   +   14  +   8   + 1500 +  6   +   14  +   8   + 1500
- * = 3066
- */
-/* fast frame header is 32-bits */
-#define	ATH_FF_PROTO	0x0000003f	/* protocol */
-#define	ATH_FF_PROTO_S	0
-#define	ATH_FF_FTYPE	0x000000c0	/* frame type */
-#define	ATH_FF_FTYPE_S	6
-#define	ATH_FF_HLEN32	0x00000300	/* optional hdr length */
-#define	ATH_FF_HLEN32_S	8
-#define	ATH_FF_SEQNUM	0x001ffc00	/* sequence number */
-#define	ATH_FF_SEQNUM_S	10
-#define	ATH_FF_OFFSET	0xffe00000	/* offset to 2nd payload */
-#define	ATH_FF_OFFSET_S	21
-
-#define	ATH_FF_MAX_HDR_PAD	4
-#define	ATH_FF_MAX_SEP_PAD	6
-#define	ATH_FF_MAX_HDR		30
-
-#define	ATH_FF_PROTO_L2TUNNEL	0	/* L2 tunnel protocol */
-#define	ATH_FF_ETH_TYPE		0x88bd	/* Ether type for encapsulated frames */
-#define	ATH_FF_SNAP_ORGCODE_0	0x00
-#define	ATH_FF_SNAP_ORGCODE_1	0x03
-#define	ATH_FF_SNAP_ORGCODE_2	0x7f
-
-/* NB: Atheros allocated the OUI for this purpose ~2005 but beware ... */
-#define	TDMA_OUI		ATH_OUI
-#define	TDMA_OUI_TYPE		0x02
-#define	TDMA_VERSION_V2		2
-#define	TDMA_VERSION		TDMA_VERSION_V2
-
-/* NB: we only support 2 right now but protocol handles up to 8 */
-#define	TDMA_MAXSLOTS		2	/* max slots/sta's */
-
-#define	TDMA_PARAM_LEN_V2	sizeof(struct ieee80211_tdma_param)
-
-struct ieee80211_tdma_param {
-	u_int8_t	tdma_id;	/* IEEE80211_ELEMID_VENDOR */
-	u_int8_t	tdma_len;
-	u_int8_t	tdma_oui[3];	/* 0x00, 0x03, 0x7f */
-	u_int8_t	tdma_type;	/* OUI type */
-	u_int8_t	tdma_subtype;	/* OUI subtype */
-#define	TDMA_SUBTYPE_PARAM	0x01
-	u_int8_t	tdma_version;	/* spec revision */
-	u_int8_t	tdma_slot;	/* station slot # [0..7] */
-	u_int8_t	tdma_slotcnt;	/* bss slot count [1..8] */
-	u_int16_t	tdma_slotlen;	/* bss slot len (100us) */
-	u_int8_t	tdma_bintval;	/* beacon interval (superframes) */
-	u_int8_t	tdma_inuse[1];	/* slot occupancy map */
-	u_int8_t	tdma_pad[2];
-	u_int8_t	tdma_tstamp[8];	/* timestamp from last beacon */
-} __packed;
-
-#define	TDMA_VERSION_VALID(_version) \
-	(TDMA_VERSION_V2 <= (_version) && (_version) <= TDMA_VERSION)
-#define	TDMA_SLOTCNT_VALID(_slotcnt) \
-	(2 <= (_slotcnt) && (_slotcnt) <= TDMA_MAXSLOTS)
-/* XXX magic constants */
-#define	TDMA_SLOTLEN_VALID(_slotlen) \
-	(2*100 <= (_slotlen) && (unsigned)(_slotlen) <= 0xfffff)
-/* XXX probably should set a max */
-#define	TDMA_BINTVAL_VALID(_bintval)	(1 <= (_bintval))
-
 #endif /* _NET80211_IEEE80211_H_ */

Modified: head/sys/net80211/ieee80211_superg.c
==============================================================================
--- head/sys/net80211/ieee80211_superg.c	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_superg.c	Thu Mar 26 21:29:03 2009	(r190455)
@@ -47,6 +47,35 @@ __FBSDID("$FreeBSD$");
 #include <net80211/ieee80211_phy.h>
 #include <net80211/ieee80211_superg.h>
 
+/*
+ * Atheros fast-frame encapsulation format.
+ * FF max payload:
+ * 802.2 + FFHDR + HPAD + 802.3 + 802.2 + 1500 + SPAD + 802.3 + 802.2 + 1500:
+ *   8   +   4   +  4   +   14  +   8   + 1500 +  6   +   14  +   8   + 1500
+ * = 3066
+ */
+/* fast frame header is 32-bits */
+#define	ATH_FF_PROTO	0x0000003f	/* protocol */
+#define	ATH_FF_PROTO_S	0
+#define	ATH_FF_FTYPE	0x000000c0	/* frame type */
+#define	ATH_FF_FTYPE_S	6
+#define	ATH_FF_HLEN32	0x00000300	/* optional hdr length */
+#define	ATH_FF_HLEN32_S	8
+#define	ATH_FF_SEQNUM	0x001ffc00	/* sequence number */
+#define	ATH_FF_SEQNUM_S	10
+#define	ATH_FF_OFFSET	0xffe00000	/* offset to 2nd payload */
+#define	ATH_FF_OFFSET_S	21
+
+#define	ATH_FF_MAX_HDR_PAD	4
+#define	ATH_FF_MAX_SEP_PAD	6
+#define	ATH_FF_MAX_HDR		30
+
+#define	ATH_FF_PROTO_L2TUNNEL	0	/* L2 tunnel protocol */
+#define	ATH_FF_ETH_TYPE		0x88bd	/* Ether type for encapsulated frames */
+#define	ATH_FF_SNAP_ORGCODE_0	0x00
+#define	ATH_FF_SNAP_ORGCODE_1	0x03
+#define	ATH_FF_SNAP_ORGCODE_2	0x7f
+
 #define	ETHER_HEADER_COPY(dst, src) \
 	memcpy(dst, src, sizeof(struct ether_header))
 

Modified: head/sys/net80211/ieee80211_superg.h
==============================================================================
--- head/sys/net80211/ieee80211_superg.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_superg.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -31,6 +31,32 @@
  * Atheros' 802.11 SuperG protocol support.
  */
 
+/*
+ * Atheros advanced capability information element.
+ */
+struct ieee80211_ath_ie {
+	uint8_t		ath_id;			/* IEEE80211_ELEMID_VENDOR */
+	uint8_t		ath_len;		/* length in bytes */
+	uint8_t		ath_oui[3];		/* ATH_OUI */
+	uint8_t		ath_oui_type;		/* ATH_OUI_TYPE */
+	uint8_t		ath_oui_subtype;	/* ATH_OUI_SUBTYPE */
+	uint8_t		ath_version;		/* spec revision */
+	uint8_t		ath_capability;		/* capability info */
+#define	ATHEROS_CAP_TURBO_PRIME		0x01	/* dynamic turbo--aka Turbo' */
+#define	ATHEROS_CAP_COMPRESSION		0x02	/* data compression */
+#define	ATHEROS_CAP_FAST_FRAME		0x04	/* fast (jumbo) frames */
+#define	ATHEROS_CAP_XR			0x08	/* Xtended Range support */
+#define	ATHEROS_CAP_AR			0x10	/* Advanded Radar support */
+#define	ATHEROS_CAP_BURST		0x20	/* Bursting - not negotiated */
+#define	ATHEROS_CAP_WME			0x40	/* CWMin tuning */
+#define	ATHEROS_CAP_BOOST		0x80	/* use turbo/!turbo mode */
+	uint8_t		ath_defkeyix[2];
+} __packed;
+
+#define	ATH_OUI_VERSION		0x00
+#define	ATH_OUI_SUBTYPE		0x01
+
+#ifdef _KERNEL
 void	ieee80211_superg_attach(struct ieee80211com *);
 void	ieee80211_superg_detach(struct ieee80211com *);
 void	ieee80211_superg_vattach(struct ieee80211vap *);
@@ -54,4 +80,5 @@ ieee80211_decap_fastframe(struct ieee802
 	return IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) ?
 	    ieee80211_ff_decap(ni, m) : m;
 }
+#endif /* _KERNEL */
 #endif /* _NET80211_IEEE80211_SUPERG_H_ */

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_tdma.c	Thu Mar 26 21:29:03 2009	(r190455)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
  * IEEE 802.11 TDMA mode support.
  */
 #include "opt_inet.h"
+#include "opt_tdma.h"
 #include "opt_wlan.h"
 
 #include <sys/param.h>
@@ -59,7 +60,6 @@ __FBSDID("$FreeBSD$");
 #include <net80211/ieee80211_tdma.h>
 #include <net80211/ieee80211_input.h>
 
-#include "opt_tdma.h"
 #ifndef TDMA_SLOTLEN_DEFAULT
 #define	TDMA_SLOTLEN_DEFAULT	10*1000		/* 10ms */
 #endif
@@ -94,6 +94,16 @@ __FBSDID("$FreeBSD$");
 #define	TDMA_TXRATE_11NG_DEFAULT	(4 | IEEE80211_RATE_MCS)
 #endif
 
+#define	TDMA_VERSION_VALID(_version) \
+	(TDMA_VERSION_V2 <= (_version) && (_version) <= TDMA_VERSION)
+#define	TDMA_SLOTCNT_VALID(_slotcnt) \
+	(2 <= (_slotcnt) && (_slotcnt) <= TDMA_MAXSLOTS)
+/* XXX magic constants */
+#define	TDMA_SLOTLEN_VALID(_slotlen) \
+	(2*100 <= (_slotlen) && (unsigned)(_slotlen) <= 0xfffff)
+/* XXX probably should set a max */
+#define	TDMA_BINTVAL_VALID(_bintval)	(1 <= (_bintval))
+
 static void tdma_vdetach(struct ieee80211vap *vap);
 static int tdma_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void tdma_beacon_miss(struct ieee80211vap *vap);

Modified: head/sys/net80211/ieee80211_tdma.h
==============================================================================
--- head/sys/net80211/ieee80211_tdma.h	Thu Mar 26 21:10:35 2009	(r190454)
+++ head/sys/net80211/ieee80211_tdma.h	Thu Mar 26 21:29:03 2009	(r190455)
@@ -31,6 +31,39 @@
 /*
  * TDMA-mode implementation definitions.
  */
+
+#define	TDMA_SUBTYPE_PARAM	0x01
+#define	TDMA_VERSION_V2		2
+#define	TDMA_VERSION		TDMA_VERSION_V2
+
+/* NB: we only support 2 right now but protocol handles up to 8 */
+#define	TDMA_MAXSLOTS		2	/* max slots/sta's */
+
+#define	TDMA_PARAM_LEN_V2	sizeof(struct ieee80211_tdma_param)
+
+/*
+ * TDMA information element.
+ */
+struct ieee80211_tdma_param {
+	u_int8_t	tdma_id;	/* IEEE80211_ELEMID_VENDOR */
+	u_int8_t	tdma_len;
+	u_int8_t	tdma_oui[3];	/* TDMA_OUI */
+	u_int8_t	tdma_type;	/* TDMA_OUI_TYPE */
+	u_int8_t	tdma_subtype;	/* TDMA_SUBTYPE_PARAM */
+	u_int8_t	tdma_version;	/* spec revision */
+	u_int8_t	tdma_slot;	/* station slot # [0..7] */
+	u_int8_t	tdma_slotcnt;	/* bss slot count [1..8] */
+	u_int16_t	tdma_slotlen;	/* bss slot len (100us) */
+	u_int8_t	tdma_bintval;	/* beacon interval (superframes) */
+	u_int8_t	tdma_inuse[1];	/* slot occupancy map */
+	u_int8_t	tdma_pad[2];
+	u_int8_t	tdma_tstamp[8];	/* timestamp from last beacon */
+} __packed;
+
+#ifdef _KERNEL
+/*
+ * Implementation state.
+ */
 struct ieee80211_tdma_state {
 	u_int	tdma_slotlen;		/* bss slot length (us) */
 	uint8_t	tdma_version;		/* protocol version to use */
@@ -65,4 +98,5 @@ uint8_t *ieee80211_add_tdma(uint8_t *frm
 struct ieee80211_beacon_offsets;
 void	ieee80211_tdma_update_beacon(struct ieee80211vap *vap,
 	    struct ieee80211_beacon_offsets *bo);
+#endif /* _KERNEL */
 #endif /* !_NET80211_IEEE80211_TDMA_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903262129.n2QLT4T0038153>