diff options
author | Gregory Greenman <gregory.greenman@intel.com> | 2022-07-12 11:22:50 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-07-22 14:28:47 +0200 |
commit | 9f781533bb028edb3e8e10e79fb87e85a4dc6987 (patch) | |
tree | bf209dd70eb3679f77805d205bdb725fae34da79 /include | |
parent | wifi: mac80211: remove erroneous sband/link validation (diff) | |
download | linux-9f781533bb028edb3e8e10e79fb87e85a4dc6987.tar.xz linux-9f781533bb028edb3e8e10e79fb87e85a4dc6987.zip |
wifi: mac80211: add macros to loop over active links
Add a preliminary version which will be updated later
to loop over vif's and sta's active links.
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/mac80211.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 1e04961148bf..f198af600b5e 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1856,6 +1856,13 @@ struct ieee80211_vif { u8 drv_priv[] __aligned(sizeof(void *)); }; +/* FIXME: for now loop over all the available links; later will be changed + * to loop only over the active links. + */ +#define for_each_vif_active_link(vif, link, link_id) \ + for (link_id = 0; link_id < ARRAY_SIZE((vif)->link_conf); link_id++) \ + if ((link = rcu_dereference((vif)->link_conf[link_id]))) + static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) { #ifdef CONFIG_MAC80211_MESH @@ -2248,6 +2255,14 @@ struct ieee80211_sta { u8 drv_priv[] __aligned(sizeof(void *)); }; +/* FIXME: need to loop only over links which are active and check the actual + * lock + */ +#define for_each_sta_active_link(sta, link_sta, link_id) \ + for (link_id = 0; link_id < ARRAY_SIZE((sta)->link); link_id++) \ + if (((link_sta) = rcu_dereference_protected((sta)->link[link_id],\ + 1))) \ + /** * enum sta_notify_cmd - sta notify command * |