summaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-13 12:11:00 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-03-18 20:15:03 +0100
commit39ecc01d1bbe3de2cf5f01a81e176ea5160d3b95 (patch)
tree1a75bf065c61f0870ff4d63eac6130998834748c /net/mac80211/util.c
parenta0ca796c460259bc079631d2d148ffff1d1fc736 (diff)
downloadlinux-39ecc01d1bbe3de2cf5f01a81e176ea5160d3b95.tar.gz
linux-39ecc01d1bbe3de2cf5f01a81e176ea5160d3b95.tar.bz2
linux-39ecc01d1bbe3de2cf5f01a81e176ea5160d3b95.zip
mac80211: pass queue bitmap to flush operation
There are a number of situations in which mac80211 only really needs to flush queues for one virtual interface, and in fact during this frames might be transmitted on other virtual interfaces. Calculate and pass a queue bitmap to the driver so it knows which queues to flush. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index b7a856e3281b..f978ddd1bb43 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -511,6 +511,31 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw)
}
EXPORT_SYMBOL(ieee80211_wake_queues);
+void ieee80211_flush_queues(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata)
+{
+ u32 queues;
+
+ if (!local->ops->flush)
+ return;
+
+ if (sdata && local->hw.flags & IEEE80211_HW_QUEUE_CONTROL) {
+ int ac;
+
+ queues = 0;
+
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
+ queues |= BIT(sdata->vif.hw_queue[ac]);
+ if (sdata->vif.cab_queue != IEEE80211_INVAL_HW_QUEUE)
+ queues |= BIT(sdata->vif.cab_queue);
+ } else {
+ /* all queues */
+ queues = BIT(local->hw.queues) - 1;
+ }
+
+ drv_flush(local, queues, false);
+}
+
void ieee80211_iterate_active_interfaces(
struct ieee80211_hw *hw, u32 iter_flags,
void (*iterator)(void *data, u8 *mac,