diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-08-06 14:47:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 15:26:42 -0400 |
commit | 96481b20f4d6df7021867ae9a9deaa989ec32e40 (patch) | |
tree | 710709b3d4101a81f396d67054ce151573ada9ca /drivers/net/wireless/rt2x00/rt2800usb.c | |
parent | 0c5879bc62f9b8eb31520a86213466f3a68ec794 (diff) |
rt2x00: Implement TX status reporting for rt2800usb
The TX_STA_FIFO register which is used for per-frame TX frame
status reporting is also valid on rt2800usb. We can move the
rt2800pci_txdone function into rt2800lib where it can also
be used by rt2800usb.
rt2800usb needs to overwrite the txdone work handler to
a different function.
Both rt2800usb as rt2800_txdone need to take into account
that IO failures can occur while uploading the URB, which
means that when obtaining the new entry the IO status must
be checked.
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/rt2800usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 9084b9a36b57..9ad28be294eb 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com> | 2 | Copyright (C) 2010 Willow Garage <http://www.willowgarage.com> |
3 | Copyright (C) 2009 - 2010 Ivo van Doorn <IvDoorn@gmail.com> | ||
3 | Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de> | 4 | Copyright (C) 2009 Mattias Nissler <mattias.nissler@gmx.de> |
4 | Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> | 5 | Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> |
5 | Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com> | 6 | Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com> |
@@ -378,6 +379,38 @@ static int rt2800usb_get_tx_data_len(struct queue_entry *entry) | |||
378 | } | 379 | } |
379 | 380 | ||
380 | /* | 381 | /* |
382 | * TX control handlers | ||
383 | */ | ||
384 | static void rt2800usb_work_txdone(struct work_struct *work) | ||
385 | { | ||
386 | struct rt2x00_dev *rt2x00dev = | ||
387 | container_of(work, struct rt2x00_dev, txdone_work); | ||
388 | struct data_queue *queue; | ||
389 | struct queue_entry *entry; | ||
390 | |||
391 | rt2800_txdone(rt2x00dev); | ||
392 | |||
393 | /* | ||
394 | * Process any trailing TX status reports for IO failures, | ||
395 | * we loop until we find the first non-IO error entry. This | ||
396 | * can either be a frame which is free, is being uploaded, | ||
397 | * or has completed the upload but didn't have an entry | ||
398 | * in the TX_STAT_FIFO register yet. | ||
399 | */ | ||
400 | tx_queue_for_each(rt2x00dev, queue) { | ||
401 | while (!rt2x00queue_empty(queue)) { | ||
402 | entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | ||
403 | |||
404 | if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) || | ||
405 | !test_bit(ENTRY_DATA_IO_FAILED, &entry->flags)) | ||
406 | break; | ||
407 | |||
408 | rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE); | ||
409 | } | ||
410 | } | ||
411 | } | ||
412 | |||
413 | /* | ||
381 | * RX control handlers | 414 | * RX control handlers |
382 | */ | 415 | */ |
383 | static void rt2800usb_fill_rxdone(struct queue_entry *entry, | 416 | static void rt2800usb_fill_rxdone(struct queue_entry *entry, |
@@ -513,6 +546,11 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
513 | */ | 546 | */ |
514 | rt2x00dev->rssi_offset = DEFAULT_RSSI_OFFSET; | 547 | rt2x00dev->rssi_offset = DEFAULT_RSSI_OFFSET; |
515 | 548 | ||
549 | /* | ||
550 | * Overwrite TX done handler | ||
551 | */ | ||
552 | PREPARE_WORK(&rt2x00dev->txdone_work, rt2800usb_work_txdone); | ||
553 | |||
516 | return 0; | 554 | return 0; |
517 | } | 555 | } |
518 | 556 | ||