提交 a53aff5d 编写于 作者: G Gabor Juhos 提交者: John W. Linville

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: NGabor Juhos <juhosg@openwrt.org>
Acked-by: NStanislaw Gruszka <stf_xl@wp.pl>
Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 0a6f3a8e
...@@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry, ...@@ -637,6 +637,7 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
struct queue_entry_priv_mmio *entry_priv = entry->priv_data; struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
__le32 *txd = entry_priv->desc; __le32 *txd = entry_priv->desc;
u32 word; u32 word;
const unsigned int txwi_size = entry->queue->winfo_size;
/* /*
* The buffers pointed by SD_PTR0/SD_LEN0 and SD_PTR1/SD_LEN1 * 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,14 +660,14 @@ static void rt2800pci_write_tx_desc(struct queue_entry *entry,
!test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W1_BURST, rt2x00_set_field32(&word, TXD_W1_BURST,
test_bit(ENTRY_TXD_BURST, &txdesc->flags)); test_bit(ENTRY_TXD_BURST, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE); rt2x00_set_field32(&word, TXD_W1_SD_LEN0, txwi_size);
rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
rt2x00_desc_write(txd, 1, word); rt2x00_desc_write(txd, 1, word);
word = 0; word = 0;
rt2x00_set_field32(&word, TXD_W2_SD_PTR1, rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
skbdesc->skb_dma + TXWI_DESC_SIZE); skbdesc->skb_dma + txwi_size);
rt2x00_desc_write(txd, 2, word); rt2x00_desc_write(txd, 2, word);
word = 0; word = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册