PERFORCE change 65063 for review

Sam Leffler sam at FreeBSD.org
Sat Nov 13 15:42:08 PST 2004


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

Change 65063 by sam at sam_ebb on 2004/11/13 23:41:07

	Cleanup common definitions: add _ieee80211.h to hold intrinsic
	types and move some types around.
	
	This resolves various issues with the ioctl and radiotap support
	needing to duplicate definitions because it wasn't feasible to
	include ieee80211_var.h.

Affected files ...

.. //depot/projects/wifi/sys/net80211/_ieee80211.h#1 add
.. //depot/projects/wifi/sys/net80211/ieee80211.h#3 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#8 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_node.h#10 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_var.h#10 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211.h#3 (text+ko) ====

@@ -609,14 +609,4 @@
 #define	IEEE80211_RTS_MIN		1
 #define	IEEE80211_RTS_MAX		IEEE80211_MAX_LEN
 
-enum {
-	IEEE80211_AUTH_NONE	= 0,
-	IEEE80211_AUTH_OPEN	= 1,		/* open */
-	IEEE80211_AUTH_SHARED	= 2,		/* shared-key */
-	IEEE80211_AUTH_8021X	= 3,		/* 802.1x */
-	IEEE80211_AUTH_AUTO	= 4,		/* auto-select/accept */
-	/* NB: these are used only for ioctls */
-	IEEE80211_AUTH_WPA	= 5,		/* WPA/RSN w/ 802.1x/PSK */
-};
-
 #endif /* _NET80211_IEEE80211_H_ */

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#8 (text+ko) ====

@@ -37,6 +37,7 @@
 /*
  * IEEE 802.11 ioctls.
  */
+#include <net80211/_ieee80211.h>
 #include <net80211/ieee80211.h>
 #include <net80211/ieee80211_crypto.h>
 
@@ -243,7 +244,7 @@
  * scanning.
  */
 struct ieee80211req_chanlist {
-	u_int8_t	ic_channels[32];	/* 256 channels */
+	u_int8_t	ic_channels[IEEE80211_CHAN_BYTES];
 };
 
 /*
@@ -251,10 +252,7 @@
  */
 struct ieee80211req_chaninfo {
 	u_int	ic_nchans;
-	struct ieee80211_chaninfo {
-		u_int16_t	ic_freq;	/* setting in Mhz */
-		u_int16_t	ic_flags;	/* see below */
-	} ic_chans[256];
+	struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
 };
 
 /*
@@ -292,7 +290,8 @@
 	u_int8_t	isi_erp;		/* ERP element */
 	u_int8_t	isi_macaddr[IEEE80211_ADDR_LEN];
 	u_int8_t	isi_nrates;
-	u_int8_t	isi_rates[15];		/* negotiated rates */
+						/* negotiated rates */
+	u_int8_t	isi_rates[IEEE80211_RATE_MAXSIZE];
 	u_int8_t	isi_txrate;		/* index to isi_rates[] */
 	u_int8_t	isi_ie_len;		/* IE length */
 	u_int16_t	isi_associd;		/* assoc response */
@@ -392,10 +391,6 @@
 /* 43-44 available */
 #define	IEEE80211_IOC_STA_INFO		45	/* station/neighbor info */
 
-#ifndef IEEE80211_CHAN_ANY
-#define	IEEE80211_CHAN_ANY	0xffff		/* token for ``any channel'' */
-#endif
-
 /*
  * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
  */
@@ -410,7 +405,7 @@
 	u_int8_t	isr_erp;		/* ERP element */
 	u_int8_t	isr_bssid[IEEE80211_ADDR_LEN];
 	u_int8_t	isr_nrates;
-	u_int8_t	isr_rates[15];		/* XXX */
+	u_int8_t	isr_rates[IEEE80211_RATE_MAXSIZE];
 	u_int8_t	isr_ssid_len;		/* SSID length */
 	u_int8_t	isr_ie_len;		/* IE length */
 	u_int8_t	isr_pad[5];

==== //depot/projects/wifi/sys/net80211/ieee80211_node.h#10 (text+ko) ====

@@ -65,14 +65,6 @@
 	(((const u_int8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % \
 		IEEE80211_NODE_HASHSIZE)
 
-#define	IEEE80211_RATE_SIZE	8		/* 802.11 standard */
-#define	IEEE80211_RATE_MAXSIZE	15		/* max rates we'll handle */
-
-struct ieee80211_rateset {
-	u_int8_t		rs_nrates;
-	u_int8_t		rs_rates[IEEE80211_RATE_MAXSIZE];
-};
-
 struct ieee80211_rsnparms {
 	u_int8_t	rsn_mcastcipher;	/* mcast/group cipher */
 	u_int8_t	rsn_mcastkeylen;	/* mcast key length */

==== //depot/projects/wifi/sys/net80211/ieee80211_var.h#10 (text+ko) ====

@@ -51,139 +51,17 @@
 #error	"No support for your operating system!"
 #endif
 
+#include <net80211/_ieee80211.h>
 #include <net80211/ieee80211.h>
 #include <net80211/ieee80211_crypto.h>
 #include <net80211/ieee80211_ioctl.h>		/* for ieee80211_stats */
 #include <net80211/ieee80211_node.h>
 #include <net80211/ieee80211_proto.h>
 
-#define	IEEE80211_CHAN_MAX	255
-#define	IEEE80211_CHAN_BYTES	howmany(IEEE80211_CHAN_MAX, NBBY)
-#define	IEEE80211_CHAN_ANY	0xffff	/* token for ``any channel'' */
-#define	IEEE80211_CHAN_ANYC \
-	((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
-
 #define	IEEE80211_TXPOWER_MAX	100	/* .5 dbM (XXX units?) */
 #define	IEEE80211_TXPOWER_MIN	0	/* kill radio */
 
-enum ieee80211_phytype {
-	IEEE80211_T_DS,			/* direct sequence spread spectrum */
-	IEEE80211_T_FH,			/* frequency hopping */
-	IEEE80211_T_OFDM,		/* frequency division multiplexing */
-	IEEE80211_T_TURBO,		/* high rate OFDM, aka turbo mode */
-};
-#define	IEEE80211_T_CCK	IEEE80211_T_DS	/* more common nomenclature */
-
-/* XXX not really a mode; there are really multiple PHY's */
-enum ieee80211_phymode {
-	IEEE80211_MODE_AUTO	= 0,	/* autoselect */
-	IEEE80211_MODE_11A	= 1,	/* 5GHz, OFDM */
-	IEEE80211_MODE_11B	= 2,	/* 2GHz, CCK */
-	IEEE80211_MODE_11G	= 3,	/* 2GHz, OFDM */
-	IEEE80211_MODE_FH	= 4,	/* 2GHz, GFSK */
-	IEEE80211_MODE_TURBO	= 5,	/* 5GHz, OFDM, 2x clock */
-};
-#define	IEEE80211_MODE_MAX	(IEEE80211_MODE_TURBO+1)
-
-enum ieee80211_opmode {
-	IEEE80211_M_STA		= 1,	/* infrastructure station */
-	IEEE80211_M_IBSS 	= 0,	/* IBSS (adhoc) station */
-	IEEE80211_M_AHDEMO	= 3,	/* Old lucent compatible adhoc demo */
-	IEEE80211_M_HOSTAP	= 6,	/* Software Access Point */
-	IEEE80211_M_MONITOR	= 8	/* Monitor mode */
-};
-
-/*
- * 802.11g protection mode.
- */
-enum ieee80211_protmode {
-	IEEE80211_PROT_NONE	= 0,	/* no protection */
-	IEEE80211_PROT_CTSONLY	= 1,	/* CTS to self */
-	IEEE80211_PROT_RTSCTS	= 2,	/* RTS-CTS */
-};
-
-/*
- * Roaming mode is effectively who controls the operation
- * of the 802.11 state machine when operating as a station.
- * State transitions are controlled either by the driver
- * (typically when management frames are processed by the
- * hardware/firmware), the host (auto/normal operation of
- * the 802.11 layer), or explicitly through ioctl requests
- * when applications like wpa_supplicant want control.
- */
-enum ieee80211_roamingmode {
-	IEEE80211_ROAMING_DEVICE= 0,	/* driver/hardware control */
-	IEEE80211_ROAMING_AUTO	= 1,	/* 802.11 layer control */
-	IEEE80211_ROAMING_MANUAL= 2,	/* application control */
-};
-
-/*
- * Channels are specified by frequency and attributes.
- */
-struct ieee80211_channel {
-	u_int16_t	ic_freq;	/* setting in Mhz */
-	u_int16_t	ic_flags;	/* see below */
-};
-
-/* bits 0-3 are for private use by drivers */
-/* channel attributes */
-#define	IEEE80211_CHAN_TURBO	0x0010	/* Turbo channel */
-#define	IEEE80211_CHAN_CCK	0x0020	/* CCK channel */
-#define	IEEE80211_CHAN_OFDM	0x0040	/* OFDM channel */
-#define	IEEE80211_CHAN_2GHZ	0x0080	/* 2 GHz spectrum channel. */
-#define	IEEE80211_CHAN_5GHZ	0x0100	/* 5 GHz spectrum channel */
-#define	IEEE80211_CHAN_PASSIVE	0x0200	/* Only passive scan allowed */
-#define	IEEE80211_CHAN_DYN	0x0400	/* Dynamic CCK-OFDM channel */
-#define	IEEE80211_CHAN_GFSK	0x0800	/* GFSK channel (FHSS PHY) */
-
-/*
- * Useful combinations of channel characteristics.
- */
-#define	IEEE80211_CHAN_FHSS \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
-#define	IEEE80211_CHAN_A \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
-#define	IEEE80211_CHAN_B \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
-#define	IEEE80211_CHAN_PUREG \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
-#define	IEEE80211_CHAN_G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
-#define	IEEE80211_CHAN_T \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
-
-#define	IEEE80211_IS_CHAN_FHSS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
-#define	IEEE80211_IS_CHAN_A(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
-#define	IEEE80211_IS_CHAN_B(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
-#define	IEEE80211_IS_CHAN_PUREG(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
-#define	IEEE80211_IS_CHAN_G(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
-#define	IEEE80211_IS_CHAN_T(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T)
-
-#define	IEEE80211_IS_CHAN_2GHZ(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
-#define	IEEE80211_IS_CHAN_5GHZ(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
-#define	IEEE80211_IS_CHAN_OFDM(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
-#define	IEEE80211_IS_CHAN_CCK(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
-#define	IEEE80211_IS_CHAN_GFSK(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
-
-/* ni_chan encoding for FH phy */
-#define	IEEE80211_FH_CHANMOD	80
-#define	IEEE80211_FH_CHAN(set,pat)	(((set)-1)*IEEE80211_FH_CHANMOD+(pat))
-#define	IEEE80211_FH_CHANSET(chan)	((chan)/IEEE80211_FH_CHANMOD+1)
-#define	IEEE80211_FH_CHANPAT(chan)	((chan)%IEEE80211_FH_CHANMOD)
-
 #define	IEEE80211_PS_SLEEP	0x1	/* STA is in power saving mode */
-
 #define	IEEE80211_PS_MAX_QUEUE	50	/* maximum saved packets */
 
 struct ieee80211_aclator;


More information about the p4-projects mailing list