[PATCH] net/: fix the WIRELESS_EXT abuse
authorAdrian Bunk <bunk@stusta.de>
Fri, 20 Jan 2006 23:46:55 +0000 (00:46 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 31 Jan 2006 01:35:30 +0000 (20:35 -0500)
This patch contains the following changes:
- add a CONFIG_WIRELESS_EXT select'ed by NET_RADIO for conditional
  code
- remove the now no longer required #ifdef CONFIG_NET_RADIO from some
  #include's

Based on a patch by Jean Tourrilhes <jt@hpl.hp.com>.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/Kconfig
drivers/net/wireless/netwave_cs.c
drivers/net/wireless/wavelan.p.h
drivers/net/wireless/wavelan_cs.p.h
net/Kconfig
net/core/Makefile
net/core/dev.c
net/ieee80211/ieee80211_rx.c
net/socket.c

index 233a4f608084d4542e4cf671588598d2c3ce9503..9ccfec50f7333f15ed490c54f0a551e85b602523 100644 (file)
@@ -6,7 +6,8 @@ menu "Wireless LAN (non-hamradio)"
        depends on NETDEVICES
 
 config NET_RADIO
-       bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions"
+       bool "Wireless LAN drivers (non-hamradio)"
+       select WIRELESS_EXT
        ---help---
          Support for wireless LANs and everything having to do with radio,
          but not with amateur radio or FM broadcasting.
index bf6271ee387a9aca16cb8eed6e664bca9714e411..75ce6ddb0cf5faa182a0bae3a45b64c7f5862579 100644 (file)
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/bitops.h>
-#ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>
 #include <net/iw_handler.h>
-#endif
 
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
index 166e28b9a4f7fca1464b5b500cd1759a0b2a6e34..5cb0bc8bb1289ed3d8a2aaaa15de4d0fc5f5f703 100644 (file)
  * characteristics of the hardware.  Applications such as mobile IP may
  * take advantage of it.
  *
- * You will need to enable the CONFIG_NET_RADIO define in the kernel
- * configuration to enable the wireless extensions (this is the one
- * giving access to the radio network device choice).
- *
- * It might also be a good idea as well to fetch the wireless tools to
+ * It might be a good idea as well to fetch the wireless tools to
  * configure the device and play a bit.
  */
 
index f2d59756815180bfcf661d7d801f04c5453021ef..451f6271dcbcfc35310ffc35cb35b1b6da605b74 100644 (file)
  * caracteristics of the hardware in a standard way and support for
  * applications for taking advantage of it (like Mobile IP).
  *
- * You will need to enable the CONFIG_NET_RADIO define in the kernel
- * configuration to enable the wireless extensions (this is the one
- * giving access to the radio network device choice).
- *
- * It might also be a good idea as well to fetch the wireless tools to
+ * It might be a good idea as well to fetch the wireless tools to
  * configure the device and play a bit.
  */
 
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/ethtool.h>
-
-#ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>            /* Wireless extensions */
 #include <net/iw_handler.h>            /* New driver API */
-#endif
 
 /* Pcmcia headers that we need */
 #include <pcmcia/cs_types.h>
index bc603d9aea56c1a798ae6c763e813365e4f689ea..d6216888c3aea3950b670baabb941cfa094b4016 100644 (file)
@@ -217,6 +217,9 @@ source "net/irda/Kconfig"
 source "net/bluetooth/Kconfig"
 source "net/ieee80211/Kconfig"
 
+config WIRELESS_EXT
+       bool
+
 endif   # if NET
 endmenu # Networking
 
index 630da0f0579e5c3bf26cc5391ee49f7551f00882..79fe12cced278b0b0b57b2c4041b6ff21936b52b 100644 (file)
@@ -14,5 +14,5 @@ obj-$(CONFIG_XFRM) += flow.o
 obj-$(CONFIG_SYSFS) += net-sysfs.o
 obj-$(CONFIG_NET_DIVERT) += dv.o
 obj-$(CONFIG_NET_PKTGEN) += pktgen.o
-obj-$(CONFIG_NET_RADIO) += wireless.o
+obj-$(CONFIG_WIRELESS_EXT) += wireless.o
 obj-$(CONFIG_NETPOLL) += netpoll.o
index fd070a098f20656027dca9c38a3b7a43a0ad1082..41ac7a8ddb0afdf7cb87eca9c1037922535d3b86 100644 (file)
 #include <linux/netpoll.h>
 #include <linux/rcupdate.h>
 #include <linux/delay.h>
-#ifdef CONFIG_NET_RADIO
-#include <linux/wireless.h>            /* Note : will define WIRELESS_EXT */
+#include <linux/wireless.h>
 #include <net/iw_handler.h>
-#endif /* CONFIG_NET_RADIO */
 #include <asm/current.h>
 
 /*
@@ -2028,7 +2026,7 @@ static struct file_operations softnet_seq_fops = {
        .release = seq_release,
 };
 
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
 extern int wireless_proc_init(void);
 #else
 #define wireless_proc_init() 0
@@ -2581,7 +2579,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
                                        ret = -EFAULT;
                                return ret;
                        }
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
                        /* Take care of Wireless Extensions */
                        if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
                                /* If command is `set a parameter', or
@@ -2602,7 +2600,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
                                        ret = -EFAULT;
                                return ret;
                        }
-#endif /* WIRELESS_EXT */
+#endif /* CONFIG_WIRELESS_EXT */
                        return -EINVAL;
        }
 }
index 6c070bc155e78c8ac567813b27a58fcf5e1b34c9..e2f1553ecb7c22b59676d10e92e3f681ad78147e 100644 (file)
@@ -369,8 +369,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
        /* Put this code here so that we avoid duplicating it in all
         * Rx paths. - Jean II */
+#ifdef CONFIG_WIRELESS_EXT
 #ifdef IW_WIRELESS_SPY         /* defined in iw_handler.h */
-#ifdef CONFIG_NET_RADIO
        /* If spy monitoring on */
        if (ieee->spy_data.spy_number > 0) {
                struct iw_quality wstats;
@@ -397,8 +397,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                /* Update spy records */
                wireless_spy_update(ieee->dev, hdr->addr2, &wstats);
        }
-#endif                         /* CONFIG_NET_RADIO */
 #endif                         /* IW_WIRELESS_SPY */
+#endif                         /* CONFIG_WIRELESS_EXT */
 
 #ifdef NOT_YET
        hostap_update_rx_stats(local->ap, hdr, rx_stats);
index b38a263853c32038b07fe7dcb9dae457d4456722..8aa5f1188e9ba1eaae67835283933dced8fc6f20 100644 (file)
 #include <linux/compat.h>
 #include <linux/kmod.h>
 #include <linux/audit.h>
-
-#ifdef CONFIG_NET_RADIO
-#include <linux/wireless.h>            /* Note : will define WIRELESS_EXT */
-#endif /* CONFIG_NET_RADIO */
+#include <linux/wireless.h>
 
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -840,11 +837,11 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
        if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
                err = dev_ioctl(cmd, argp);
        } else
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
        if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
                err = dev_ioctl(cmd, argp);
        } else
-#endif /* WIRELESS_EXT */
+#endif /* CONFIG_WIRELESS_EXT */
        switch (cmd) {
                case FIOSETOWN:
                case SIOCSPGRP: