aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2400pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-17 11:33:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:22 -0500
commit30b3a23c2594e122e7086f97b5252a87eaf8a817 (patch)
tree6c97b928fce785471236543fe71bce3b6d0324cb /drivers/net/wireless/rt2x00/rt2400pci.c
parente542239f639fa4e7b13a949d39d44ff1eccf7e3a (diff)
rt2x00: Fix Descriptor DMA initialization
As Adam Baker reported the DMA address for the descriptor base was incorrectly initialized in the PCI drivers. Instead of the DMA base for the descriptor, the DMA base for the data was passed resulting in a broken TX/RX state for PCI drivers. 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/rt2400pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 52ccb85fed65..28663c00b770 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -597,11 +597,12 @@ static void rt2400pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
597 u32 word; 597 u32 word;
598 598
599 rt2x00_desc_read(priv_rx->desc, 2, &word); 599 rt2x00_desc_read(priv_rx->desc, 2, &word);
600 rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH, entry->queue->data_size); 600 rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH,
601 entry->queue->data_size);
601 rt2x00_desc_write(priv_rx->desc, 2, word); 602 rt2x00_desc_write(priv_rx->desc, 2, word);
602 603
603 rt2x00_desc_read(priv_rx->desc, 1, &word); 604 rt2x00_desc_read(priv_rx->desc, 1, &word);
604 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, priv_rx->dma); 605 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, priv_rx->data_dma);
605 rt2x00_desc_write(priv_rx->desc, 1, word); 606 rt2x00_desc_write(priv_rx->desc, 1, word);
606 607
607 rt2x00_desc_read(priv_rx->desc, 0, &word); 608 rt2x00_desc_read(priv_rx->desc, 0, &word);
@@ -616,7 +617,7 @@ static void rt2400pci_init_txentry(struct rt2x00_dev *rt2x00dev,
616 u32 word; 617 u32 word;
617 618
618 rt2x00_desc_read(priv_tx->desc, 1, &word); 619 rt2x00_desc_read(priv_tx->desc, 1, &word);
619 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, priv_tx->dma); 620 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, priv_tx->data_dma);
620 rt2x00_desc_write(priv_tx->desc, 1, word); 621 rt2x00_desc_write(priv_tx->desc, 1, word);
621 622
622 rt2x00_desc_read(priv_tx->desc, 2, &word); 623 rt2x00_desc_read(priv_tx->desc, 2, &word);
@@ -648,22 +649,26 @@ static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev)
648 649
649 priv_tx = rt2x00dev->tx[1].entries[0].priv_data; 650 priv_tx = rt2x00dev->tx[1].entries[0].priv_data;
650 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg); 651 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg);
651 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER, priv_tx->dma); 652 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER,
653 priv_tx->desc_dma);
652 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg); 654 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg);
653 655
654 priv_tx = rt2x00dev->tx[0].entries[0].priv_data; 656 priv_tx = rt2x00dev->tx[0].entries[0].priv_data;
655 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg); 657 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg);
656 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER, priv_tx->dma); 658 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER,
659 priv_tx->desc_dma);
657 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg); 660 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg);
658 661
659 priv_tx = rt2x00dev->bcn[1].entries[0].priv_data; 662 priv_tx = rt2x00dev->bcn[1].entries[0].priv_data;
660 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg); 663 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg);
661 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER, priv_tx->dma); 664 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER,
665 priv_tx->desc_dma);
662 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg); 666 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg);
663 667
664 priv_tx = rt2x00dev->bcn[0].entries[0].priv_data; 668 priv_tx = rt2x00dev->bcn[0].entries[0].priv_data;
665 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg); 669 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg);
666 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER, priv_tx->dma); 670 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER,
671 priv_tx->desc_dma);
667 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg); 672 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg);
668 673
669 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg); 674 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg);
@@ -673,7 +678,7 @@ static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev)
673 678
674 priv_rx = rt2x00dev->rx->entries[0].priv_data; 679 priv_rx = rt2x00dev->rx->entries[0].priv_data;
675 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg); 680 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg);
676 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER, priv_tx->dma); 681 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER, priv_tx->desc_dma);
677 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg); 682 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg);
678 683
679 return 0; 684 return 0;