UPSTREAM: wifi: cfg80211: add cfg80211_get_iftype_ext_capa()

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>

Bug: 253289327
Change-Id: I53f6168698e99001dc4fec61f89742e7d375ab83
(cherry picked from commit 7464f665158e09f3f29116d8d0676824c1f1eeda)
Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Johannes Berg
2022-07-12 18:32:49 +02:00
committed by Todd Kjos
parent 2c60081d52
commit 5697efd6e4
2 changed files with 22 additions and 0 deletions

View File

@@ -5266,6 +5266,14 @@ struct wiphy_iftype_ext_capab {
u8 extended_capabilities_len;
};
/**
* 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

View File

@@ -2488,3 +2488,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);