Wireless Extension update...

2001-03-28 Thread Jean Tourrilhes

Hi,

Now that I got away from IrDA, I've been taking care of my
todo list on the Wireless side.
The most critical feature is versionning. Since distributions
started shipping separate kernel header in /usr/include/linux, drivers
and tools can be out of sync (== core dump when reading iwrange). A
lot of user have been caught by that moving from 2.2.X to 2.4.X. This
patch provide a way to detect that and to fix the problem.
Also, I added a new extension (retry), and implemented it in
the orinoco_cs driver. However, it is not enabled in orinoco_cs
(has_retry=0) because we are in stable kernels ;-)

Would you mind adding that in the kernel ?

Thanks...

Jean

P.S. : A new version of Wireless Tools with all those goodies will be
soon on my web page...


diff -u -p linux/include/linux/wireless.25.h linux/include/linux/wireless.h
--- linux/include/linux/wireless.25.h   Wed Mar 28 10:33:47 2001
+++ linux/include/linux/wireless.h  Wed Mar 28 17:31:42 2001
@@ -1,7 +1,7 @@
 /*
  * This file define a set of standard wireless extensions
  *
- * Version :   9   16.10.99
+ * Version :   11  28.3.01
  *
  * Authors :   Jean Tourrilhes - HPL - <[EMAIL PROTECTED]>
  */
@@ -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   10
+#define WIRELESS_EXT   11
 
 /*
  * Changes :
@@ -111,6 +111,11 @@
  * - Add PM modifier : MAX/MIN/RELATIVE
  * - Add encoding option : IW_ENCODE_NOKEY
  * - Add TxPower ioctls (work like TxRate)
+ *
+ * V10 to V11
+ * --
+ * - Add WE version in range (help backward/forward compatibility)
+ * - Add retry ioctls (work like PM)
  */
 
 /* -- IOCTL LIST -- */
@@ -162,6 +167,8 @@
 #define SIOCGIWFRAG0x8B25  /* get fragmentation thr (bytes) */
 #define SIOCSIWTXPOW   0x8B26  /* set transmit power (dBm) */
 #define SIOCGIWTXPOW   0x8B27  /* get transmit power (dBm) */
+#define SIOCSIWRETRY   0x8B28  /* set retry limits and lifetime */
+#define SIOCGIWRETRY   0x8B29  /* get retry limits and lifetime */
 
 /* Encoding stuff (scrambling, hardware security, WEP...) */
 #define SIOCSIWENCODE  0x8B2A  /* set encoding token & mode */
@@ -272,6 +279,16 @@
 #define IW_TXPOW_DBM   0x  /* Value is in dBm */
 #define IW_TXPOW_MWATT 0x0001  /* Value is in mW */
 
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON0x  /* No details... */
+#define IW_RETRY_TYPE  0xF000  /* Type of parameter */
+#define IW_RETRY_LIMIT 0x1000  /* Maximum number of retries*/
+#define IW_RETRY_LIFETIME  0x2000  /* Maximum duration of retries in us */
+#define IW_RETRY_MODIFIER  0x000F  /* Modify a parameter */
+#define IW_RETRY_MIN   0x0001  /* Value is a minimum  */
+#define IW_RETRY_MAX   0x0002  /* Value is a maximum */
+#define IW_RETRY_RELATIVE  0x0004  /* Value is not in seconds/ms/us */
+
 /** TYPES **/
 
 /* --- SUBTYPES --- */
@@ -385,6 +402,7 @@ struct  iwreq 
struct iw_param rts;/* RTS threshold threshold */
struct iw_param frag;   /* Fragmentation threshold */
__u32   mode;   /* Operation mode */
+   struct iw_param retry;  /* Retry limits & lifetime */
 
struct iw_point encoding;   /* Encoding stuff : tokens */
struct iw_param power;  /* PM duration/timeout */
@@ -462,6 +480,19 @@ struct iw_range
__u16   txpower_capa;   /* What options are supported */
__u8num_txpower;/* Number of entries in the list */
__s32   txpower[IW_MAX_TXPOWER];/* list, in bps */
+
+   /* Wireless Extension version info */
+   __u8we_version_compiled;/* Must be WIRELESS_EXT */
+   __u8we_version_source;  /* Last update of source */
+
+   /* Retry limits and lifetime */
+   __u16   retry_capa; /* What retry options are supported */
+   __u16   retry_flags;/* How to decode max/min retry limit */
+   __u16   r_time_flags;   /* How to decode max/min retry life */
+   __s32   min_retry;  /* Minimal number of retries */
+   __s32   max_retry;  /* Maximal number of retries */
+   __s32   min_r_time; /* Minimal retry lifetime */
+   __s32   max_r_time; /* Maximal retry lifetime */
 };
 
 /*
diff -u -p linux/drivers/net/wireless.25/wavelan.c linux/drivers/net/wavelan.c
--- linux/drivers/net/wireless.25/wavelan.c Wed Mar 28 17:27:27 2001
+++ linux/drivers/net/wavelan.c Wed Mar 28 17:28:34 2001
@@ 

Wireless Extension update...

2001-03-28 Thread Jean Tourrilhes

Hi,

Now that I got away from IrDA, I've been taking care of my
todo list on the Wireless side.
The most critical feature is versionning. Since distributions
started shipping separate kernel header in /usr/include/linux, drivers
and tools can be out of sync (== core dump when reading iwrange). A
lot of user have been caught by that moving from 2.2.X to 2.4.X. This
patch provide a way to detect that and to fix the problem.
Also, I added a new extension (retry), and implemented it in
the orinoco_cs driver. However, it is not enabled in orinoco_cs
(has_retry=0) because we are in stable kernels ;-)

Would you mind adding that in the kernel ?

Thanks...

Jean

P.S. : A new version of Wireless Tools with all those goodies will be
soon on my web page...


diff -u -p linux/include/linux/wireless.25.h linux/include/linux/wireless.h
--- linux/include/linux/wireless.25.h   Wed Mar 28 10:33:47 2001
+++ linux/include/linux/wireless.h  Wed Mar 28 17:31:42 2001
@@ -1,7 +1,7 @@
 /*
  * This file define a set of standard wireless extensions
  *
- * Version :   9   16.10.99
+ * Version :   11  28.3.01
  *
  * Authors :   Jean Tourrilhes - HPL - [EMAIL PROTECTED]
  */
@@ -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   10
+#define WIRELESS_EXT   11
 
 /*
  * Changes :
@@ -111,6 +111,11 @@
  * - Add PM modifier : MAX/MIN/RELATIVE
  * - Add encoding option : IW_ENCODE_NOKEY
  * - Add TxPower ioctls (work like TxRate)
+ *
+ * V10 to V11
+ * --
+ * - Add WE version in range (help backward/forward compatibility)
+ * - Add retry ioctls (work like PM)
  */
 
 /* -- IOCTL LIST -- */
@@ -162,6 +167,8 @@
 #define SIOCGIWFRAG0x8B25  /* get fragmentation thr (bytes) */
 #define SIOCSIWTXPOW   0x8B26  /* set transmit power (dBm) */
 #define SIOCGIWTXPOW   0x8B27  /* get transmit power (dBm) */
+#define SIOCSIWRETRY   0x8B28  /* set retry limits and lifetime */
+#define SIOCGIWRETRY   0x8B29  /* get retry limits and lifetime */
 
 /* Encoding stuff (scrambling, hardware security, WEP...) */
 #define SIOCSIWENCODE  0x8B2A  /* set encoding token  mode */
@@ -272,6 +279,16 @@
 #define IW_TXPOW_DBM   0x  /* Value is in dBm */
 #define IW_TXPOW_MWATT 0x0001  /* Value is in mW */
 
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON0x  /* No details... */
+#define IW_RETRY_TYPE  0xF000  /* Type of parameter */
+#define IW_RETRY_LIMIT 0x1000  /* Maximum number of retries*/
+#define IW_RETRY_LIFETIME  0x2000  /* Maximum duration of retries in us */
+#define IW_RETRY_MODIFIER  0x000F  /* Modify a parameter */
+#define IW_RETRY_MIN   0x0001  /* Value is a minimum  */
+#define IW_RETRY_MAX   0x0002  /* Value is a maximum */
+#define IW_RETRY_RELATIVE  0x0004  /* Value is not in seconds/ms/us */
+
 /** TYPES **/
 
 /* --- SUBTYPES --- */
@@ -385,6 +402,7 @@ struct  iwreq 
struct iw_param rts;/* RTS threshold threshold */
struct iw_param frag;   /* Fragmentation threshold */
__u32   mode;   /* Operation mode */
+   struct iw_param retry;  /* Retry limits  lifetime */
 
struct iw_point encoding;   /* Encoding stuff : tokens */
struct iw_param power;  /* PM duration/timeout */
@@ -462,6 +480,19 @@ struct iw_range
__u16   txpower_capa;   /* What options are supported */
__u8num_txpower;/* Number of entries in the list */
__s32   txpower[IW_MAX_TXPOWER];/* list, in bps */
+
+   /* Wireless Extension version info */
+   __u8we_version_compiled;/* Must be WIRELESS_EXT */
+   __u8we_version_source;  /* Last update of source */
+
+   /* Retry limits and lifetime */
+   __u16   retry_capa; /* What retry options are supported */
+   __u16   retry_flags;/* How to decode max/min retry limit */
+   __u16   r_time_flags;   /* How to decode max/min retry life */
+   __s32   min_retry;  /* Minimal number of retries */
+   __s32   max_retry;  /* Maximal number of retries */
+   __s32   min_r_time; /* Minimal retry lifetime */
+   __s32   max_r_time; /* Maximal retry lifetime */
 };
 
 /*
diff -u -p linux/drivers/net/wireless.25/wavelan.c linux/drivers/net/wavelan.c
--- linux/drivers/net/wireless.25/wavelan.c Wed Mar 28 17:27:27 2001
+++ linux/drivers/net/wavelan.c Wed Mar 28 17:28:34 2001
@@ 

Wireless Extension update

2000-12-19 Thread Jean Tourrilhes

Hi Linus and Alan,

This is a totally trivial update of the Wireless Extensions
definition. It just adds a few more #define, so no troubles or pain
expected.
The patch attached applies cleanly to *both* 2.4.0-test12 and
2.2.18 (tested), and I would suggest including it in both kernel
series...

Changes :
o Power Management update (max, min & capa)
-> Needed by the Symbol/Intel/3Com 802.11b driver
o Support for read only "encoding" keys
o Support for TxPower parameter
-> Both needed by the Cisco/Aironet 802.11b driver

By the way, don't look in the kernel for the driver mentionned
above, the majority of the Wireless LAN drivers are not in the kernel
(but in the Pcmcia package or elsewhere), and some in the kernel are
not up to date with the version in the Pcmcia package.

Thanks...

Jean


diff -u -p linux/include/linux/wireless.9.h linux/include/linux/wireless.h
--- linux/include/linux/wireless.9.hTue Nov 14 10:55:46 2000
+++ linux/include/linux/wireless.h  Tue Dec 19 14:42:02 2000
@@ -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   9
+#define WIRELESS_EXT   10
 
 /*
  * Changes :
@@ -104,26 +104,33 @@
  * - 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
+ *
+ * V9 to V10
+ * -
+ * - Add PM capability to range structure
+ * - Add PM modifier : MAX/MIN/RELATIVE
+ * - Add encoding option : IW_ENCODE_NOKEY
+ * - Add TxPower ioctls (work like TxRate)
  */
 
 /* -- IOCTL LIST -- */
 
 /* Basic operations */
-#define SIOCSIWNAME0x8B00  /* Unused ??? */
-#define SIOCGIWNAME0x8B01  /* get name */
+#define SIOCSIWNAME0x8B00  /* Unused */
+#define SIOCGIWNAME0x8B01  /* get name == wireless protocol */
 #define SIOCSIWNWID0x8B02  /* set network id (the cell) */
 #define SIOCGIWNWID0x8B03  /* get network id */
-#define SIOCSIWFREQ0x8B04  /* set channel/frequency */
-#define SIOCGIWFREQ0x8B05  /* get channel/frequency */
+#define SIOCSIWFREQ0x8B04  /* set channel/frequency (Hz) */
+#define SIOCGIWFREQ0x8B05  /* get channel/frequency (Hz) */
 #define SIOCSIWMODE0x8B06  /* set operation mode */
 #define SIOCGIWMODE0x8B07  /* get operation mode */
-#define SIOCSIWSENS0x8B08  /* set sensitivity */
-#define SIOCGIWSENS0x8B09  /* get sensitivity */
+#define SIOCSIWSENS0x8B08  /* set sensitivity (dBm) */
+#define SIOCGIWSENS0x8B09  /* get sensitivity (dBm) */
 
 /* Informative stuff */
-#define SIOCSIWRANGE   0x8B0A  /* Unused ??? */
+#define SIOCSIWRANGE   0x8B0A  /* Unused */
 #define SIOCGIWRANGE   0x8B0B  /* Get range of parameters */
-#define SIOCSIWPRIV0x8B0C  /* Unused ??? */
+#define SIOCSIWPRIV0x8B0C  /* Unused */
 #define SIOCGIWPRIV0x8B0D  /* get private ioctl interface info */
 
 /* Mobile IP support */
@@ -153,6 +160,8 @@
 #define SIOCGIWRTS 0x8B23  /* get RTS/CTS threshold (bytes) */
 #define SIOCSIWFRAG0x8B24  /* set fragmentation thr (bytes) */
 #define SIOCGIWFRAG0x8B25  /* get fragmentation thr (bytes) */
+#define SIOCSIWTXPOW   0x8B26  /* set transmit power (dBm) */
+#define SIOCGIWTXPOW   0x8B27  /* get transmit power (dBm) */
 
 /* Encoding stuff (scrambling, hardware security, WEP...) */
 #define SIOCSIWENCODE  0x8B2A  /* set encoding token & mode */
@@ -205,6 +214,9 @@
 /* Maximum bit rates in the range struct */
 #define IW_MAX_BITRATES8
 
+/* Maximum tx powers in the range struct */
+#define IW_MAX_TXPOWER 8
+
 /* Maximum of address that you may set with SPY */
 #define IW_MAX_SPY 8
 
@@ -232,11 +244,13 @@
 
 /* Flags for encoding (along with the token) */
 #define IW_ENCODE_INDEX0x00FF  /* Token index (if needed) */
-#define IW_ENCODE_FLAGS0xF000  /* Flags defined below */
+#define IW_ENCODE_FLAGS0xFF00  /* Flags defined below */
+#define IW_ENCODE_MODE 0xF000  /* Modes defined below */
 #define IW_ENCODE_DISABLED 0x8000  /* Encoding disabled */
 #define IW_ENCODE_ENABLED  0x  /* Encoding enabled */
 #define IW_ENCODE_RESTRICTED   0x4000  /* Refuse non-encoded packets */
 #define IW_ENCODE_OPEN 0x2000  /* Accept non-encoded packets */
+#define IW_ENCODE_NOKEY 0x0800  /* Key is write only, so not present */
 
 /* Power management flags available (along with the value, if any) */
 #define IW_POWER_ON0x  

Wireless Extension update

2000-12-19 Thread Jean Tourrilhes

Hi Linus and Alan,

This is a totally trivial update of the Wireless Extensions
definition. It just adds a few more #define, so no troubles or pain
expected.
The patch attached applies cleanly to *both* 2.4.0-test12 and
2.2.18 (tested), and I would suggest including it in both kernel
series...

Changes :
o Power Management update (max, min  capa)
- Needed by the Symbol/Intel/3Com 802.11b driver
o Support for read only "encoding" keys
o Support for TxPower parameter
- Both needed by the Cisco/Aironet 802.11b driver

By the way, don't look in the kernel for the driver mentionned
above, the majority of the Wireless LAN drivers are not in the kernel
(but in the Pcmcia package or elsewhere), and some in the kernel are
not up to date with the version in the Pcmcia package.

Thanks...

Jean


diff -u -p linux/include/linux/wireless.9.h linux/include/linux/wireless.h
--- linux/include/linux/wireless.9.hTue Nov 14 10:55:46 2000
+++ linux/include/linux/wireless.h  Tue Dec 19 14:42:02 2000
@@ -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   9
+#define WIRELESS_EXT   10
 
 /*
  * Changes :
@@ -104,26 +104,33 @@
  * - 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
+ *
+ * V9 to V10
+ * -
+ * - Add PM capability to range structure
+ * - Add PM modifier : MAX/MIN/RELATIVE
+ * - Add encoding option : IW_ENCODE_NOKEY
+ * - Add TxPower ioctls (work like TxRate)
  */
 
 /* -- IOCTL LIST -- */
 
 /* Basic operations */
-#define SIOCSIWNAME0x8B00  /* Unused ??? */
-#define SIOCGIWNAME0x8B01  /* get name */
+#define SIOCSIWNAME0x8B00  /* Unused */
+#define SIOCGIWNAME0x8B01  /* get name == wireless protocol */
 #define SIOCSIWNWID0x8B02  /* set network id (the cell) */
 #define SIOCGIWNWID0x8B03  /* get network id */
-#define SIOCSIWFREQ0x8B04  /* set channel/frequency */
-#define SIOCGIWFREQ0x8B05  /* get channel/frequency */
+#define SIOCSIWFREQ0x8B04  /* set channel/frequency (Hz) */
+#define SIOCGIWFREQ0x8B05  /* get channel/frequency (Hz) */
 #define SIOCSIWMODE0x8B06  /* set operation mode */
 #define SIOCGIWMODE0x8B07  /* get operation mode */
-#define SIOCSIWSENS0x8B08  /* set sensitivity */
-#define SIOCGIWSENS0x8B09  /* get sensitivity */
+#define SIOCSIWSENS0x8B08  /* set sensitivity (dBm) */
+#define SIOCGIWSENS0x8B09  /* get sensitivity (dBm) */
 
 /* Informative stuff */
-#define SIOCSIWRANGE   0x8B0A  /* Unused ??? */
+#define SIOCSIWRANGE   0x8B0A  /* Unused */
 #define SIOCGIWRANGE   0x8B0B  /* Get range of parameters */
-#define SIOCSIWPRIV0x8B0C  /* Unused ??? */
+#define SIOCSIWPRIV0x8B0C  /* Unused */
 #define SIOCGIWPRIV0x8B0D  /* get private ioctl interface info */
 
 /* Mobile IP support */
@@ -153,6 +160,8 @@
 #define SIOCGIWRTS 0x8B23  /* get RTS/CTS threshold (bytes) */
 #define SIOCSIWFRAG0x8B24  /* set fragmentation thr (bytes) */
 #define SIOCGIWFRAG0x8B25  /* get fragmentation thr (bytes) */
+#define SIOCSIWTXPOW   0x8B26  /* set transmit power (dBm) */
+#define SIOCGIWTXPOW   0x8B27  /* get transmit power (dBm) */
 
 /* Encoding stuff (scrambling, hardware security, WEP...) */
 #define SIOCSIWENCODE  0x8B2A  /* set encoding token  mode */
@@ -205,6 +214,9 @@
 /* Maximum bit rates in the range struct */
 #define IW_MAX_BITRATES8
 
+/* Maximum tx powers in the range struct */
+#define IW_MAX_TXPOWER 8
+
 /* Maximum of address that you may set with SPY */
 #define IW_MAX_SPY 8
 
@@ -232,11 +244,13 @@
 
 /* Flags for encoding (along with the token) */
 #define IW_ENCODE_INDEX0x00FF  /* Token index (if needed) */
-#define IW_ENCODE_FLAGS0xF000  /* Flags defined below */
+#define IW_ENCODE_FLAGS0xFF00  /* Flags defined below */
+#define IW_ENCODE_MODE 0xF000  /* Modes defined below */
 #define IW_ENCODE_DISABLED 0x8000  /* Encoding disabled */
 #define IW_ENCODE_ENABLED  0x  /* Encoding enabled */
 #define IW_ENCODE_RESTRICTED   0x4000  /* Refuse non-encoded packets */
 #define IW_ENCODE_OPEN 0x2000  /* Accept non-encoded packets */
+#define IW_ENCODE_NOKEY 0x0800  /* Key is write only, so not present */
 
 /* Power management flags available (along with the value, if any) */
 #define IW_POWER_ON0x  /*