Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78173
b: refs/heads/master
c: dabeb34
h: refs/heads/master
i:
  78171: 3ef6e97
v: v3
  • Loading branch information
Johannes Berg authored and David S. Miller committed Jan 28, 2008
1 parent d6d2ebc commit cbfa4b6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9859a79023d71dd4e56c195a345abc4112abfd02
refs/heads/master: dabeb344f54ab780d152714c18f1cb6b21c471a1
16 changes: 16 additions & 0 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1406,4 +1406,20 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
*/
void ieee80211_scan_completed(struct ieee80211_hw *hw);

/**
* ieee80211_iterate_active_interfaces - iterate active interfaces
*
* This function iterates over the interfaces associated with a given
* hardware that are currently active and calls the callback for them.
* Must be called under RTNL.
*
* @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_active_interfaces(struct ieee80211_hw *hw,
void (*iterator)(void *data, u8 *mac,
int if_id),
void *data);

#endif /* MAC80211_H */
33 changes: 33 additions & 0 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/bitmap.h>
#include <net/net_namespace.h>
#include <net/cfg80211.h>
#include <net/rtnetlink.h>

#include "ieee80211_i.h"
#include "ieee80211_rate.h"
Expand Down Expand Up @@ -484,3 +485,35 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw)
ieee80211_wake_queue(hw, i);
}
EXPORT_SYMBOL(ieee80211_wake_queues);

void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
void (*iterator)(void *data, u8 *mac,
int if_id),
void *data)
{
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;

ASSERT_RTNL();

/* we hold the RTNL here so can safely walk the list */
list_for_each_entry(sdata, &local->interfaces, list) {
switch (sdata->type) {
case IEEE80211_IF_TYPE_INVALID:
case IEEE80211_IF_TYPE_MNTR:
case IEEE80211_IF_TYPE_VLAN:
continue;
case IEEE80211_IF_TYPE_AP:
case IEEE80211_IF_TYPE_STA:
case IEEE80211_IF_TYPE_IBSS:
case IEEE80211_IF_TYPE_WDS:
break;
}
if (sdata->dev == local->mdev)
continue;
if (netif_running(sdata->dev))
iterator(data, sdata->dev->dev_addr,
sdata->dev->ifindex);
}
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);

0 comments on commit cbfa4b6

Please sign in to comment.