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>
This commit is contained in:
Ivo van Doorn
2008-11-08 15:25:33 +01:00
committed by John W. Linville
parent 0ed94eaaed
commit 798b7adb4e
13 changed files with 142 additions and 150 deletions

View File

@ -589,40 +589,18 @@ static void rt2x00queue_reset(struct data_queue *queue)
spin_unlock_irqrestore(&queue->lock, irqflags);
}
void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev)
{
struct data_queue *queue = rt2x00dev->rx;
unsigned int i;
rt2x00queue_reset(queue);
if (!rt2x00dev->ops->lib->init_rxentry)
return;
for (i = 0; i < queue->limit; i++) {
queue->entries[i].flags = 0;
rt2x00dev->ops->lib->init_rxentry(rt2x00dev,
&queue->entries[i]);
}
}
void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev)
void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev)
{
struct data_queue *queue;
unsigned int i;
txall_queue_for_each(rt2x00dev, queue) {
queue_for_each(rt2x00dev, queue) {
rt2x00queue_reset(queue);
if (!rt2x00dev->ops->lib->init_txentry)
continue;
for (i = 0; i < queue->limit; i++) {
queue->entries[i].flags = 0;
rt2x00dev->ops->lib->init_txentry(rt2x00dev,
&queue->entries[i]);
rt2x00dev->ops->lib->clear_entry(&queue->entries[i]);
}
}
}