Skip to contentSkip to conversation

Wireless Extension update...

PATCH Jean Tourrilhes 1 participant 1 message Mar 29, 2001 Network drivers

lore
Share & tools
lore
#0 lore raw
	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...

include/linux/wireless.h renamed from include/linux/wireless.25.h +33 -2
diff -u -p linux/include/linux/wireless.25.h linux/include/linux/wireless.h
@@ -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 SIOCGIWFRAG	0x8B25		/* 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		0x0000	/* Value is in dBm */
 #define IW_TXPOW_MWATT		0x0001	/* Value is in mW */
 
+/* Retry limits and lifetime flags available */
+#define IW_RETRY_ON		0x0000	/* 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 */
 	__u8		num_txpower;	/* Number of entries in the list */
 	__s32		txpower[IW_MAX_TXPOWER];	/* list, in bps */
+
+	/* Wireless Extension version info */
+	__u8		we_version_compiled;	/* Must be WIRELESS_EXT */
+	__u8		we_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 */
 };
 
 /*
drivers/net/wavelan.c renamed from drivers/net/wireless.25/wavelan.c +10 -1
diff -u -p linux/drivers/net/wireless.25/wavelan.c linux/drivers/net/wavelan.c
@@ -2028,8 +2028,17 @@ static int wavelan_ioctl(struct net_devi
 		if (wrq->u.data.pointer != (caddr_t) 0) {
 			struct iw_range range;
 
-			/* Set the length (useless:  it's constant). */
+			/* Set the length (very important for backward
+			 * compatibility) */
 			wrq->u.data.length = sizeof(struct iw_range);
+
+			/* Set all the info we don't care or don't know
+			 * about to zero */
+			memset(&range, 0, sizeof(range));
+
+			/* Set the Wireless Extension versions */
+			range.we_version_compiled = WIRELESS_EXT;
+			range.we_version_source = 9;
 
 			/* Set information in the range struct.  */
 			range.throughput = 1.6 * 1000 * 1000;	/* don't argue on this ! */
drivers/net/pcmcia/wavelan_cs.c renamed from drivers/net/pcmcia/wireless.25/wavelan_cs.c +8 -1
diff -u -p linux/drivers/net/pcmcia/wireless.25/wavelan_cs.c linux/drivers/net/pcmcia/wavelan_cs.c
@@ -2233,8 +2233,15 @@ wavelan_ioctl(struct net_device *	dev,	/
 	{
 	  struct iw_range	range;
 
-	  /* Set the length (useless : its constant...) */
+	  /* Set the length (very important for backward compatibility) */
 	  wrq->u.data.length = sizeof(struct iw_range);
+
+	  /* Set all the info we don't care or don't know about to zero */
+	  memset(&range, 0, sizeof(range));
+
+	  /* Set the Wireless Extension versions */
+	  range.we_version_compiled = WIRELESS_EXT;
+	  range.we_version_source = 9;	/* Nothing for us in v10 and v11 */
 
 	  /* Set information in the range struct */
 	  range.throughput = 1.4 * 1000 * 1000;	/* don't argue on this ! */
drivers/net/pcmcia/netwave_cs.c renamed from drivers/net/pcmcia/wireless.25/netwave_cs.c +10 -1
diff -u -p linux/drivers/net/pcmcia/wireless.25/netwave_cs.c linux/drivers/net/pcmcia/netwave_cs.c
@@ -710,8 +710,17 @@ static int netwave_ioctl(struct net_devi
        if(wrq->u.data.pointer != (caddr_t) 0) {
 	   struct iw_range	range;
 		   
-	   /* Set the length (useless : its constant...) */
+	   /* Set the length (very important for backward compatibility) */
 	   wrq->u.data.length = sizeof(struct iw_range);
+
+	   /* Set all the info we don't care or don't know about to zero */
+	   memset(&range, 0, sizeof(range));
+
+#if WIRELESS_EXT > 10
+	   /* Set the Wireless Extension versions */
+	   range.we_version_compiled = WIRELESS_EXT;
+	   range.we_version_source = 9;	/* Nothing for us in v10 and v11 */
+#endif /* WIRELESS_EXT > 10 */
 		   
 	   /* Set information in the range struct */
 	   range.throughput = 450 * 1000;	/* don't argue on this ! */
drivers/net/pcmcia/ray_cs.c renamed from drivers/net/pcmcia/wireless.25/ray_cs.c +7 -1
diff -u -p linux/drivers/net/pcmcia/wireless.25/ray_cs.c linux/drivers/net/pcmcia/ray_cs.c
@@ -1332,8 +1332,14 @@ static int ray_dev_ioctl(struct net_devi
 	  struct iw_range	range;
 	  memset((char *) &range, 0, sizeof(struct iw_range));
 
-	  /* Set the length (useless : its constant...) */
+	  /* Set the length (very important for backward compatibility) */
 	  wrq->u.data.length = sizeof(struct iw_range);
+
+#if WIRELESS_EXT > 10
+	  /* Set the Wireless Extension versions */
+	  range.we_version_compiled = WIRELESS_EXT;
+	  range.we_version_source = 9;
+#endif /* WIRELESS_EXT > 10 */
 
 	  /* Set information in the range struct */
 	  range.throughput = 1.1 * 1000 * 1000;	/* Put the right number here */
drivers/net/pcmcia/hermes.h renamed from drivers/net/pcmcia/wireless.25/hermes.h +3 -0
diff -u -p linux/drivers/net/pcmcia/wireless.25/hermes.h linux/drivers/net/pcmcia/hermes.h
@@ -196,6 +196,9 @@
 #define		HERMES_RID_CURRENT_BSSID	((uint16_t)0xfd42)
 #define		HERMES_RID_COMMSQUALITY		((uint16_t)0xfd43)
 #define 	HERMES_RID_CURRENT_TX_RATE	((uint16_t)0xfd44)
+#define 	HERMES_RID_SHORT_RETRY_LIMIT	((uint16_t)0xfd48)
+#define 	HERMES_RID_LONG_RETRY_LIMIT	((uint16_t)0xfd49)
+#define 	HERMES_RID_MAX_TX_LIFETIME	((uint16_t)0xfd4A)
 #define		HERMES_RID_WEP_AVAIL		((uint16_t)0xfd4f)
 #define		HERMES_RID_CURRENT_CHANNEL	((uint16_t)0xfdc1)
 #define		HERMES_RID_DATARATES		((uint16_t)0xfdc6)
drivers/net/pcmcia/orinoco_cs.c renamed from drivers/net/pcmcia/wireless.25/orinoco_cs.c +156 -0

240 lines not on this page · raw message