aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-12-13 06:35:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 15:23:35 -0500
commit5be65609fec2e331c7d804471be3d59089a30d98 (patch)
tree6c6967c7835d6ec3a8ce79c2c9b84bf95aefca31 /drivers/net/wireless/rt2x00/rt2x00mac.c
parent0b7fde54f94979edc67bbf86b5adba702ebfefe8 (diff)
rt2x00: Add "flush" queue command
Add a new command to the queue handlers: "flush", this moves the flush() callback from mac80211 into rt2x00queue and adds support for flushing the RX queue as well. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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);