]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/wireless/core.c
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
[karo-tx-linux.git] / net / wireless / core.c
index aff959e5a1b360e7cb467cade7f7d617544b3909..d89dee2259b5994b9237100425aae0a3f21b20af 100644 (file)
@@ -203,17 +203,8 @@ void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,
 
        rdev->opencount--;
 
-       if (rdev->scan_req && rdev->scan_req->wdev == wdev) {
-               /*
-                * If the scan request wasn't notified as done, set it
-                * to aborted and leak it after a warning. The driver
-                * should have notified us that it ended at the latest
-                * during rdev_stop_p2p_device().
-                */
-               if (WARN_ON(!rdev->scan_req->notified))
-                       rdev->scan_req->aborted = true;
-               ___cfg80211_scan_done(rdev, !rdev->scan_req->notified);
-       }
+       WARN_ON(rdev->scan_req && rdev->scan_req->wdev == wdev &&
+               !rdev->scan_req->notified);
 }
 
 static int cfg80211_rfkill_set_block(void *data, bool blocked)
@@ -357,8 +348,6 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
        rdev->wiphy.rts_threshold = (u32) -1;
        rdev->wiphy.coverage_class = 0;
 
-       rdev->wiphy.features = NL80211_FEATURE_SCAN_FLUSH;
-
        return &rdev->wiphy;
 }
 EXPORT_SYMBOL(wiphy_new);
@@ -451,6 +440,15 @@ int wiphy_register(struct wiphy *wiphy)
        int i;
        u16 ifmodes = wiphy->interface_modes;
 
+       /* support for 5/10 MHz is broken due to nl80211 API mess - disable */
+       wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_5_10_MHZ;
+
+       /*
+        * There are major locking problems in nl80211/mac80211 for CSA,
+        * disable for all drivers until this has been reworked.
+        */
+       wiphy->flags &= ~WIPHY_FLAG_HAS_CHANNEL_SWITCH;
+
 #ifdef CONFIG_PM
        if (WARN_ON(wiphy->wowlan &&
                    (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
@@ -566,6 +564,8 @@ int wiphy_register(struct wiphy *wiphy)
        /* check and set up bitrates */
        ieee80211_set_bitrate_flags(wiphy);
 
+       rdev->wiphy.features |= NL80211_FEATURE_SCAN_FLUSH;
+
        rtnl_lock();
        res = device_add(&rdev->wiphy.dev);
        if (res) {
@@ -586,7 +586,7 @@ int wiphy_register(struct wiphy *wiphy)
        if (IS_ERR(rdev->wiphy.debugfsdir))
                rdev->wiphy.debugfsdir = NULL;
 
-       if (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
+       if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
                struct regulatory_request request;
 
                request.wiphy_idx = get_wiphy_idx(wiphy);
@@ -756,13 +756,16 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
 {
        struct net_device *dev = wdev->netdev;
 
+       ASSERT_RTNL();
+
        switch (wdev->iftype) {
        case NL80211_IFTYPE_ADHOC:
                cfg80211_leave_ibss(rdev, dev, true);
                break;
        case NL80211_IFTYPE_P2P_CLIENT:
        case NL80211_IFTYPE_STATION:
-               __cfg80211_stop_sched_scan(rdev, false);
+               if (rdev->sched_scan_req && dev == rdev->sched_scan_req->dev)
+                       __cfg80211_stop_sched_scan(rdev, false);
 
                wdev_lock(wdev);
 #ifdef CONFIG_CFG80211_WEXT
@@ -856,11 +859,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
                break;
        case NETDEV_DOWN:
                cfg80211_update_iface_num(rdev, wdev->iftype, -1);
-               if (rdev->scan_req && rdev->scan_req->wdev == wdev) {
-                       if (WARN_ON(!rdev->scan_req->notified))
-                               rdev->scan_req->aborted = true;
-                       ___cfg80211_scan_done(rdev, true);
-               }
+               WARN_ON(rdev->scan_req && rdev->scan_req->wdev == wdev &&
+                       !rdev->scan_req->notified);
 
                if (WARN_ON(rdev->sched_scan_req &&
                            rdev->sched_scan_req->dev == wdev->netdev)) {