diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-08-23 13:53:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-25 14:34:54 -0400 |
commit | 933314582ee5db00123683cf4c4d713ec9add306 (patch) | |
tree | 6d0be156f19ad0f4b78da5577f56995beb43a15a /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 18c121d7558a550e8e48956fbd389759a850ab53 (diff) |
rt2x00: Simplify arguments to rt2x00 driver callback functions
write_tx_desc shouldn't pass a rt2x00dev and skb pointer,
instead it should use the same format as other TX frame
callback functions, which is passing the data_entry pointer
which contains all the information which is needed to work
on a TX frame.
Most callers of the kick_tx_queue and kill_tx_queue already
have the data_queue pointer, so rather then sending the QID
with the given function, when the driver requests a new
pointer to the data_queue, it is more efficient to just
send the data_queue pointer directly.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 4390f2b74b2e..af1c6914d7b4 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -571,12 +571,11 @@ static __le32 *rt2800pci_get_txwi(struct queue_entry *entry) | |||
571 | return (__le32 *) entry->skb->data; | 571 | return (__le32 *) entry->skb->data; |
572 | } | 572 | } |
573 | 573 | ||
574 | static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 574 | static void rt2800pci_write_tx_desc(struct queue_entry *entry, |
575 | struct sk_buff *skb, | ||
576 | struct txentry_desc *txdesc) | 575 | struct txentry_desc *txdesc) |
577 | { | 576 | { |
578 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 577 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); |
579 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | 578 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
580 | __le32 *txd = entry_priv->desc; | 579 | __le32 *txd = entry_priv->desc; |
581 | u32 word; | 580 | u32 word; |
582 | 581 | ||
@@ -596,7 +595,7 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
596 | rt2x00_desc_write(txd, 0, word); | 595 | rt2x00_desc_write(txd, 0, word); |
597 | 596 | ||
598 | rt2x00_desc_read(txd, 1, &word); | 597 | rt2x00_desc_read(txd, 1, &word); |
599 | rt2x00_set_field32(&word, TXD_W1_SD_LEN1, skb->len); | 598 | rt2x00_set_field32(&word, TXD_W1_SD_LEN1, entry->skb->len); |
600 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC1, | 599 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC1, |
601 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | 600 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); |
602 | rt2x00_set_field32(&word, TXD_W1_BURST, | 601 | rt2x00_set_field32(&word, TXD_W1_BURST, |
@@ -627,41 +626,35 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
627 | /* | 626 | /* |
628 | * TX data initialization | 627 | * TX data initialization |
629 | */ | 628 | */ |
630 | static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 629 | static void rt2800pci_kick_tx_queue(struct data_queue *queue) |
631 | const enum data_queue_qid queue_idx) | ||
632 | { | 630 | { |
633 | struct data_queue *queue; | 631 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; |
634 | unsigned int idx, qidx = 0; | 632 | unsigned int idx = queue->index[Q_INDEX]; |
635 | 633 | unsigned int qidx = 0; | |
636 | if (queue_idx > QID_HCCA && queue_idx != QID_MGMT) | ||
637 | return; | ||
638 | |||
639 | queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); | ||
640 | idx = queue->index[Q_INDEX]; | ||
641 | 634 | ||
642 | if (queue_idx == QID_MGMT) | 635 | if (queue->qid == QID_MGMT) |
643 | qidx = 5; | 636 | qidx = 5; |
644 | else | 637 | else |
645 | qidx = queue_idx; | 638 | qidx = queue->qid; |
646 | 639 | ||
647 | rt2800_register_write(rt2x00dev, TX_CTX_IDX(qidx), idx); | 640 | rt2800_register_write(rt2x00dev, TX_CTX_IDX(qidx), idx); |
648 | } | 641 | } |
649 | 642 | ||
650 | static void rt2800pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, | 643 | static void rt2800pci_kill_tx_queue(struct data_queue *queue) |
651 | const enum data_queue_qid qid) | ||
652 | { | 644 | { |
645 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
653 | u32 reg; | 646 | u32 reg; |
654 | 647 | ||
655 | if (qid == QID_BEACON) { | 648 | if (queue->qid == QID_BEACON) { |
656 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, 0); | 649 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, 0); |
657 | return; | 650 | return; |
658 | } | 651 | } |
659 | 652 | ||
660 | rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, ®); | 653 | rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, ®); |
661 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX0, (qid == QID_AC_BE)); | 654 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX0, (queue->qid == QID_AC_BE)); |
662 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX1, (qid == QID_AC_BK)); | 655 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX1, (queue->qid == QID_AC_BK)); |
663 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX2, (qid == QID_AC_VI)); | 656 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX2, (queue->qid == QID_AC_VI)); |
664 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX3, (qid == QID_AC_VO)); | 657 | rt2x00_set_field32(®, WPDMA_RST_IDX_DTX_IDX3, (queue->qid == QID_AC_VO)); |
665 | rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg); | 658 | rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg); |
666 | } | 659 | } |
667 | 660 | ||