wext: refactor
Johannes Berg
maintainerPATCH 1/1 wext: refactor
Refactor wext to
* split out iwpriv handling
* split out iwspy handling
* split out procfs support
* allow cfg80211 to have wireless extensions compat code w/o CONFIG_WIRELESS_EXT
After this, drivers need to
- select WIRELESS_EXT - for wext support
- select WEXT_PRIV - for iwpriv support
- select WEXT_SPY - for iwspy support
except cfg80211 -- which gets new hooks in wext-core.c and can then get wext handlers without CONFIG_WIRELESS_EXT.
Wireless extensions procfs support is auto-selected based on PROC_FS and anything that requires the wext core (i.e. WIRELESS_EXT or CFG80211_WEXT).
---
No comments received, so I guess it's good to go. Not for 2.6.32, of course. Now all out-of-tree wext drivers need to build the kernel with a wext driver enabled to get wext <insert manic laugh here>
drivers/net/wireless/Kconfig | 29 drivers/net/wireless/hostap/Kconfig | 2 drivers/net/wireless/ipw2x00/Kconfig | 5 drivers/net/wireless/orinoco/Kconfig | 2 include/net/cfg80211.h | 6 include/net/iw_handler.h | 14 include/net/net_namespace.h | 2 include/net/wext.h | 49 net/core/net-sysfs.c | 6 net/socket.c | 4 net/wireless/Kconfig | 50 net/wireless/Makefile | 8 net/wireless/core.c | 12 net/wireless/ibss.c | 10 net/wireless/mlme.c | 2 net/wireless/nl80211.c | 4 net/wireless/scan.c | 6 net/wireless/sme.c | 12 net/wireless/wext-core.c | 1063 ++++++++++++++++++++ net/wireless/wext-priv.c | 248 ++++ net/wireless/wext-proc.c | 155 +++ net/wireless/wext-spy.c | 231 ++++ net/wireless/wext.c | 1775 ----------------------------------- 23 files changed, 1849 insertions(+), 1846 deletions(-)
net/wireless/Kconfig +35 -15
@@ -1,3 +1,21 @@ +config WIRELESS_EXT + bool + +config WEXT_CORE + def_bool y + depends on CFG80211_WEXT || WIRELESS_EXT + +config WEXT_PROC + def_bool y + depends on PROC_FS + depends on WEXT_CORE + +config WEXT_SPY + bool + +config WEXT_PRIV + bool + config CFG80211 tristate "cfg80211 - wireless configuration API" depends on RFKILL || !RFKILL
@@ -56,6 +74,12 @@ config CFG80211_REG_DEBUG If unsure, say N. +config CFG80211_DEFAULT_PS_VALUE + int + default 1 if CFG80211_DEFAULT_PS + default 0 + depends on CFG80211 + config CFG80211_DEFAULT_PS bool "enable powersave by default" depends on CFG80211
@@ -67,14 +91,10 @@ config CFG80211_DEFAULT_PS applications instead -- they need to register their network latency requirement, see Documentation/power/pm_qos_interface.txt. -config CFG80211_DEFAULT_PS_VALUE - int - default 1 if CFG80211_DEFAULT_PS - default 0 - config CFG80211_DEBUGFS bool "cfg80211 DebugFS entries" - depends on CFG80211 && DEBUG_FS + depends on CFG80211 + depends on DEBUG_FS ---help--- You can enable this if you want to debugfs entries for cfg80211.
@@ -83,6 +103,7 @@ config CFG80211_DEBUGFS config WIRELESS_OLD_REGULATORY bool "Old wireless static regulatory definitions" default n + depends on CFG80211 ---help--- This option enables the old static regulatory information and uses it within the new framework. This option is available
@@ -94,20 +115,19 @@ config WIRELESS_OLD_REGULATORY Say N and if you say Y, please tell us why. The default is N. -config WIRELESS_EXT - bool "Wireless extensions" +config CFG80211_WEXT + bool "cfg80211 wireless extensions compatibility" + depends on CFG80211 + select WEXT_CORE default y - ---help--- - This option enables the legacy wireless extensions - (wireless network interface configuration via ioctls.) - - Say Y unless you've upgraded all your userspace to use - nl80211 instead of wireless extensions. + help + Enable this option if you need old userspace for wireless + extensions with cfg80211-based drivers. config WIRELESS_EXT_SYSFS bool "Wireless extensions sysfs files" default y - depends on WIRELESS_EXT && SYSFS + depends on WEXT_CORE && SYSFS help This option enables the deprecated wireless statistics files in /sys/class/net/*/wireless/. The same information
include/net/net_namespace.h +1 -1
@@ -80,7 +80,7 @@ struct net {#ifdef CONFIG_XFRM struct netns_xfrm xfrm;#endif -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_WEXT_CORE struct sk_buff_head wext_nlevents;#endif struct net_generic *gen;
include/net/cfg80211.h +5 -1
@@ -1171,6 +1171,10 @@ struct wiphy {struct net *_net;#endif +#ifdef CONFIG_CFG80211_WEXT +const struct iw_handler_def *wext; +#endif + char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); };
@@ -1345,7 +1349,7 @@ struct wireless_dev {struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES ];struct cfg80211_internal_bss *current_bss;/* associated / joined */ -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT /* wext data */ struct { struct cfg80211_ibss_params ibss;
net/wireless/Makefile +6 -2
@@ -1,13 +1,17 @@ -obj-$(CONFIG_WIRELESS_EXT) += wext.o obj-$(CONFIG_CFG80211) += cfg80211.o obj-$(CONFIG_LIB80211) += lib80211.o obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib80211_crypt_wep.o obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o +obj-$(CONFIG_WEXT_CORE) += wext-core.o +obj-$(CONFIG_WEXT_PROC) += wext-proc.o +obj-$(CONFIG_WEXT_SPY) += wext-spy.o +obj-$(CONFIG_WEXT_PRIV) += wext-priv.o + cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o cfg80211-y += mlme.o ibss.o sme.o chan.o cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o -cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o wext-sme.o +cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o ccflags-y += -D__CHECK_ENDIAN__
net/wireless/core.c +7 -5
@@ -358,6 +358,10 @@ struct wiphy *wiphy_new(const struct cfgINIT_LIST_HEAD (&rdev->bss_list);INIT_WORK (&rdev->scan_done_wk, __cfg80211_scan_done); +#ifdef CONFIG_CFG80211_WEXT + rdev->wiphy.wext = &cfg80211_wext_handler; +#endif +device_initialize (&rdev->wiphy.dev); rdev->wiphy.dev.class = &ieee80211_class; rdev->wiphy.dev.platform_data = rdev;
@@ -666,8 +670,6 @@ static int cfg80211_netdev_notifier_call wdev->sme_state =CFG80211_SME_IDLE ;mutex_unlock (&rdev->devlist_mtx);#ifdef CONFIG_WIRELESS_EXT -if (!dev->wireless_handlers) - dev->wireless_handlers = &cfg80211_wext_handler; wdev->wext.default_key =-1 ; wdev->wext.default_mgmt_key =-1 ; wdev->wext.connect.auth_type =NL80211_AUTHTYPE_AUTOMATIC ;
@@ -689,7 +691,7 @@ static int cfg80211_netdev_notifier_callbreak ;case NL80211_IFTYPE_STATION :wdev_lock (wdev); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT kfree (wdev->wext.ie); wdev->wext.ie =NULL ; wdev->wext.ie_len =0 ;
@@ -721,7 +723,7 @@ static int cfg80211_netdev_notifier_callmutex_unlock (&rdev->devlist_mtx);dev_put (dev); } -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT cfg80211_lock_rdev (rdev);mutex_lock (&rdev->devlist_mtx);wdev_lock (wdev);
@@ -759,7 +761,7 @@ static int cfg80211_netdev_notifier_callsysfs_remove_link (&dev->dev.kobj,"phy80211" );list_del_init (&wdev->list); rdev->devlist_generation++; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT kfree (wdev->wext.keys);#endif }
net/wireless/ibss.c +5 -5
@@ -15,7 +15,7 @@ void __cfg80211_ibss_joined(struct net_d {struct wireless_dev *wdev = dev->ieee80211_ptr;struct cfg80211_bss *bss; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;#endif
@@ -44,7 +44,7 @@ void __cfg80211_ibss_joined(struct net_dnl80211_send_ibss_bssid (wiphy_to_dev (wdev->wiphy), dev, bssid,GFP_KERNEL ); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT memset (&wrqu,0 ,sizeof (wrqu));memcpy (wrqu.ap_addr.sa_data, bssid,ETH_ALEN );wireless_send_event (dev,SIOCGIWAP , &wrqu,NULL );
@@ -96,7 +96,7 @@ int __cfg80211_join_ibss(struct cfg80211kfree (wdev->connect_keys); wdev->connect_keys = connkeys; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT wdev->wext.ibss.channel = params->channel;#endif err = rdev->ops->join_ibss (&rdev->wiphy, dev, params);
@@ -154,7 +154,7 @@ static void __cfg80211_clear_ibss(struct wdev->current_bss =NULL ; wdev->ssid_len =0 ; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (!nowext) wdev->wext.ibss.ssid_len =0 ;#endif
@@ -203,7 +203,7 @@ int cfg80211_leave_ibss(struct cfg80211_return err; } -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT int cfg80211_ibss_wext_join (struct cfg80211_registered_device *rdev,struct wireless_dev *wdev) {
net/wireless/mlme.c +1 -1
@@ -331,7 +331,7 @@ void cfg80211_michael_mic_failure(struct {struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;struct cfg80211_registered_device *rdev =wiphy_to_dev (wiphy); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;char *buf =kmalloc (128 , gfp);
net/wireless/nl80211.c +2 -2
@@ -1264,7 +1264,7 @@ static int nl80211_set_key(struct sk_bufif (!err) err =func (&rdev->wiphy, dev, key.idx); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (!err) {if (func == rdev->ops->set_default_key) dev->ieee80211_ptr->wext.default_key = key.idx;
@@ -1365,7 +1365,7 @@ static int nl80211_del_key(struct sk_bufif (!err) err = rdev->ops->del_key (&rdev->wiphy, dev, key.idx, mac_addr); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (!err) {if (key.idx == dev->ieee80211_ptr->wext.default_key) dev->ieee80211_ptr->wext.default_key =-1 ;
net/wireless/scan.c +3 -3
@@ -22,7 +22,7 @@ void ___cfg80211_scan_done(struct cfg802 {struct cfg80211_scan_request *request;struct net_device *dev; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;#endif
@@ -47,7 +47,7 @@ void ___cfg80211_scan_done(struct cfg802else nl80211_send_scan_done (rdev, dev); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (!request->aborted) {memset (&wrqu,0 ,sizeof (wrqu));
@@ -592,7 +592,7 @@ void cfg80211_unlink_bss(struct wiphy *w }EXPORT_SYMBOL (cfg80211_unlink_bss); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT int cfg80211_wext_siwscan (struct net_device *dev,struct iw_request_info *info,union iwreq_data *wrqu,char *extra)
net/wireless/sme.c +6 -6
@@ -345,7 +345,7 @@ void __cfg80211_connect_result(struct ne {struct wireless_dev *wdev = dev->ieee80211_ptr;u8 *country_ie; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;#endif
@@ -362,7 +362,7 @@ void __cfg80211_connect_result(struct ne resp_ie, resp_ie_len, status, GFP_KERNEL); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (wextev) {if (req_ie && status ==WLAN_STATUS_SUCCESS ) {memset (&wrqu,0 ,sizeof (wrqu));
@@ -477,7 +477,7 @@ void __cfg80211_roamed(struct wireless_d const u8 *resp_ie, size_t resp_ie_len) {struct cfg80211_bss *bss; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;#endif
@@ -512,7 +512,7 @@ void __cfg80211_roamed(struct wireless_d req_ie, req_ie_len, resp_ie, resp_ie_len, GFP_KERNEL); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT if (req_ie) {memset (&wrqu,0 ,sizeof (wrqu)); wrqu.data.length = req_ie_len;
@@ -573,7 +573,7 @@ void __cfg80211_disconnected(struct net_struct wireless_dev *wdev = dev->ieee80211_ptr;struct cfg80211_registered_device *rdev =wiphy_to_dev (wdev->wiphy);int i; -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT union iwreq_data wrqu;#endif
@@ -631,7 +631,7 @@ void __cfg80211_disconnected(struct net_for (i =0 ; i <6 ; i++) rdev->ops->del_key (wdev->wiphy, dev, i,NULL ); -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_CFG80211_WEXT memset (&wrqu,0 ,sizeof (wrqu)); wrqu.ap_addr.sa_family =ARPHRD_ETHER ;wireless_send_event (dev,SIOCGIWAP , &wrqu,NULL );
net/socket.c +2 -2
@@ -905,11 +905,11 @@ static long sock_ioctl(struct file *fileif (cmd >=SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE +15 )) { err =dev_ioctl (net, cmd, argp); } else -#ifdef CONFIG_WIRELESS_EXT +#ifdef CONFIG_WEXT_CORE if (cmd >=SIOCIWFIRST && cmd <=SIOCIWLAST ) { err =dev_ioctl (net, cmd, argp); } else -#endif /* CONFIG_WIRELESS_EXT */ +#endif switch (cmd) {case FIOSETOWN :case SIOCSPGRP :
net/wireless/wext.c deleted +0 -1775
1,775 lines not on this page · raw message
net/wireless/wext-core.c new file +1063 -0
905 lines not on this page · raw message
include/net/wext.h +35 -14
49 lines not on this page · raw message
net/wireless/wext-proc.c new file +155 -0
155 lines not on this page · raw message
net/wireless/wext-spy.c new file +231 -0
231 lines not on this page · raw message
drivers/net/wireless/Kconfig +22 -7
Lines of this file are not shown. View the raw message.
drivers/net/wireless/hostap/Kconfig +2 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/ipw2x00/Kconfig +5 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/orinoco/Kconfig +2 -0
Lines of this file are not shown. View the raw message.
net/wireless/wext-priv.c new file +248 -0
248 lines not on this page · raw message
include/net/iw_handler.h +8 -6
Lines of this file are not shown. View the raw message.
net/core/net-sysfs.c +5 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.