diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-06-22 10:31:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-24 14:44:25 -0400 |
commit | a53aff5da60b5c8c4d416f80040e6e7edb7f12df (patch) | |
tree | d1f502ad7eae103246f725fb29b3a72d1c564d88 /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 0a6f3a8ebaf13407523c2c7d575b4ca2debd23ba (diff) |
rt2x00: rt2800pci: don't use TXWI_DESC_SIZE directly
Different chipsets may use different TXWI descriptor
size. Instead of using a hardcoded value, use the
'queue->winfo_size' which holds the correct value for
a given device.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
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 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 7c7478219bbc..e66491829507 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry, | |||
637 | struct queue_entry_priv_mmio *entry_priv = entry->priv_data; | 637 | struct queue_entry_priv_mmio *entry_priv = entry->priv_data; |
638 | __le32 *txd = entry_priv->desc; | 638 | __le32 *txd = entry_priv->desc; |
639 | u32 word; | 639 | u32 word; |
640 | const unsigned int txwi_size = entry->queue->winfo_size; | ||
640 | 641 | ||
641 | /* | 642 | /* |
642 | * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1 | 643 | * The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1 |
@@ -659,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry, | |||
659 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | 660 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); |
660 | rt2x00_set_field32(&word, TXD_W1_BURST, | 661 | rt2x00_set_field32(&word, TXD_W1_BURST, |
661 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 662 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
662 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE); | 663 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size); |
663 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); | 664 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); |
664 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); | 665 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); |
665 | rt2x00_desc_write(txd, 1, word); | 666 | rt2x00_desc_write(txd, 1, word); |
666 | 667 | ||
667 | word = 0; | 668 | word = 0; |
668 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, | 669 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, |
669 | skbdesc->skb_dma + TXWI_DESC_SIZE); | 670 | skbdesc->skb_dma + txwi_size); |
670 | rt2x00_desc_write(txd, 2, word); | 671 | rt2x00_desc_write(txd, 2, word); |
671 | 672 | ||
672 | word = 0; | 673 | word = 0; |