aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 53dda7728f86..3af0ecf1cc16 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -320,6 +320,20 @@ static void cfg80211_destroy_iface_wk(struct work_struct *work)
320 rtnl_unlock(); 320 rtnl_unlock();
321} 321}
322 322
323static void cfg80211_sched_scan_stop_wk(struct work_struct *work)
324{
325 struct cfg80211_registered_device *rdev;
326
327 rdev = container_of(work, struct cfg80211_registered_device,
328 sched_scan_stop_wk);
329
330 rtnl_lock();
331
332 __cfg80211_stop_sched_scan(rdev, false);
333
334 rtnl_unlock();
335}
336
323/* exported functions */ 337/* exported functions */
324 338
325struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, 339struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
@@ -406,6 +420,7 @@ use_default_name:
406 INIT_LIST_HEAD(&rdev->destroy_list); 420 INIT_LIST_HEAD(&rdev->destroy_list);
407 spin_lock_init(&rdev->destroy_list_lock); 421 spin_lock_init(&rdev->destroy_list_lock);
408 INIT_WORK(&rdev->destroy_work, cfg80211_destroy_iface_wk); 422 INIT_WORK(&rdev->destroy_work, cfg80211_destroy_iface_wk);
423 INIT_WORK(&rdev->sched_scan_stop_wk, cfg80211_sched_scan_stop_wk);
409 424
410#ifdef CONFIG_CFG80211_DEFAULT_PS 425#ifdef CONFIG_CFG80211_DEFAULT_PS
411 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; 426 rdev->wiphy.flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
@@ -560,6 +575,14 @@ int wiphy_register(struct wiphy *wiphy)
560 BIT(NL80211_IFTYPE_MONITOR))) 575 BIT(NL80211_IFTYPE_MONITOR)))
561 wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; 576 wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
562 577
578 if (WARN_ON((wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) &&
579 (wiphy->regulatory_flags &
580 (REGULATORY_CUSTOM_REG |
581 REGULATORY_STRICT_REG |
582 REGULATORY_COUNTRY_IE_FOLLOW_POWER |
583 REGULATORY_COUNTRY_IE_IGNORE))))
584 return -EINVAL;
585
563 if (WARN_ON(wiphy->coalesce && 586 if (WARN_ON(wiphy->coalesce &&
564 (!wiphy->coalesce->n_rules || 587 (!wiphy->coalesce->n_rules ||
565 !wiphy->coalesce->n_patterns) && 588 !wiphy->coalesce->n_patterns) &&
@@ -778,6 +801,7 @@ void wiphy_unregister(struct wiphy *wiphy)
778 flush_work(&rdev->event_work); 801 flush_work(&rdev->event_work);
779 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); 802 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
780 flush_work(&rdev->destroy_work); 803 flush_work(&rdev->destroy_work);
804 flush_work(&rdev->sched_scan_stop_wk);
781 805
782#ifdef CONFIG_PM 806#ifdef CONFIG_PM
783 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup) 807 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
@@ -858,6 +882,7 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
858 struct wireless_dev *wdev) 882 struct wireless_dev *wdev)
859{ 883{
860 struct net_device *dev = wdev->netdev; 884 struct net_device *dev = wdev->netdev;
885 struct cfg80211_sched_scan_request *sched_scan_req;
861 886
862 ASSERT_RTNL(); 887 ASSERT_RTNL();
863 ASSERT_WDEV_LOCK(wdev); 888 ASSERT_WDEV_LOCK(wdev);
@@ -868,7 +893,8 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,
868 break; 893 break;
869 case NL80211_IFTYPE_P2P_CLIENT: 894 case NL80211_IFTYPE_P2P_CLIENT:
870 case NL80211_IFTYPE_STATION: 895 case NL80211_IFTYPE_STATION:
871 if (rdev->sched_scan_req && dev == rdev->sched_scan_req->dev) 896 sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
897 if (sched_scan_req && dev == sched_scan_req->dev)
872 __cfg80211_stop_sched_scan(rdev, false); 898 __cfg80211_stop_sched_scan(rdev, false);
873 899
874#ifdef CONFIG_CFG80211_WEXT 900#ifdef CONFIG_CFG80211_WEXT
@@ -943,6 +969,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
943 struct net_device *dev = netdev_notifier_info_to_dev(ptr); 969 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
944 struct wireless_dev *wdev = dev->ieee80211_ptr; 970 struct wireless_dev *wdev = dev->ieee80211_ptr;
945 struct cfg80211_registered_device *rdev; 971 struct cfg80211_registered_device *rdev;
972 struct cfg80211_sched_scan_request *sched_scan_req;
946 973
947 if (!wdev) 974 if (!wdev)
948 return NOTIFY_DONE; 975 return NOTIFY_DONE;
@@ -1007,8 +1034,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
1007 ___cfg80211_scan_done(rdev, false); 1034 ___cfg80211_scan_done(rdev, false);
1008 } 1035 }
1009 1036
1010 if (WARN_ON(rdev->sched_scan_req && 1037 sched_scan_req = rtnl_dereference(rdev->sched_scan_req);
1011 rdev->sched_scan_req->dev == wdev->netdev)) { 1038 if (WARN_ON(sched_scan_req &&
1039 sched_scan_req->dev == wdev->netdev)) {
1012 __cfg80211_stop_sched_scan(rdev, false); 1040 __cfg80211_stop_sched_scan(rdev, false);
1013 } 1041 }
1014 1042