aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-05-09 15:24:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-10 14:56:49 -0400
commit6295d81552f4b58256a9f7d85ce630b862598753 (patch)
treeaa7d27cd8686d51f577f70ca137e50ceab87e4fd /drivers/net/wireless/rt2x00
parent3b9f0ed78cf2eb678edd60d74a4a36f5947d003d (diff)
rt2x00: Clean up generic procedures on descriptor writing.
With a little bit of restructuring it isn't necessary to have special cases in rt2x00queue_write_tx_descriptor for writing the descriptor for beacons. Simply split off the kicking of the TX queue to a separate function with is only called for non-beacons. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 12ec68577f99..97b2c7650656 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -428,20 +428,23 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
428 * it is now ready to be dumped to userspace through debugfs. 428 * it is now ready to be dumped to userspace through debugfs.
429 */ 429 */
430 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb); 430 rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb);
431}
432
433static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
434 struct txentry_desc *txdesc)
435{
436 struct data_queue *queue = entry->queue;
437 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
431 438
432 /* 439 /*
433 * Check if we need to kick the queue, there are however a few rules 440 * Check if we need to kick the queue, there are however a few rules
434 * 1) Don't kick beacon queue 441 * 1) Don't kick unless this is the last in frame in a burst.
435 * 2) Don't kick unless this is the last in frame in a burst.
436 * When the burst flag is set, this frame is always followed 442 * When the burst flag is set, this frame is always followed
437 * by another frame which in some way are related to eachother. 443 * by another frame which in some way are related to eachother.
438 * This is true for fragments, RTS or CTS-to-self frames. 444 * This is true for fragments, RTS or CTS-to-self frames.
439 * 3) Rule 2 can be broken when the available entries 445 * 2) Rule 1 can be broken when the available entries
440 * in the queue are less then a certain threshold. 446 * in the queue are less then a certain threshold.
441 */ 447 */
442 if (entry->queue->qid == QID_BEACON)
443 return;
444
445 if (rt2x00queue_threshold(queue) || 448 if (rt2x00queue_threshold(queue) ||
446 !test_bit(ENTRY_TXD_BURST, &txdesc->flags)) 449 !test_bit(ENTRY_TXD_BURST, &txdesc->flags))
447 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid); 450 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid);
@@ -537,6 +540,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
537 540
538 rt2x00queue_index_inc(queue, Q_INDEX); 541 rt2x00queue_index_inc(queue, Q_INDEX);
539 rt2x00queue_write_tx_descriptor(entry, &txdesc); 542 rt2x00queue_write_tx_descriptor(entry, &txdesc);
543 rt2x00queue_kick_tx_queue(entry, &txdesc);
540 544
541 return 0; 545 return 0;
542} 546}