aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-12-13 06:36:00 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 15:23:36 -0500
commit64e7d72384c2ecef5a892b2243623af265dd83cc (patch)
treebb53909aa80bea1a42a25fe7899087419579f130 /drivers
parent5be65609fec2e331c7d804471be3d59089a30d98 (diff)
rt2x00: Cleanup RX index counting
Add the rt2x00_dmastart function to rt2x00lib which marks the queue_entry as "owned by device", and increased the Q_INDEX number. This cleanups up the index handling by rt2x00lib which at until so far used hackish approaches to keep the RX queue index numbering sane. The rt2x00pci.c changes are from Helmut Schaa Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c7
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c2
5 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 1d7b481ec357..28ea59ab2b06 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1171,6 +1171,7 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
1171 */ 1171 */
1172void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev); 1172void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
1173void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev); 1173void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev);
1174void rt2x00lib_dmastart(struct queue_entry *entry);
1174void rt2x00lib_dmadone(struct queue_entry *entry); 1175void rt2x00lib_dmadone(struct queue_entry *entry);
1175void rt2x00lib_txdone(struct queue_entry *entry, 1176void rt2x00lib_txdone(struct queue_entry *entry,
1176 struct txdone_entry_desc *txdesc); 1177 struct txdone_entry_desc *txdesc);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9ef5a2468216..3d4c61fcf06f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -226,6 +226,13 @@ void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev)
226} 226}
227EXPORT_SYMBOL_GPL(rt2x00lib_pretbtt); 227EXPORT_SYMBOL_GPL(rt2x00lib_pretbtt);
228 228
229void rt2x00lib_dmastart(struct queue_entry *entry)
230{
231 set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
232 rt2x00queue_index_inc(entry->queue, Q_INDEX);
233}
234EXPORT_SYMBOL_GPL(rt2x00lib_dmastart);
235
229void rt2x00lib_dmadone(struct queue_entry *entry) 236void rt2x00lib_dmadone(struct queue_entry *entry)
230{ 237{
231 clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 238 clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
@@ -555,10 +562,8 @@ submit_entry:
555 entry->flags = 0; 562 entry->flags = 0;
556 rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE); 563 rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE);
557 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && 564 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
558 test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) { 565 test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
559 rt2x00dev->ops->lib->clear_entry(entry); 566 rt2x00dev->ops->lib->clear_entry(entry);
560 rt2x00queue_index_inc(entry->queue, Q_INDEX);
561 }
562} 567}
563EXPORT_SYMBOL_GPL(rt2x00lib_rxdone); 568EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);
564 569
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 868ca19b13ea..28e6ff1a6694 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -82,6 +82,13 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
82 skbdesc->desc_len = entry->queue->desc_size; 82 skbdesc->desc_len = entry->queue->desc_size;
83 83
84 /* 84 /*
85 * DMA is already done, notify rt2x00lib that
86 * it finished successfully.
87 */
88 rt2x00lib_dmastart(entry);
89 rt2x00lib_dmadone(entry);
90
91 /*
85 * Send the frame to rt2x00lib for further processing. 92 * Send the frame to rt2x00lib for further processing.
86 */ 93 */
87 rt2x00lib_rxdone(entry); 94 rt2x00lib_rxdone(entry);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 313a8faa5fa4..52cc92d426f3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -968,11 +968,8 @@ void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev)
968 queue_for_each(rt2x00dev, queue) { 968 queue_for_each(rt2x00dev, queue) {
969 rt2x00queue_reset(queue); 969 rt2x00queue_reset(queue);
970 970
971 for (i = 0; i < queue->limit; i++) { 971 for (i = 0; i < queue->limit; i++)
972 rt2x00dev->ops->lib->clear_entry(&queue->entries[i]); 972 rt2x00dev->ops->lib->clear_entry(&queue->entries[i]);
973 if (queue->qid == QID_RX)
974 rt2x00queue_index_inc(queue, Q_INDEX);
975 }
976 } 973 }
977} 974}
978 975
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index cd80eec5ff51..cd29ebc8a37b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -330,6 +330,8 @@ static void rt2x00usb_kick_rx_entry(struct queue_entry *entry)
330 if (test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) 330 if (test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
331 return; 331 return;
332 332
333 rt2x00lib_dmastart(entry);
334
333 usb_fill_bulk_urb(entry_priv->urb, usb_dev, 335 usb_fill_bulk_urb(entry_priv->urb, usb_dev,
334 usb_rcvbulkpipe(usb_dev, entry->queue->usb_endpoint), 336 usb_rcvbulkpipe(usb_dev, entry->queue->usb_endpoint),
335 entry->skb->data, entry->skb->len, 337 entry->skb->data, entry->skb->len,