cfg80211: Enable regulatory enforcement checks for drivers supporting mesh iface
authorSriram R <quic_srirrama@quicinc.com>
Thu, 2 Dec 2021 01:38:40 +0000 (07:08 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 20 Dec 2021 10:18:30 +0000 (11:18 +0100)
Currently cfg80211 checks for invalid channels whenever there is a
regulatory update and stops the active interfaces if it is operating on
an unsupported channel in the new regulatory domain.

This is done based on a regulatory flag REGULATORY_IGNORE_STALE_KICKOFF
set during wiphy registration which disables this enforcement when
unsupported interface modes are supported by driver.

Add support to enable this enforcement when Mesh Point interface type
is advertised by drivers.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Link: https://lore.kernel.org/r/1638409120-28997-1-git-send-email-quic_srirrama@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c
net/wireless/reg.c

index 132c575c55409514a00723e1aa3868bb66fcdd02..3a54c8e6b6c61c87e40ed78459e99a4e69550aad 100644 (file)
@@ -737,6 +737,7 @@ int wiphy_register(struct wiphy *wiphy)
        if (wiphy->interface_modes & ~(BIT(NL80211_IFTYPE_STATION) |
                                       BIT(NL80211_IFTYPE_P2P_CLIENT) |
                                       BIT(NL80211_IFTYPE_AP) |
+                                      BIT(NL80211_IFTYPE_MESH_POINT) |
                                       BIT(NL80211_IFTYPE_P2P_GO) |
                                       BIT(NL80211_IFTYPE_ADHOC) |
                                       BIT(NL80211_IFTYPE_P2P_DEVICE) |
index df87c7f3a04921d43ae0f536444101bc4ddfdab6..58e4b33aff04105769c3a8e7188cfa56cf955a8c 100644 (file)
@@ -2349,6 +2349,7 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
        switch (iftype) {
        case NL80211_IFTYPE_AP:
        case NL80211_IFTYPE_P2P_GO:
+       case NL80211_IFTYPE_MESH_POINT:
                if (!wdev->beacon_interval)
                        goto wdev_inactive_unlock;
                chandef = wdev->chandef;
@@ -2387,6 +2388,7 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev)
        case NL80211_IFTYPE_AP:
        case NL80211_IFTYPE_P2P_GO:
        case NL80211_IFTYPE_ADHOC:
+       case NL80211_IFTYPE_MESH_POINT:
                return cfg80211_reg_can_beacon_relax(wiphy, &chandef, iftype);
        case NL80211_IFTYPE_STATION:
        case NL80211_IFTYPE_P2P_CLIENT: