From b869767b6f5049f1d1ede2bb3e48832e0722ca5a Mon Sep 17 00:00:00 2001 From: Ivo van Doorn Date: Fri, 6 Jun 2008 22:53:14 +0200 Subject: rt2x00: Don't kick TX queue after each frame TX queues shouldn't be kicked after each frame that is put into the queue. This could cause problems during RTS and CTS-to-self as well as with fragmentation. In all those cases you want all frames to be send out in a single burst. Off course we shouldn't let the queue fill up entirely, thus we introduce a 10% threshold which, when reached, will force the frames to be send out regardless of the frame. In addition we should prevent queues to become full in such a way that the tx() handler can fail. Instead of stopping the queue when it is full, we should stop it when it is below the threshold. Signed-off-by: Ivo van Doorn Signed-off-by: John W. Linville --- drivers/net/wireless/rt2x00/rt2x00queue.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.h') diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 303d5568470..623fc27dc7b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h @@ -82,12 +82,10 @@ enum data_queue_qid { /** * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc * - * @FRAME_DESC_DRIVER_GENERATED: Frame was generated inside driver - * and should not be reported back to mac80211 during txdone. */ -enum skb_frame_desc_flags { - FRAME_DESC_DRIVER_GENERATED = 1 << 0, -}; +//enum skb_frame_desc_flags { +// TEMPORARILY EMPTY +//}; /** * struct skb_frame_desc: Descriptor information for the skb buffer @@ -325,6 +323,7 @@ enum queue_index { * index corruption due to concurrency. * @count: Number of frames handled in the queue. * @limit: Maximum number of entries in the queue. + * @threshold: Minimum number of free entries before queue is kicked by force. * @length: Number of frames in queue. * @index: Index pointers to entry positions in the queue, * use &enum queue_index to get a specific index field. @@ -343,6 +342,7 @@ struct data_queue { spinlock_t lock; unsigned int count; unsigned short limit; + unsigned short threshold; unsigned short length; unsigned short index[Q_INDEX_MAX]; @@ -466,6 +466,15 @@ static inline int rt2x00queue_available(struct data_queue *queue) return queue->limit - queue->length; } +/** + * rt2x00queue_threshold - Check if the queue is below threshold + * @queue: Queue to check. + */ +static inline int rt2x00queue_threshold(struct data_queue *queue) +{ + return rt2x00queue_available(queue) < queue->threshold; +} + /** * rt2x00_desc_read - Read a word from the hardware descriptor. * @desc: Base descriptor address -- cgit v1.2.3