aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-11-08 09:25:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-21 11:08:16 -0500
commit798b7adb4ed3533ab1282f51d16892034cfd8aae (patch)
treeef328809a04c1072e9b1ce765d01f470283d4842 /drivers/net/wireless/rt2x00/rt2x00queue.c
parent0ed94eaaed618634f68197161203aac9f849471e (diff)
rt2x00: Cleanup TX/RX entry handling
Merge the callback functions init_txentry() and init_rxentry(). This makes life in rt2x00lib a lot simpler and we can cleanup several functions. rt2x00pci contained "fake" FIELD definitions for descriptor words. This is not flexible since it assumes the driver will always have the same field to indicate if a driver is available or not. This should be dependent on the driver, and we should add a callback function for this. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index e9f4261054bc..7fc9c6eff98b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -589,40 +589,18 @@ static void rt2x00queue_reset(struct data_queue *queue)
589 spin_unlock_irqrestore(&queue->lock, irqflags); 589 spin_unlock_irqrestore(&queue->lock, irqflags);
590} 590}
591 591
592void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev) 592void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev)
593{
594 struct data_queue *queue = rt2x00dev->rx;
595 unsigned int i;
596
597 rt2x00queue_reset(queue);
598
599 if (!rt2x00dev->ops->lib->init_rxentry)
600 return;
601
602 for (i = 0; i < queue->limit; i++) {
603 queue->entries[i].flags = 0;
604
605 rt2x00dev->ops->lib->init_rxentry(rt2x00dev,
606 &queue->entries[i]);
607 }
608}
609
610void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev)
611{ 593{
612 struct data_queue *queue; 594 struct data_queue *queue;
613 unsigned int i; 595 unsigned int i;
614 596
615 txall_queue_for_each(rt2x00dev, queue) { 597 queue_for_each(rt2x00dev, queue) {
616 rt2x00queue_reset(queue); 598 rt2x00queue_reset(queue);
617 599
618 if (!rt2x00dev->ops->lib->init_txentry)
619 continue;
620
621 for (i = 0; i < queue->limit; i++) { 600 for (i = 0; i < queue->limit; i++) {
622 queue->entries[i].flags = 0; 601 queue->entries[i].flags = 0;
623 602
624 rt2x00dev->ops->lib->init_txentry(rt2x00dev, 603 rt2x00dev->ops->lib->clear_entry(&queue->entries[i]);
625 &queue->entries[i]);
626 } 604 }
627 } 605 }
628} 606}