summaryrefslogtreecommitdiff
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorRory Little <rory@candelatech.com>2024-08-05 17:40:23 -0700
committerJohannes Berg <johannes.berg@intel.com>2024-08-27 10:28:53 +0200
commit7c3b69eadea9e57c28bf914b0fd70f268f3682e1 (patch)
tree6f65d8da713a3f5d06d14241cf86c88d22027a4d /include/net/mac80211.h
parent6a1a6f2dba35cfb5f81100c375a0c87eda90f2c7 (diff)
wifi: mac80211: Add non-atomic station iterator
Drivers may at times want to iterate their stations with a function which requires some non-atomic operations. ieee80211_iterate_stations_mtx() introduces an API to iterate stations while holding that wiphy's mutex. This allows the iterating function to do non-atomic operations safely. Signed-off-by: Rory Little <rory@candelatech.com> Link: https://patch.msgid.link/20240806004024.2014080-2-rory@candelatech.com [unify internal list iteration functions] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index de50dc8712c0..cfd64acdc039 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -6243,6 +6243,24 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
void (*iterator)(void *data,
struct ieee80211_sta *sta),
void *data);
+
+/**
+ * ieee80211_iterate_stations_mtx - iterate stations
+ *
+ * This function iterates over all stations associated with a given
+ * hardware that are currently uploaded to the driver and calls the callback
+ * function for them. This version can only be used while holding the wiphy
+ * mutex.
+ *
+ * @hw: the hardware struct of which the interfaces should be iterated over
+ * @iterator: the iterator function to call
+ * @data: first argument of the iterator function
+ */
+void ieee80211_iterate_stations_mtx(struct ieee80211_hw *hw,
+ void (*iterator)(void *data,
+ struct ieee80211_sta *sta),
+ void *data);
+
/**
* ieee80211_queue_work - add work onto the mac80211 workqueue
*