mac80211: add specific-queue flushing support
authorLiad Kaufman <liad.kaufman@intel.com>
Sun, 9 Nov 2014 16:50:21 +0000 (18:50 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 19 Nov 2014 17:45:30 +0000 (18:45 +0100)
If the HW supports IEEE80211_HW_QUEUE_CONTROL, allow
flushing only specific queues rather than all of them.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/util.c

index 5de2e5f3a57e89ab777be0c2581f1cabb8c09857..a30d40839d49d2833781a1bf95c95a61223e316a 100644 (file)
@@ -1881,6 +1881,9 @@ void ieee80211_add_pending_skbs(struct ieee80211_local *local,
                                struct sk_buff_head *skbs);
 void ieee80211_flush_queues(struct ieee80211_local *local,
                            struct ieee80211_sub_if_data *sdata);
+void __ieee80211_flush_queues(struct ieee80211_local *local,
+                             struct ieee80211_sub_if_data *sdata,
+                             unsigned int queues);
 
 void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         u16 transaction, u16 auth_alg, u16 status,
index 9e5bfd6148562cb9565be877851e83781b4ddf37..745a8a9cbbb5f10aa1a4d75bc56101944ac42000 100644 (file)
@@ -576,15 +576,19 @@ ieee80211_get_vif_queues(struct ieee80211_local *local,
        return queues;
 }
 
-void ieee80211_flush_queues(struct ieee80211_local *local,
-                           struct ieee80211_sub_if_data *sdata)
+void __ieee80211_flush_queues(struct ieee80211_local *local,
+                             struct ieee80211_sub_if_data *sdata,
+                             unsigned int queues)
 {
-       unsigned int queues;
-
        if (!local->ops->flush)
                return;
 
-       queues = ieee80211_get_vif_queues(local, sdata);
+       /*
+        * If no queue was set, or if the HW doesn't support
+        * IEEE80211_HW_QUEUE_CONTROL - flush all queues
+        */
+       if (!queues || !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL))
+               queues = ieee80211_get_vif_queues(local, sdata);
 
        ieee80211_stop_queues_by_reason(&local->hw, queues,
                                        IEEE80211_QUEUE_STOP_REASON_FLUSH,
@@ -597,6 +601,12 @@ void ieee80211_flush_queues(struct ieee80211_local *local,
                                        false);
 }
 
+void ieee80211_flush_queues(struct ieee80211_local *local,
+                           struct ieee80211_sub_if_data *sdata)
+{
+       __ieee80211_flush_queues(local, sdata, 0);
+}
+
 void ieee80211_stop_vif_queues(struct ieee80211_local *local,
                               struct ieee80211_sub_if_data *sdata,
                               enum queue_stop_reason reason)
This page took 0.028156 seconds and 5 git commands to generate.