aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-10-22 05:30:59 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-23 14:40:03 -0400
commit0fc1e0495fd6e261e75acdbe66b53e769e5ffb81 (patch)
tree01f0e5c9cb8b8c834224ca10161d152f4f5a8307 /net/mac80211/util.c
parent2bad7748b332d7218377287248eb66c25de033b2 (diff)
mac80211: expose API allowing station iteration
Allow drivers to iterate all stations currently uploaded to them. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 9247a960ea59..666aa1306c45 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -693,6 +693,34 @@ void ieee80211_iterate_active_interfaces_rtnl(
693} 693}
694EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_rtnl); 694EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_rtnl);
695 695
696static void __iterate_stations(struct ieee80211_local *local,
697 void (*iterator)(void *data,
698 struct ieee80211_sta *sta),
699 void *data)
700{
701 struct sta_info *sta;
702
703 list_for_each_entry_rcu(sta, &local->sta_list, list) {
704 if (!sta->uploaded)
705 continue;
706
707 iterator(data, &sta->sta);
708 }
709}
710
711void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
712 void (*iterator)(void *data,
713 struct ieee80211_sta *sta),
714 void *data)
715{
716 struct ieee80211_local *local = hw_to_local(hw);
717
718 rcu_read_lock();
719 __iterate_stations(local, iterator, data);
720 rcu_read_unlock();
721}
722EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_atomic);
723
696struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev) 724struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
697{ 725{
698 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); 726 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);