aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-11-28 10:55:32 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:55:28 -0800
commite38bad4766a110b61fa6038f10be16ced8c6cc38 (patch)
tree8a1b3920dd5383c4a8312597c6d4570b22eae148 /net/mac80211
parent76ee65bfaa1435320a72989a6413467ce446ae23 (diff)
mac80211: make ieee80211_iterate_active_interfaces not need rtnl
Interface iteration in mac80211 can be done without holding any locks because I converted it to RCU. Initially, I thought this wouldn't be needed for ieee80211_iterate_active_interfaces but it's turning out that multi-BSS AP support can be much simpler in a driver if ieee80211_iterate_active_interfaces can be called without holding locks. This converts it to use RCU, it adds a requirement that the callback it invokes cannot sleep. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5227c16f113..7b278e9aa1a 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -482,10 +482,9 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
- ASSERT_RTNL();
+ rcu_read_lock();
- /* we hold the RTNL here so can safely walk the list */
- list_for_each_entry(sdata, &local->interfaces, list) {
+ list_for_each_entry_rcu(sdata, &local->interfaces, list) {
switch (sdata->type) {
case IEEE80211_IF_TYPE_INVALID:
case IEEE80211_IF_TYPE_MNTR:
@@ -503,5 +502,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
iterator(data, sdata->dev->dev_addr,
sdata->dev->ifindex);
}
+
+ rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);