USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
[platform/kernel/linux-rpi.git] / net / wireless / reg.c
index 26f11e4..0317cf9 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2008-2011 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright      2017  Intel Deutschland GmbH
- * Copyright (C) 2018 - 2022 Intel Corporation
+ * Copyright (C) 2018 - 2023 Intel Corporation
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -1587,6 +1587,8 @@ static u32 map_regdom_flags(u32 rd_flags)
                channel_flags |= IEEE80211_CHAN_NO_HE;
        if (rd_flags & NL80211_RRF_NO_320MHZ)
                channel_flags |= IEEE80211_CHAN_NO_320MHZ;
+       if (rd_flags & NL80211_RRF_NO_EHT)
+               channel_flags |= IEEE80211_CHAN_NO_EHT;
        return channel_flags;
 }
 
@@ -2352,7 +2354,7 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
 
                if (!wdev->valid_links && link > 0)
                        break;
-               if (!(wdev->valid_links & BIT(link)))
+               if (wdev->valid_links && !(wdev->valid_links & BIT(link)))
                        continue;
                switch (iftype) {
                case NL80211_IFTYPE_AP:
@@ -2391,9 +2393,17 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
                case NL80211_IFTYPE_P2P_DEVICE:
                        /* no enforcement required */
                        break;
+               case NL80211_IFTYPE_OCB:
+                       if (!wdev->u.ocb.chandef.chan)
+                               continue;
+                       chandef = wdev->u.ocb.chandef;
+                       break;
+               case NL80211_IFTYPE_NAN:
+                       /* we have no info, but NAN is also pretty universal */
+                       continue;
                default:
                        /* others not implemented for now */
-                       WARN_ON(1);
+                       WARN_ON_ONCE(1);
                        break;
                }
 
@@ -2452,9 +2462,7 @@ static void reg_check_chans_work(struct work_struct *work)
        rtnl_lock();
 
        list_for_each_entry(rdev, &cfg80211_rdev_list, list)
-               if (!(rdev->wiphy.regulatory_flags &
-                     REGULATORY_IGNORE_STALE_KICKOFF))
-                       reg_leave_invalid_chans(&rdev->wiphy);
+               reg_leave_invalid_chans(&rdev->wiphy);
 
        rtnl_unlock();
 }