diff options
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 3f7253052088..b677eab55b68 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "debugfs.h" | 26 | #include "debugfs.h" |
27 | #include "wext-compat.h" | 27 | #include "wext-compat.h" |
28 | #include "ethtool.h" | 28 | #include "ethtool.h" |
29 | #include "rdev-ops.h" | ||
29 | 30 | ||
30 | /* name for sysfs, %d is appended */ | 31 | /* name for sysfs, %d is appended */ |
31 | #define PHY_NAME "phy" | 32 | #define PHY_NAME "phy" |
@@ -216,7 +217,7 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) | |||
216 | { | 217 | { |
217 | struct cfg80211_registered_device *rdev = data; | 218 | struct cfg80211_registered_device *rdev = data; |
218 | 219 | ||
219 | rdev->ops->rfkill_poll(&rdev->wiphy); | 220 | rdev_rfkill_poll(rdev); |
220 | } | 221 | } |
221 | 222 | ||
222 | static int cfg80211_rfkill_set_block(void *data, bool blocked) | 223 | static int cfg80211_rfkill_set_block(void *data, bool blocked) |
@@ -240,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked) | |||
240 | case NL80211_IFTYPE_P2P_DEVICE: | 241 | case NL80211_IFTYPE_P2P_DEVICE: |
241 | if (!wdev->p2p_started) | 242 | if (!wdev->p2p_started) |
242 | break; | 243 | break; |
243 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); | 244 | rdev_stop_p2p_device(rdev, wdev); |
244 | wdev->p2p_started = false; | 245 | wdev->p2p_started = false; |
245 | rdev->opencount--; | 246 | rdev->opencount--; |
246 | break; | 247 | break; |
@@ -325,6 +326,8 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) | |||
325 | mutex_init(&rdev->devlist_mtx); | 326 | mutex_init(&rdev->devlist_mtx); |
326 | mutex_init(&rdev->sched_scan_mtx); | 327 | mutex_init(&rdev->sched_scan_mtx); |
327 | INIT_LIST_HEAD(&rdev->wdev_list); | 328 | INIT_LIST_HEAD(&rdev->wdev_list); |
329 | INIT_LIST_HEAD(&rdev->beacon_registrations); | ||
330 | spin_lock_init(&rdev->beacon_registrations_lock); | ||
328 | spin_lock_init(&rdev->bss_lock); | 331 | spin_lock_init(&rdev->bss_lock); |
329 | INIT_LIST_HEAD(&rdev->bss_list); | 332 | INIT_LIST_HEAD(&rdev->bss_list); |
330 | INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); | 333 | INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); |
@@ -370,6 +373,8 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) | |||
370 | rdev->wiphy.rts_threshold = (u32) -1; | 373 | rdev->wiphy.rts_threshold = (u32) -1; |
371 | rdev->wiphy.coverage_class = 0; | 374 | rdev->wiphy.coverage_class = 0; |
372 | 375 | ||
376 | rdev->wiphy.features = NL80211_FEATURE_SCAN_FLUSH; | ||
377 | |||
373 | return &rdev->wiphy; | 378 | return &rdev->wiphy; |
374 | } | 379 | } |
375 | EXPORT_SYMBOL(wiphy_new); | 380 | EXPORT_SYMBOL(wiphy_new); |
@@ -687,7 +692,7 @@ void wiphy_unregister(struct wiphy *wiphy) | |||
687 | flush_work(&rdev->event_work); | 692 | flush_work(&rdev->event_work); |
688 | 693 | ||
689 | if (rdev->wowlan && rdev->ops->set_wakeup) | 694 | if (rdev->wowlan && rdev->ops->set_wakeup) |
690 | rdev->ops->set_wakeup(&rdev->wiphy, false); | 695 | rdev_set_wakeup(rdev, false); |
691 | cfg80211_rdev_free_wowlan(rdev); | 696 | cfg80211_rdev_free_wowlan(rdev); |
692 | } | 697 | } |
693 | EXPORT_SYMBOL(wiphy_unregister); | 698 | EXPORT_SYMBOL(wiphy_unregister); |
@@ -695,10 +700,15 @@ EXPORT_SYMBOL(wiphy_unregister); | |||
695 | void cfg80211_dev_free(struct cfg80211_registered_device *rdev) | 700 | void cfg80211_dev_free(struct cfg80211_registered_device *rdev) |
696 | { | 701 | { |
697 | struct cfg80211_internal_bss *scan, *tmp; | 702 | struct cfg80211_internal_bss *scan, *tmp; |
703 | struct cfg80211_beacon_registration *reg, *treg; | ||
698 | rfkill_destroy(rdev->rfkill); | 704 | rfkill_destroy(rdev->rfkill); |
699 | mutex_destroy(&rdev->mtx); | 705 | mutex_destroy(&rdev->mtx); |
700 | mutex_destroy(&rdev->devlist_mtx); | 706 | mutex_destroy(&rdev->devlist_mtx); |
701 | mutex_destroy(&rdev->sched_scan_mtx); | 707 | mutex_destroy(&rdev->sched_scan_mtx); |
708 | list_for_each_entry_safe(reg, treg, &rdev->beacon_registrations, list) { | ||
709 | list_del(®->list); | ||
710 | kfree(reg); | ||
711 | } | ||
702 | list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list) | 712 | list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list) |
703 | cfg80211_put_bss(&scan->pub); | 713 | cfg80211_put_bss(&scan->pub); |
704 | kfree(rdev); | 714 | kfree(rdev); |
@@ -770,7 +780,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev) | |||
770 | case NL80211_IFTYPE_P2P_DEVICE: | 780 | case NL80211_IFTYPE_P2P_DEVICE: |
771 | if (!wdev->p2p_started) | 781 | if (!wdev->p2p_started) |
772 | break; | 782 | break; |
773 | rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); | 783 | rdev_stop_p2p_device(rdev, wdev); |
774 | wdev->p2p_started = false; | 784 | wdev->p2p_started = false; |
775 | rdev->opencount--; | 785 | rdev->opencount--; |
776 | break; | 786 | break; |
@@ -856,8 +866,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
856 | /* allow mac80211 to determine the timeout */ | 866 | /* allow mac80211 to determine the timeout */ |
857 | wdev->ps_timeout = -1; | 867 | wdev->ps_timeout = -1; |
858 | 868 | ||
859 | if (!dev->ethtool_ops) | 869 | netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops); |
860 | dev->ethtool_ops = &cfg80211_ethtool_ops; | ||
861 | 870 | ||
862 | if ((wdev->iftype == NL80211_IFTYPE_STATION || | 871 | if ((wdev->iftype == NL80211_IFTYPE_STATION || |
863 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || | 872 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || |
@@ -961,9 +970,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
961 | if ((wdev->iftype == NL80211_IFTYPE_STATION || | 970 | if ((wdev->iftype == NL80211_IFTYPE_STATION || |
962 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && | 971 | wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && |
963 | rdev->ops->set_power_mgmt) | 972 | rdev->ops->set_power_mgmt) |
964 | if (rdev->ops->set_power_mgmt(wdev->wiphy, dev, | 973 | if (rdev_set_power_mgmt(rdev, dev, wdev->ps, |
965 | wdev->ps, | 974 | wdev->ps_timeout)) { |
966 | wdev->ps_timeout)) { | ||
967 | /* assume this means it's off */ | 975 | /* assume this means it's off */ |
968 | wdev->ps = false; | 976 | wdev->ps = false; |
969 | } | 977 | } |