aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index df8817fed09e..0d79278a0a19 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -849,7 +849,6 @@ EXPORT_SYMBOL_GPL(rt2x00queue_stop_queue);
849 849
850void rt2x00queue_flush_queue(struct data_queue *queue, bool drop) 850void rt2x00queue_flush_queue(struct data_queue *queue, bool drop)
851{ 851{
852 unsigned int i;
853 bool started; 852 bool started;
854 bool tx_queue = 853 bool tx_queue =
855 (queue->qid == QID_AC_VO) || 854 (queue->qid == QID_AC_VO) ||
@@ -884,20 +883,12 @@ void rt2x00queue_flush_queue(struct data_queue *queue, bool drop)
884 } 883 }
885 884
886 /* 885 /*
887 * Check if driver supports flushing, we can only guarentee 886 * Check if driver supports flushing, if that is the case we can
888 * full support for flushing if the driver is able 887 * defer the flushing to the driver. Otherwise we must use the
889 * to cancel all pending frames (drop = true). 888 * alternative which just waits for the queue to become empty.
890 */
891 if (drop && queue->rt2x00dev->ops->lib->flush_queue)
892 queue->rt2x00dev->ops->lib->flush_queue(queue);
893
894 /*
895 * When we don't want to drop any frames, or when
896 * the driver doesn't fully flush the queue correcly,
897 * we must wait for the queue to become empty.
898 */ 889 */
899 for (i = 0; !rt2x00queue_empty(queue) && i < 100; i++) 890 if (likely(queue->rt2x00dev->ops->lib->flush_queue))
900 msleep(10); 891 queue->rt2x00dev->ops->lib->flush_queue(queue, drop);
901 892
902 /* 893 /*
903 * The queue flush has failed... 894 * The queue flush has failed...