wifi: cfg80211: add cfg80211_get_iftype_ext_capa()
authorJohannes Berg <johannes.berg@intel.com>
Tue, 12 Jul 2022 16:32:49 +0000 (18:32 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:23 +0000 (11:43 +0200)
Add a helper function cfg80211_get_iftype_ext_capa() to
look up interface type-specific (extended) capabilities.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/wireless/util.c

index 8dbc64286d91884207058b7978327aa930d342d6..d5af3a7fc2b424d4d78ecc56b368137f767479c8 100644 (file)
@@ -5005,6 +5005,14 @@ struct wiphy_iftype_ext_capab {
        u16 mld_capa_and_ops;
 };
 
+/**
+ * cfg80211_get_iftype_ext_capa - lookup interface type extended capability
+ * @wiphy: the wiphy to look up from
+ * @type: the interface type to look up
+ */
+const struct wiphy_iftype_ext_capab *
+cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type);
+
 /**
  * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
  * @max_peers: maximum number of peers in a single measurement
index fe7956c8c6dadf43e95459219b92db51f316dbc5..2c127951764a86b30b411f128ad399e9aded4459 100644 (file)
@@ -2490,3 +2490,17 @@ int cfg80211_remove_virtual_intf(struct cfg80211_registered_device *rdev,
 
        return rdev_del_virtual_intf(rdev, wdev);
 }
+
+const struct wiphy_iftype_ext_capab *
+cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype type)
+{
+       int i;
+
+       for (i = 0; i < wiphy->num_iftype_ext_capab; i++) {
+               if (wiphy->iftype_ext_capab[i].iftype == type)
+                       return &wiphy->iftype_ext_capab[i];
+       }
+
+       return NULL;
+}
+EXPORT_SYMBOL(cfg80211_get_iftype_ext_capa);