Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: add specific-queue flushing support

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>

authored by

Liad Kaufman and committed by
Johannes Berg
4f9610d5 8a4d32f3

+18 -5
+3
net/mac80211/ieee80211_i.h
··· 1881 1881 struct sk_buff_head *skbs); 1882 1882 void ieee80211_flush_queues(struct ieee80211_local *local, 1883 1883 struct ieee80211_sub_if_data *sdata); 1884 + void __ieee80211_flush_queues(struct ieee80211_local *local, 1885 + struct ieee80211_sub_if_data *sdata, 1886 + unsigned int queues); 1884 1887 1885 1888 void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 1886 1889 u16 transaction, u16 auth_alg, u16 status,
+15 -5
net/mac80211/util.c
··· 576 576 return queues; 577 577 } 578 578 579 - void ieee80211_flush_queues(struct ieee80211_local *local, 580 - struct ieee80211_sub_if_data *sdata) 579 + void __ieee80211_flush_queues(struct ieee80211_local *local, 580 + struct ieee80211_sub_if_data *sdata, 581 + unsigned int queues) 581 582 { 582 - unsigned int queues; 583 - 584 583 if (!local->ops->flush) 585 584 return; 586 585 587 - queues = ieee80211_get_vif_queues(local, sdata); 586 + /* 587 + * If no queue was set, or if the HW doesn't support 588 + * IEEE80211_HW_QUEUE_CONTROL - flush all queues 589 + */ 590 + if (!queues || !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)) 591 + queues = ieee80211_get_vif_queues(local, sdata); 588 592 589 593 ieee80211_stop_queues_by_reason(&local->hw, queues, 590 594 IEEE80211_QUEUE_STOP_REASON_FLUSH, ··· 599 595 ieee80211_wake_queues_by_reason(&local->hw, queues, 600 596 IEEE80211_QUEUE_STOP_REASON_FLUSH, 601 597 false); 598 + } 599 + 600 + void ieee80211_flush_queues(struct ieee80211_local *local, 601 + struct ieee80211_sub_if_data *sdata) 602 + { 603 + __ieee80211_flush_queues(local, sdata, 0); 602 604 } 603 605 604 606 void ieee80211_stop_vif_queues(struct ieee80211_local *local,