diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 6126c0ab5880..4ba7b038928f 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1007,15 +1007,15 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1007 | { | 1007 | { |
1008 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1008 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1009 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | 1009 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1010 | __le32 *txd = skbdesc->desc; | 1010 | __le32 *txd = entry_priv->desc; |
1011 | u32 word; | 1011 | u32 word; |
1012 | 1012 | ||
1013 | /* | 1013 | /* |
1014 | * Start writing the descriptor words. | 1014 | * Start writing the descriptor words. |
1015 | */ | 1015 | */ |
1016 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1016 | rt2x00_desc_read(txd, 1, &word); |
1017 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); | 1017 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); |
1018 | rt2x00_desc_write(entry_priv->desc, 1, word); | 1018 | rt2x00_desc_write(txd, 1, word); |
1019 | 1019 | ||
1020 | rt2x00_desc_read(txd, 2, &word); | 1020 | rt2x00_desc_read(txd, 2, &word); |
1021 | rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); | 1021 | rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); |
@@ -1040,6 +1040,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1040 | rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_HIGH_BUSY, 1); | 1040 | rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_HIGH_BUSY, 1); |
1041 | rt2x00_desc_write(txd, 4, word); | 1041 | rt2x00_desc_write(txd, 4, word); |
1042 | 1042 | ||
1043 | /* | ||
1044 | * Writing TXD word 0 must the last to prevent a race condition with | ||
1045 | * the device, whereby the device may take hold of the TXD before we | ||
1046 | * finished updating it. | ||
1047 | */ | ||
1043 | rt2x00_desc_read(txd, 0, &word); | 1048 | rt2x00_desc_read(txd, 0, &word); |
1044 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); | 1049 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); |
1045 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | 1050 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); |
@@ -1055,6 +1060,12 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1055 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | 1060 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, |
1056 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | 1061 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); |
1057 | rt2x00_desc_write(txd, 0, word); | 1062 | rt2x00_desc_write(txd, 0, word); |
1063 | |||
1064 | /* | ||
1065 | * Register descriptor details in skb frame descriptor. | ||
1066 | */ | ||
1067 | skbdesc->desc = txd; | ||
1068 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1058 | } | 1069 | } |
1059 | 1070 | ||
1060 | /* | 1071 | /* |
@@ -1077,15 +1088,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry, | |||
1077 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | 1088 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); |
1078 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1089 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1079 | 1090 | ||
1080 | /* | ||
1081 | * Replace rt2x00lib allocated descriptor with the | ||
1082 | * pointer to the _real_ hardware descriptor. | ||
1083 | * After that, map the beacon to DMA and update the | ||
1084 | * descriptor. | ||
1085 | */ | ||
1086 | memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len); | ||
1087 | skbdesc->desc = entry_priv->desc; | ||
1088 | |||
1089 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); | 1091 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); |
1090 | 1092 | ||
1091 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1093 | rt2x00_desc_read(entry_priv->desc, 1, &word); |