diff options
| author | Johannes Berg <johannes@sipsolutions.net> | 2009-09-29 17:27:28 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:43 -0400 |
| commit | 3d23e349d807177eaf519d444677cee86b1a04cf (patch) | |
| tree | e800dee247598e59185ddd2dd47d2ac6fe090b9c /net/wireless/core.c | |
| parent | bc974f4a230756faf4f69114f271de2e678b363b (diff) | |
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).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
| -rw-r--r-- | net/wireless/core.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index e6f02e98e5f..eb0bb24b99c 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
| @@ -358,6 +358,10 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) | |||
| 358 | INIT_LIST_HEAD(&rdev->bss_list); | 358 | INIT_LIST_HEAD(&rdev->bss_list); |
| 359 | INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); | 359 | INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); |
| 360 | 360 | ||
| 361 | #ifdef CONFIG_CFG80211_WEXT | ||
| 362 | rdev->wiphy.wext = &cfg80211_wext_handler; | ||
| 363 | #endif | ||
| 364 | |||
| 361 | device_initialize(&rdev->wiphy.dev); | 365 | device_initialize(&rdev->wiphy.dev); |
| 362 | rdev->wiphy.dev.class = &ieee80211_class; | 366 | rdev->wiphy.dev.class = &ieee80211_class; |
| 363 | rdev->wiphy.dev.platform_data = rdev; | 367 | rdev->wiphy.dev.platform_data = rdev; |
| @@ -672,9 +676,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
| 672 | wdev->netdev = dev; | 676 | wdev->netdev = dev; |
| 673 | wdev->sme_state = CFG80211_SME_IDLE; | 677 | wdev->sme_state = CFG80211_SME_IDLE; |
| 674 | mutex_unlock(&rdev->devlist_mtx); | 678 | mutex_unlock(&rdev->devlist_mtx); |
| 675 | #ifdef CONFIG_WIRELESS_EXT | 679 | #ifdef CONFIG_CFG80211_WEXT |
| 676 | if (!dev->wireless_handlers) | ||
| 677 | dev->wireless_handlers = &cfg80211_wext_handler; | ||
| 678 | wdev->wext.default_key = -1; | 680 | wdev->wext.default_key = -1; |
| 679 | wdev->wext.default_mgmt_key = -1; | 681 | wdev->wext.default_mgmt_key = -1; |
| 680 | wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; | 682 | wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; |
| @@ -696,7 +698,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
| 696 | break; | 698 | break; |
| 697 | case NL80211_IFTYPE_STATION: | 699 | case NL80211_IFTYPE_STATION: |
| 698 | wdev_lock(wdev); | 700 | wdev_lock(wdev); |
| 699 | #ifdef CONFIG_WIRELESS_EXT | 701 | #ifdef CONFIG_CFG80211_WEXT |
| 700 | kfree(wdev->wext.ie); | 702 | kfree(wdev->wext.ie); |
| 701 | wdev->wext.ie = NULL; | 703 | wdev->wext.ie = NULL; |
| 702 | wdev->wext.ie_len = 0; | 704 | wdev->wext.ie_len = 0; |
| @@ -728,7 +730,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
| 728 | mutex_unlock(&rdev->devlist_mtx); | 730 | mutex_unlock(&rdev->devlist_mtx); |
| 729 | dev_put(dev); | 731 | dev_put(dev); |
| 730 | } | 732 | } |
| 731 | #ifdef CONFIG_WIRELESS_EXT | 733 | #ifdef CONFIG_CFG80211_WEXT |
| 732 | cfg80211_lock_rdev(rdev); | 734 | cfg80211_lock_rdev(rdev); |
| 733 | mutex_lock(&rdev->devlist_mtx); | 735 | mutex_lock(&rdev->devlist_mtx); |
| 734 | wdev_lock(wdev); | 736 | wdev_lock(wdev); |
| @@ -766,7 +768,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, | |||
| 766 | sysfs_remove_link(&dev->dev.kobj, "phy80211"); | 768 | sysfs_remove_link(&dev->dev.kobj, "phy80211"); |
| 767 | list_del_init(&wdev->list); | 769 | list_del_init(&wdev->list); |
| 768 | rdev->devlist_generation++; | 770 | rdev->devlist_generation++; |
| 769 | #ifdef CONFIG_WIRELESS_EXT | 771 | #ifdef CONFIG_CFG80211_WEXT |
| 770 | kfree(wdev->wext.keys); | 772 | kfree(wdev->wext.keys); |
| 771 | #endif | 773 | #endif |
| 772 | } | 774 | } |
