aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800lib.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2011-05-18 14:25:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-01 15:10:59 -0400
commit8f66bbb5248c59b69b521b35e097ffa6cad07f01 (patch)
tree4e024ecdebdd9fa98aa1151a8402ad10e2c8ec17 /drivers/net/wireless/rt2x00/rt2800lib.c
parent798eefde3097f218849194f1abda1f179a169cc2 (diff)
rt2x00: Move rt2800_txdone and rt2800_txdone_entry_check to rt2800usb.
These two functions are only used by rt2800usb so they don't have to be in rt2800lib. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> 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/rt2800lib.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f0988d8736c3..75d2c6cc93eb 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -601,49 +601,6 @@ void rt2800_process_rxwi(struct queue_entry *entry,
601} 601}
602EXPORT_SYMBOL_GPL(rt2800_process_rxwi); 602EXPORT_SYMBOL_GPL(rt2800_process_rxwi);
603 603
604static bool rt2800_txdone_entry_check(struct queue_entry *entry, u32 reg)
605{
606 __le32 *txwi;
607 u32 word;
608 int wcid, ack, pid;
609 int tx_wcid, tx_ack, tx_pid;
610
611 wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
612 ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
613 pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
614
615 /*
616 * This frames has returned with an IO error,
617 * so the status report is not intended for this
618 * frame.
619 */
620 if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags)) {
621 rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
622 return false;
623 }
624
625 /*
626 * Validate if this TX status report is intended for
627 * this entry by comparing the WCID/ACK/PID fields.
628 */
629 txwi = rt2800_drv_get_txwi(entry);
630
631 rt2x00_desc_read(txwi, 1, &word);
632 tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
633 tx_ack = rt2x00_get_field32(word, TXWI_W1_ACK);
634 tx_pid = rt2x00_get_field32(word, TXWI_W1_PACKETID);
635
636 if ((wcid != tx_wcid) || (ack != tx_ack) || (pid != tx_pid)) {
637 WARNING(entry->queue->rt2x00dev,
638 "TX status report missed for queue %d entry %d\n",
639 entry->queue->qid, entry->entry_idx);
640 rt2x00lib_txdone_noinfo(entry, TXDONE_UNKNOWN);
641 return false;
642 }
643
644 return true;
645}
646
647void rt2800_txdone_entry(struct queue_entry *entry, u32 status) 604void rt2800_txdone_entry(struct queue_entry *entry, u32 status)
648{ 605{
649 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 606 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
@@ -726,45 +683,6 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status)
726} 683}
727EXPORT_SYMBOL_GPL(rt2800_txdone_entry); 684EXPORT_SYMBOL_GPL(rt2800_txdone_entry);
728 685
729void rt2800_txdone(struct rt2x00_dev *rt2x00dev)
730{
731 struct data_queue *queue;
732 struct queue_entry *entry;
733 u32 reg;
734 u8 qid;
735
736 while (kfifo_get(&rt2x00dev->txstatus_fifo, &reg)) {
737
738 /* TX_STA_FIFO_PID_QUEUE is a 2-bit field, thus
739 * qid is guaranteed to be one of the TX QIDs
740 */
741 qid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_QUEUE);
742 queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
743 if (unlikely(!queue)) {
744 WARNING(rt2x00dev, "Got TX status for an unavailable "
745 "queue %u, dropping\n", qid);
746 continue;
747 }
748
749 /*
750 * Inside each queue, we process each entry in a chronological
751 * order. We first check that the queue is not empty.
752 */
753 entry = NULL;
754 while (!rt2x00queue_empty(queue)) {
755 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
756 if (rt2800_txdone_entry_check(entry, reg))
757 break;
758 }
759
760 if (!entry || rt2x00queue_empty(queue))
761 break;
762
763 rt2800_txdone_entry(entry, reg);
764 }
765}
766EXPORT_SYMBOL_GPL(rt2800_txdone);
767
768void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc) 686void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
769{ 687{
770 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 688 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;