aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index c4abb204aeda..4cac7ad60f47 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -718,36 +718,8 @@ void rt2x00mac_flush(struct ieee80211_hw *hw, bool drop)
718{ 718{
719 struct rt2x00_dev *rt2x00dev = hw->priv; 719 struct rt2x00_dev *rt2x00dev = hw->priv;
720 struct data_queue *queue; 720 struct data_queue *queue;
721 unsigned int i = 0;
722 721
723 ieee80211_stop_queues(hw); 722 tx_queue_for_each(rt2x00dev, queue)
724 723 rt2x00queue_flush_queue(queue, drop);
725 /*
726 * Run over all queues to kick them, this will force
727 * any pending frames to be transmitted.
728 */
729 tx_queue_for_each(rt2x00dev, queue) {
730 rt2x00dev->ops->lib->kick_queue(queue);
731 }
732
733 /**
734 * All queues have been kicked, now wait for each queue
735 * to become empty. With a bit of luck, we only have to wait
736 * for the first queue to become empty, because while waiting
737 * for the that queue, the other queues will have transmitted
738 * all their frames as well (since they were already kicked).
739 */
740 tx_queue_for_each(rt2x00dev, queue) {
741 for (i = 0; i < 10; i++) {
742 if (rt2x00queue_empty(queue))
743 break;
744 msleep(100);
745 }
746
747 if (!rt2x00queue_empty(queue))
748 WARNING(rt2x00dev, "Failed to flush queue %d\n", queue->qid);
749 }
750
751 ieee80211_wake_queues(hw);
752} 724}
753EXPORT_SYMBOL_GPL(rt2x00mac_flush); 725EXPORT_SYMBOL_GPL(rt2x00mac_flush);