Commit d86b5e0e authored by Adrian Bunk's avatar Adrian Bunk Committed by John W. Linville

[PATCH] net/: fix the WIRELESS_EXT abuse

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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 747af1e1
...@@ -6,7 +6,8 @@ menu "Wireless LAN (non-hamradio)" ...@@ -6,7 +6,8 @@ menu "Wireless LAN (non-hamradio)"
depends on NETDEVICES depends on NETDEVICES
config NET_RADIO config NET_RADIO
bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions" bool "Wireless LAN drivers (non-hamradio)"
select WIRELESS_EXT
---help--- ---help---
Support for wireless LANs and everything having to do with radio, Support for wireless LANs and everything having to do with radio,
but not with amateur radio or FM broadcasting. but not with amateur radio or FM broadcasting.
......
...@@ -55,10 +55,8 @@ ...@@ -55,10 +55,8 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#ifdef CONFIG_NET_RADIO
#include <linux/wireless.h> #include <linux/wireless.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#endif
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/cs.h> #include <pcmcia/cs.h>
......
...@@ -98,11 +98,7 @@ ...@@ -98,11 +98,7 @@
* characteristics of the hardware. Applications such as mobile IP may * characteristics of the hardware. Applications such as mobile IP may
* take advantage of it. * take advantage of it.
* *
* You will need to enable the CONFIG_NET_RADIO define in the kernel * It might be a good idea as well to fetch the wireless tools to
* 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
* configure the device and play a bit. * configure the device and play a bit.
*/ */
......
...@@ -99,11 +99,7 @@ ...@@ -99,11 +99,7 @@
* caracteristics of the hardware in a standard way and support for * caracteristics of the hardware in a standard way and support for
* applications for taking advantage of it (like Mobile IP). * applications for taking advantage of it (like Mobile IP).
* *
* You will need to enable the CONFIG_NET_RADIO define in the kernel * It might be a good idea as well to fetch the wireless tools to
* 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
* configure the device and play a bit. * configure the device and play a bit.
*/ */
...@@ -440,11 +436,8 @@ ...@@ -440,11 +436,8 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#ifdef CONFIG_NET_RADIO
#include <linux/wireless.h> /* Wireless extensions */ #include <linux/wireless.h> /* Wireless extensions */
#include <net/iw_handler.h> /* New driver API */ #include <net/iw_handler.h> /* New driver API */
#endif
/* Pcmcia headers that we need */ /* Pcmcia headers that we need */
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
......
...@@ -217,6 +217,9 @@ source "net/irda/Kconfig" ...@@ -217,6 +217,9 @@ source "net/irda/Kconfig"
source "net/bluetooth/Kconfig" source "net/bluetooth/Kconfig"
source "net/ieee80211/Kconfig" source "net/ieee80211/Kconfig"
config WIRELESS_EXT
bool
endif # if NET endif # if NET
endmenu # Networking endmenu # Networking
...@@ -14,5 +14,5 @@ obj-$(CONFIG_XFRM) += flow.o ...@@ -14,5 +14,5 @@ obj-$(CONFIG_XFRM) += flow.o
obj-$(CONFIG_SYSFS) += net-sysfs.o obj-$(CONFIG_SYSFS) += net-sysfs.o
obj-$(CONFIG_NET_DIVERT) += dv.o obj-$(CONFIG_NET_DIVERT) += dv.o
obj-$(CONFIG_NET_PKTGEN) += pktgen.o obj-$(CONFIG_NET_PKTGEN) += pktgen.o
obj-$(CONFIG_NET_RADIO) += wireless.o obj-$(CONFIG_WIRELESS_EXT) += wireless.o
obj-$(CONFIG_NETPOLL) += netpoll.o obj-$(CONFIG_NETPOLL) += netpoll.o
...@@ -110,10 +110,8 @@ ...@@ -110,10 +110,8 @@
#include <linux/netpoll.h> #include <linux/netpoll.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/delay.h> #include <linux/delay.h>
#ifdef CONFIG_NET_RADIO #include <linux/wireless.h>
#include <linux/wireless.h> /* Note : will define WIRELESS_EXT */
#include <net/iw_handler.h> #include <net/iw_handler.h>
#endif /* CONFIG_NET_RADIO */
#include <asm/current.h> #include <asm/current.h>
/* /*
...@@ -2028,7 +2026,7 @@ static struct file_operations softnet_seq_fops = { ...@@ -2028,7 +2026,7 @@ static struct file_operations softnet_seq_fops = {
.release = seq_release, .release = seq_release,
}; };
#ifdef WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
extern int wireless_proc_init(void); extern int wireless_proc_init(void);
#else #else
#define wireless_proc_init() 0 #define wireless_proc_init() 0
...@@ -2581,7 +2579,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg) ...@@ -2581,7 +2579,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
ret = -EFAULT; ret = -EFAULT;
return ret; return ret;
} }
#ifdef WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
/* Take care of Wireless Extensions */ /* Take care of Wireless Extensions */
if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
/* If command is `set a parameter', or /* If command is `set a parameter', or
...@@ -2602,7 +2600,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg) ...@@ -2602,7 +2600,7 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
ret = -EFAULT; ret = -EFAULT;
return ret; return ret;
} }
#endif /* WIRELESS_EXT */ #endif /* CONFIG_WIRELESS_EXT */
return -EINVAL; return -EINVAL;
} }
} }
......
...@@ -369,8 +369,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -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 /* Put this code here so that we avoid duplicating it in all
* Rx paths. - Jean II */ * Rx paths. - Jean II */
#ifdef CONFIG_WIRELESS_EXT
#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
#ifdef CONFIG_NET_RADIO
/* If spy monitoring on */ /* If spy monitoring on */
if (ieee->spy_data.spy_number > 0) { if (ieee->spy_data.spy_number > 0) {
struct iw_quality wstats; struct iw_quality wstats;
...@@ -397,8 +397,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -397,8 +397,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
/* Update spy records */ /* Update spy records */
wireless_spy_update(ieee->dev, hdr->addr2, &wstats); wireless_spy_update(ieee->dev, hdr->addr2, &wstats);
} }
#endif /* CONFIG_NET_RADIO */
#endif /* IW_WIRELESS_SPY */ #endif /* IW_WIRELESS_SPY */
#endif /* CONFIG_WIRELESS_EXT */
#ifdef NOT_YET #ifdef NOT_YET
hostap_update_rx_stats(local->ap, hdr, rx_stats); hostap_update_rx_stats(local->ap, hdr, rx_stats);
......
...@@ -84,10 +84,7 @@ ...@@ -84,10 +84,7 @@
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/audit.h> #include <linux/audit.h>
#include <linux/wireless.h>
#ifdef CONFIG_NET_RADIO
#include <linux/wireless.h> /* Note : will define WIRELESS_EXT */
#endif /* CONFIG_NET_RADIO */
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unistd.h> #include <asm/unistd.h>
...@@ -840,11 +837,11 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg) ...@@ -840,11 +837,11 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
err = dev_ioctl(cmd, argp); err = dev_ioctl(cmd, argp);
} else } else
#ifdef WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) {
err = dev_ioctl(cmd, argp); err = dev_ioctl(cmd, argp);
} else } else
#endif /* WIRELESS_EXT */ #endif /* CONFIG_WIRELESS_EXT */
switch (cmd) { switch (cmd) {
case FIOSETOWN: case FIOSETOWN:
case SIOCSPGRP: case SIOCSPGRP:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment