aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.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/rt2x00pci.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/rt2x00pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 62449da577e5..e33bd0f150c5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -36,20 +36,17 @@
36 */ 36 */
37int rt2x00pci_write_tx_data(struct queue_entry *entry) 37int rt2x00pci_write_tx_data(struct queue_entry *entry)
38{ 38{
39 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
39 struct queue_entry_priv_pci *entry_priv = entry->priv_data; 40 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
40 struct skb_frame_desc *skbdesc; 41 struct skb_frame_desc *skbdesc;
41 u32 word;
42
43 rt2x00_desc_read(entry_priv->desc, 0, &word);
44 42
45 /* 43 /*
46 * This should not happen, we already checked the entry 44 * This should not happen, we already checked the entry
47 * was ours. When the hardware disagrees there has been 45 * was ours. When the hardware disagrees there has been
48 * a queue corruption! 46 * a queue corruption!
49 */ 47 */
50 if (unlikely(rt2x00_get_field32(word, TXD_ENTRY_OWNER_NIC) || 48 if (unlikely(rt2x00dev->ops->lib->get_entry_state(entry))) {
51 rt2x00_get_field32(word, TXD_ENTRY_VALID))) { 49 ERROR(rt2x00dev,
52 ERROR(entry->queue->rt2x00dev,
53 "Corrupt queue %d, accessing entry which is not ours.\n" 50 "Corrupt queue %d, accessing entry which is not ours.\n"
54 "Please file bug report to %s.\n", 51 "Please file bug report to %s.\n",
55 entry->queue->qid, DRV_PROJECT); 52 entry->queue->qid, DRV_PROJECT);
@@ -76,14 +73,12 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
76 struct queue_entry *entry; 73 struct queue_entry *entry;
77 struct queue_entry_priv_pci *entry_priv; 74 struct queue_entry_priv_pci *entry_priv;
78 struct skb_frame_desc *skbdesc; 75 struct skb_frame_desc *skbdesc;
79 u32 word;
80 76
81 while (1) { 77 while (1) {
82 entry = rt2x00queue_get_entry(queue, Q_INDEX); 78 entry = rt2x00queue_get_entry(queue, Q_INDEX);
83 entry_priv = entry->priv_data; 79 entry_priv = entry->priv_data;
84 rt2x00_desc_read(entry_priv->desc, 0, &word);
85 80
86 if (rt2x00_get_field32(word, RXD_ENTRY_OWNER_NIC)) 81 if (rt2x00dev->ops->lib->get_entry_state(entry))
87 break; 82 break;
88 83
89 /* 84 /*