patch-2.3.30 linux/include/linux/wireless.h

Next file: linux/include/math-emu/double.h
Previous file: linux/include/linux/videodev.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.29/linux/include/linux/wireless.h linux/include/linux/wireless.h
@@ -1,7 +1,7 @@
 /*
  * This file define a set of standard wireless extensions
  *
- * Version :	8	28.7.99
+ * Version :	9	16.10.99
  *
  * Authors :	Jean Tourrilhes - HPL - <jt@hpl.hp.com>
  */
@@ -63,7 +63,7 @@
  * (there is some stuff that will be added in the future...)
  * I just plan to increment with each new version.
  */
-#define WIRELESS_EXT	8
+#define WIRELESS_EXT	9
 
 /*
  * Changes :
@@ -96,6 +96,14 @@
  *	- Changed my e-mail address
  *	- More 802.11 support (nickname, rate, rts, frag)
  *	- List index in frequencies
+ *
+ * V8 to V9
+ * --------
+ *	- Support for 'mode of operation' (ad-hoc, managed...)
+ *	- Support for unicast and multicast power saving
+ *	- Change encoding to support larger tokens (>64 bits)
+ *	- Updated iw_params (disable, flags) and use it for NWID
+ *	- Extracted iw_point from iwreq for clarity
  */
 
 /* -------------------------- IOCTL LIST -------------------------- */
@@ -103,12 +111,12 @@
 /* Basic operations */
 #define SIOCSIWNAME	0x8B00		/* Unused ??? */
 #define SIOCGIWNAME	0x8B01		/* get name */
-#define SIOCSIWNWID	0x8B02		/* set network id */
+#define SIOCSIWNWID	0x8B02		/* set network id (the cell) */
 #define SIOCGIWNWID	0x8B03		/* get network id */
 #define SIOCSIWFREQ	0x8B04		/* set channel/frequency */
 #define SIOCGIWFREQ	0x8B05		/* get channel/frequency */
-#define SIOCSIWENCODE	0x8B06		/* set encoding info */
-#define SIOCGIWENCODE	0x8B07		/* get encoding info */
+#define SIOCSIWMODE	0x8B06		/* set operation mode */
+#define SIOCGIWMODE	0x8B07		/* get operation mode */
 #define SIOCSIWSENS	0x8B08		/* set sensitivity */
 #define SIOCGIWSENS	0x8B09		/* get sensitivity */
 
@@ -146,11 +154,18 @@
 #define SIOCSIWFRAG	0x8B24		/* set fragmentation thr (bytes) */
 #define SIOCGIWFRAG	0x8B25		/* get fragmentation thr (bytes) */
 
+/* Encoding stuff (scrambling, hardware security, WEP...) */
+#define SIOCSIWENCODE	0x8B2A		/* set encoding token & mode */
+#define SIOCGIWENCODE	0x8B2B		/* get encoding token & mode */
+/* Power saving stuff (power management, unicast and multicast) */
+#define SIOCSIWPOWER	0x8B2C		/* set Power Management settings */
+#define SIOCGIWPOWER	0x8B2D		/* get Power Management settings */
+
 /* ------------------------- IOCTL STUFF ------------------------- */
 
 /* The first and the last (range) */
 #define SIOCIWFIRST	0x8B00
-#define SIOCIWLAST	0x8B25
+#define SIOCIWLAST	0x8B30
 
 /* Even : get (world access), odd : set (root access) */
 #define IW_IS_SET(cmd)	(!((cmd) & 0x1))
@@ -200,10 +215,67 @@
 /* Maximum size of the ESSID and NICKN strings */
 #define IW_ESSID_MAX_SIZE	32
 
+/* Modes of operation */
+#define IW_MODE_AUTO	0	/* Let the driver decides */
+#define IW_MODE_ADHOC	1	/* Single cell network */
+#define IW_MODE_INFRA	2	/* Multi cell network, roaming, ... */
+#define IW_MODE_MASTER	3	/* Synchronisation master or Access Point */
+#define IW_MODE_REPEAT	4	/* Wireless Repeater (forwarder) */
+#define IW_MODE_SECOND	5	/* Secondary master/repeater (backup) */
+
+/* Maximum number of size of encoding token available
+ * they are listed in the range structure */
+#define IW_MAX_ENCODING_SIZES	8
+
+/* Maximum size of the encoding token in bytes */
+#define IW_ENCODING_TOKEN_MAX	32	/* 256 bits (for now) */
+
+/* Flags for encoding (along with the token) */
+#define IW_ENCODE_INDEX		0x00FF	/* Token index (if needed) */
+#define IW_ENCODE_FLAGS		0xF000	/* Flags defined below */
+#define IW_ENCODE_DISABLED	0x8000	/* Encoding disabled */
+#define IW_ENCODE_ENABLED	0x0000	/* Encoding enabled */
+#define IW_ENCODE_RESTRICTED	0x4000	/* Refuse non-encoded packets */
+#define IW_ENCODE_OPEN		0x2000	/* Accept non-encoded packets */
+
+/* Power management flags available (along with the value, if any) */
+#define IW_POWER_ON		0x0000	/* No details... */
+#define IW_POWER_TYPE		0xF000	/* Type of parameter */
+#define IW_POWER_PERIOD		0x1000	/* Value is a period/duration of  */
+#define IW_POWER_TIMEOUT	0x2000	/* Value is a timeout (to go asleep) */
+#define IW_POWER_MODE		0x0F00	/* Power Management mode */
+#define IW_POWER_UNICAST_R	0x0100	/* Receive only unicast messages */
+#define IW_POWER_MULTICAST_R	0x0200	/* Receive only multicast messages */
+#define IW_POWER_ALL_R		0x0300	/* Receive all messages though PM */
+#define IW_POWER_FORCE_S	0x0400	/* Force PM procedure for sending unicast */
+#define IW_POWER_REPEATER	0x0800	/* Repeat broadcast messages in PM period */
+
 /****************************** TYPES ******************************/
 
 /* --------------------------- SUBTYPES --------------------------- */
 /*
+ *	Generic format for most parameters that fit in an int
+ */
+struct	iw_param
+{
+  __s32		value;		/* The value of the parameter itself */
+  __u8		fixed;		/* Hardware should not use auto select */
+  __u8		disabled;	/* Disable the feature */
+  __u16		flags;		/* Various specifc flags (if any) */
+};
+
+/*
+ *	For all data larger than 16 octets, we need to use a
+ *	pointer to memory alocated in user space.
+ */
+struct	iw_point
+{
+  caddr_t	pointer;	/* Pointer to the data  (in user space) */
+  __u16		length;		/* number of fields or size in bytes */
+  __u16		flags;		/* Optional params */
+};
+
+/*
  *	A frequency
  *	For numbers lower than 10^9, we encode the number in 'm' and
  *	set 'e' to 0
@@ -223,7 +295,7 @@
  */
 struct	iw_quality
 {
-	__u8		qual;		/* link quality (SNR or better...) */
+	__u8		qual;		/* link quality (%retries, SNR or better...) */
 	__u8		level;		/* signal level */
 	__u8		noise;		/* noise level */
 	__u8		updated;	/* Flags to know if updated */
@@ -240,33 +312,13 @@
 	__u32		misc;		/* Others cases */
 };
 
-/*
- *	Encoding information (setting and so on)
- *	Encoding might be hardware encryption, scrambing or others
- */
-struct	iw_encoding
-{
-  __u8	method;			/* Algorithm number / key used */
-  __u64	code;			/* Data/key used for algorithm */
-};
-
-/*
- *	Generic format for parameters
- */
-struct	iw_param
-{
-  __s32		value;		/* The value of the parameter itself */
-  __u8		fixed;		/* Hardware should not use auto select */
-};
-
-
 /* ------------------------ WIRELESS STATS ------------------------ */
 /*
  * Wireless statistics (used for /proc/net/wireless)
  */
 struct	iw_statistics
 {
-	__u8		status;		/* Status
+	__u16		status;		/* Status
 					 * - device dependent for now */
 
 	struct iw_quality	qual;		/* Quality of the link
@@ -295,37 +347,28 @@
 	union
 	{
 		/* Config - generic */
-		char	name[IFNAMSIZ];
+		char		name[IFNAMSIZ];
 		/* Name : used to verify the presence of  wireless extensions.
 		 * Name of the protocol/provider... */
 
-		struct		/* network id (or domain) : used to to */
-		{		/* create logical channels on the air */
-			__u32	nwid;		/* value */
-			__u8	on;		/* active/unactive nwid */
-		}	nwid;
-
+		struct iw_point	essid;	/* Extended network name */
+		struct iw_param	nwid;	/* network id (or domain - the cell) */
 		struct iw_freq	freq;	/* frequency or channel :
 					 * 0-1000 = channel
 					 * > 1000 = frequency in Hz */
 
-		struct iw_encoding	encoding;	/* Encoding stuff */
-
-		__u32	sensitivity;		/* Obsolete, but compatible */
 		struct iw_param	sens;		/* signal level threshold */
 		struct iw_param	bitrate;	/* default bit rate */
 		struct iw_param	rts;		/* RTS threshold threshold */
 		struct iw_param	frag;		/* Fragmentation threshold */
+		__u32		mode;		/* Operation mode */
+
+		struct iw_point	encoding;	/* Encoding stuff : tokens */
+		struct iw_param	power;		/* PM duration/timeout */
 
 		struct sockaddr	ap_addr;	/* Access point address */
 
-		struct		/* For all data bigger than 16 octets */
-		{
-			caddr_t	pointer;	/* Pointer to the data
-						 * (in user space) */
-			__u16	length;		/* fields or byte size */
-			__u16	flags;		/* Optional params */
-		}	data;
+		struct iw_point	data;		/* Other large parameters */
 	}	u;
 };
 
@@ -366,9 +409,6 @@
 	/* Quality of link & SNR stuff */
 	struct iw_quality	max_qual;	/* Quality of the link */
 
-	/* Encoder stuff */
-	struct iw_encoding	max_encoding;	/* Encoding max range */
-
 	/* Rates */
 	__u8		num_bitrates;	/* Number of entries in the list */
 	__s32		bitrate[IW_MAX_BITRATES];	/* list, in bps */
@@ -380,6 +420,17 @@
 	/* Frag threshold */
 	__s32		min_frag;	/* Minimal frag threshold */
 	__s32		max_frag;	/* Maximal frag threshold */
+
+	/* Power Management duration & timeout */
+	__s32		min_pmd;	/* Minimal PM duration */
+	__s32		max_pmd;	/* Maximal PM duration */
+	__s32		min_pmt;	/* Minimal PM timeout */
+	__s32		max_pmt;	/* Maximal PM timeout */
+
+	/* Encoder stuff */
+	__u16	encoding_size[IW_MAX_ENCODING_SIZES];	/* Different token sizes */
+	__u8	num_encoding_sizes;	/* Number of entry in the list */
+	__u8	max_encoding_tokens;	/* Max number of tokens */
 };
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)