Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Adrian Bunk <bunk@stusta.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Adrian Bunk and committed by
John W. Linville
d86b5e0e 747af1e1

+17 -31
+2 -1
drivers/net/wireless/Kconfig
··· 6 6 depends on NETDEVICES 7 7 8 8 config NET_RADIO 9 - bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions" 9 + bool "Wireless LAN drivers (non-hamradio)" 10 + select WIRELESS_EXT 10 11 ---help--- 11 12 Support for wireless LANs and everything having to do with radio, 12 13 but not with amateur radio or FM broadcasting.
-2
drivers/net/wireless/netwave_cs.c
··· 55 55 #include <linux/etherdevice.h> 56 56 #include <linux/skbuff.h> 57 57 #include <linux/bitops.h> 58 - #ifdef CONFIG_NET_RADIO 59 58 #include <linux/wireless.h> 60 59 #include <net/iw_handler.h> 61 - #endif 62 60 63 61 #include <pcmcia/cs_types.h> 64 62 #include <pcmcia/cs.h>
+1 -5
drivers/net/wireless/wavelan.p.h
··· 98 98 * characteristics of the hardware. Applications such as mobile IP may 99 99 * take advantage of it. 100 100 * 101 - * You will need to enable the CONFIG_NET_RADIO define in the kernel 102 - * configuration to enable the wireless extensions (this is the one 103 - * giving access to the radio network device choice). 104 - * 105 - * It might also be a good idea as well to fetch the wireless tools to 101 + * It might be a good idea as well to fetch the wireless tools to 106 102 * configure the device and play a bit. 107 103 */ 108 104
+1 -8
drivers/net/wireless/wavelan_cs.p.h
··· 99 99 * caracteristics of the hardware in a standard way and support for 100 100 * applications for taking advantage of it (like Mobile IP). 101 101 * 102 - * You will need to enable the CONFIG_NET_RADIO define in the kernel 103 - * configuration to enable the wireless extensions (this is the one 104 - * giving access to the radio network device choice). 105 - * 106 - * It might also be a good idea as well to fetch the wireless tools to 102 + * It might be a good idea as well to fetch the wireless tools to 107 103 * configure the device and play a bit. 108 104 */ 109 105 ··· 436 440 #include <linux/ioport.h> 437 441 #include <linux/fcntl.h> 438 442 #include <linux/ethtool.h> 439 - 440 - #ifdef CONFIG_NET_RADIO 441 443 #include <linux/wireless.h> /* Wireless extensions */ 442 444 #include <net/iw_handler.h> /* New driver API */ 443 - #endif 444 445 445 446 /* Pcmcia headers that we need */ 446 447 #include <pcmcia/cs_types.h>
+3
net/Kconfig
··· 217 217 source "net/bluetooth/Kconfig" 218 218 source "net/ieee80211/Kconfig" 219 219 220 + config WIRELESS_EXT 221 + bool 222 + 220 223 endif # if NET 221 224 endmenu # Networking 222 225
+1 -1
net/core/Makefile
··· 14 14 obj-$(CONFIG_SYSFS) += net-sysfs.o 15 15 obj-$(CONFIG_NET_DIVERT) += dv.o 16 16 obj-$(CONFIG_NET_PKTGEN) += pktgen.o 17 - obj-$(CONFIG_NET_RADIO) += wireless.o 17 + obj-$(CONFIG_WIRELESS_EXT) += wireless.o 18 18 obj-$(CONFIG_NETPOLL) += netpoll.o
+4 -6
net/core/dev.c
··· 110 110 #include <linux/netpoll.h> 111 111 #include <linux/rcupdate.h> 112 112 #include <linux/delay.h> 113 - #ifdef CONFIG_NET_RADIO 114 - #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ 113 + #include <linux/wireless.h> 115 114 #include <net/iw_handler.h> 116 - #endif /* CONFIG_NET_RADIO */ 117 115 #include <asm/current.h> 118 116 119 117 /* ··· 2026 2028 .release = seq_release, 2027 2029 }; 2028 2030 2029 - #ifdef WIRELESS_EXT 2031 + #ifdef CONFIG_WIRELESS_EXT 2030 2032 extern int wireless_proc_init(void); 2031 2033 #else 2032 2034 #define wireless_proc_init() 0 ··· 2579 2581 ret = -EFAULT; 2580 2582 return ret; 2581 2583 } 2582 - #ifdef WIRELESS_EXT 2584 + #ifdef CONFIG_WIRELESS_EXT 2583 2585 /* Take care of Wireless Extensions */ 2584 2586 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { 2585 2587 /* If command is `set a parameter', or ··· 2600 2602 ret = -EFAULT; 2601 2603 return ret; 2602 2604 } 2603 - #endif /* WIRELESS_EXT */ 2605 + #endif /* CONFIG_WIRELESS_EXT */ 2604 2606 return -EINVAL; 2605 2607 } 2606 2608 }
+2 -2
net/ieee80211/ieee80211_rx.c
··· 369 369 370 370 /* Put this code here so that we avoid duplicating it in all 371 371 * Rx paths. - Jean II */ 372 + #ifdef CONFIG_WIRELESS_EXT 372 373 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ 373 - #ifdef CONFIG_NET_RADIO 374 374 /* If spy monitoring on */ 375 375 if (ieee->spy_data.spy_number > 0) { 376 376 struct iw_quality wstats; ··· 397 397 /* Update spy records */ 398 398 wireless_spy_update(ieee->dev, hdr->addr2, &wstats); 399 399 } 400 - #endif /* CONFIG_NET_RADIO */ 401 400 #endif /* IW_WIRELESS_SPY */ 401 + #endif /* CONFIG_WIRELESS_EXT */ 402 402 403 403 #ifdef NOT_YET 404 404 hostap_update_rx_stats(local->ap, hdr, rx_stats);
+3 -6
net/socket.c
··· 84 84 #include <linux/compat.h> 85 85 #include <linux/kmod.h> 86 86 #include <linux/audit.h> 87 - 88 - #ifdef CONFIG_NET_RADIO 89 - #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ 90 - #endif /* CONFIG_NET_RADIO */ 87 + #include <linux/wireless.h> 91 88 92 89 #include <asm/uaccess.h> 93 90 #include <asm/unistd.h> ··· 837 840 if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { 838 841 err = dev_ioctl(cmd, argp); 839 842 } else 840 - #ifdef WIRELESS_EXT 843 + #ifdef CONFIG_WIRELESS_EXT 841 844 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) { 842 845 err = dev_ioctl(cmd, argp); 843 846 } else 844 - #endif /* WIRELESS_EXT */ 847 + #endif /* CONFIG_WIRELESS_EXT */ 845 848 switch (cmd) { 846 849 case FIOSETOWN: 847 850 case SIOCSPGRP: