aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2023-06-08 16:36:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-06-14 12:20:08 +0200
commitf1871abd27641c020298b5c7654e1d8341f22e5f (patch)
treefbc909d58b513b90c2a1d31f37e83b8b78ec2c23 /include/net/mac80211.h
parentwifi: mac80211: allow disabling SMPS debugfs controls (diff)
downloadwireguard-linux-f1871abd27641c020298b5c7654e1d8341f22e5f.tar.xz
wireguard-linux-f1871abd27641c020298b5c7654e1d8341f22e5f.zip
wifi: mac80211: Add getter functions for vif MLD state
As a preparation to support disabled/dormant links, add the following function: - ieee80211_vif_usable_links(): returns the bitmap of the links that can be activated. Use this function in all the places that the bitmap of the usable links is needed. - ieee80211_vif_is_mld(): returns true iff the vif is an MLD. Use this function in all the places where an indication that the connection is a MLD is needed. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230608163202.86e3351da1fc.If6fe3a339fda2019f13f57ff768ecffb711b710a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 98cb2c532025..5424301df3c8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1909,6 +1909,27 @@ struct ieee80211_vif {
u8 drv_priv[] __aligned(sizeof(void *));
};
+/**
+ * ieee80211_vif_usable_links - Return the usable links for the vif
+ * @vif: the vif for which the usable links are requested
+ * Return: the usable link bitmap
+ */
+static inline u16 ieee80211_vif_usable_links(const struct ieee80211_vif *vif)
+{
+ return vif->valid_links;
+}
+
+/**
+ * ieee80211_vif_is_mld - Returns true iff the vif is an MLD one
+ * @vif: the vif
+ * Return: %true if the vif is an MLD, %false otherwise.
+ */
+static inline bool ieee80211_vif_is_mld(const struct ieee80211_vif *vif)
+{
+ /* valid_links != 0 indicates this vif is an MLD */
+ return vif->valid_links != 0;
+}
+
#define for_each_vif_active_link(vif, link, link_id) \
for (link_id = 0; link_id < ARRAY_SIZE((vif)->link_conf); link_id++) \
if ((!(vif)->active_links || \