rt2x00: Queue handling overhaul

This introduces a big queue handling overhaul, this also
renames "ring" to "queues".

Move queue handling into rt2x00queue.c and the matching header,
use Kerneldoc to improve rt2x00 library documentation.

Access to the queues is now protected under a spinlock, this
to prevent race conditions which could corrupt the indexing
system of the queue.

Each queue entry allocates x bytes for driver/device specific data,
this cleans up the queue structure significantly and improves
code readability.

rt2500usb no longer needs 2 entries in the beacon queue to correctly
send out the guardian byte. This is now handled in the entry specific
structure.

rt61 and rt73 now use the correct descriptor size for beacon frames,
since this data is written into the registers not the entire TXD
descriptor was used but instead of a subset of it named TXINFO.

Finally this also fixes numerous other bugs related to incorrect
beacon handling or beacon related code.

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-02-05 16:42:23 -05:00
committed by John W. Linville
parent 811aa9cad1
commit 181d6902b6
22 changed files with 1883 additions and 1386 deletions

View File

@@ -97,15 +97,54 @@ int rt2x00pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
* TX data handlers.
*/
int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
struct data_ring *ring, struct sk_buff *skb,
struct data_queue *queue, struct sk_buff *skb,
struct ieee80211_tx_control *control);
/*
* RX/TX data handlers.
/**
* struct queue_entry_priv_pci_rx: Per RX entry PCI specific information
*
* @desc: Pointer to device descriptor.
* @data: Pointer to device's entry memory.
* @dma: DMA pointer to &data.
*/
struct queue_entry_priv_pci_rx {
__le32 *desc;
void *data;
dma_addr_t dma;
};
/**
* struct queue_entry_priv_pci_tx: Per TX entry PCI specific information
*
* @desc: Pointer to device descriptor
* @data: Pointer to device's entry memory.
* @dma: DMA pointer to &data.
* @control: mac80211 control structure used to transmit data.
*/
struct queue_entry_priv_pci_tx {
__le32 *desc;
void *data;
dma_addr_t dma;
struct ieee80211_tx_control control;
};
/**
* rt2x00pci_rxdone - Handle RX done events
* @rt2x00dev: Device pointer, see &struct rt2x00_dev.
*/
void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev);
void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct data_entry *entry,
const int tx_status, const int retry);
/**
* rt2x00pci_txdone - Handle TX done events
* @rt2x00dev: Device pointer, see &struct rt2x00_dev.
* @entry: Entry which has completed the transmission of a frame.
* @desc: TX done descriptor
*/
void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,
struct txdone_entry_desc *desc);
/*
* Device initialization handlers.