diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 2e4f461406ae..89d132d4af12 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1165,15 +1165,15 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1165 | { | 1165 | { |
1166 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1166 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1167 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | 1167 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1168 | __le32 *txd = skbdesc->desc; | 1168 | __le32 *txd = entry_priv->desc; |
1169 | u32 word; | 1169 | u32 word; |
1170 | 1170 | ||
1171 | /* | 1171 | /* |
1172 | * Start writing the descriptor words. | 1172 | * Start writing the descriptor words. |
1173 | */ | 1173 | */ |
1174 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1174 | rt2x00_desc_read(txd, 1, &word); |
1175 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); | 1175 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); |
1176 | rt2x00_desc_write(entry_priv->desc, 1, word); | 1176 | rt2x00_desc_write(txd, 1, word); |
1177 | 1177 | ||
1178 | rt2x00_desc_read(txd, 2, &word); | 1178 | rt2x00_desc_read(txd, 2, &word); |
1179 | rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER); | 1179 | rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER); |
@@ -1194,6 +1194,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1194 | test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)); | 1194 | test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)); |
1195 | rt2x00_desc_write(txd, 10, word); | 1195 | rt2x00_desc_write(txd, 10, word); |
1196 | 1196 | ||
1197 | /* | ||
1198 | * Writing TXD word 0 must the last to prevent a race condition with | ||
1199 | * the device, whereby the device may take hold of the TXD before we | ||
1200 | * finished updating it. | ||
1201 | */ | ||
1197 | rt2x00_desc_read(txd, 0, &word); | 1202 | rt2x00_desc_read(txd, 0, &word); |
1198 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); | 1203 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); |
1199 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | 1204 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); |
@@ -1212,6 +1217,12 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1212 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | 1217 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); |
1213 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); | 1218 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); |
1214 | rt2x00_desc_write(txd, 0, word); | 1219 | rt2x00_desc_write(txd, 0, word); |
1220 | |||
1221 | /* | ||
1222 | * Register descriptor details in skb frame descriptor. | ||
1223 | */ | ||
1224 | skbdesc->desc = txd; | ||
1225 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1215 | } | 1226 | } |
1216 | 1227 | ||
1217 | /* | 1228 | /* |
@@ -1234,15 +1245,6 @@ static void rt2500pci_write_beacon(struct queue_entry *entry, | |||
1234 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | 1245 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); |
1235 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1246 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1236 | 1247 | ||
1237 | /* | ||
1238 | * Replace rt2x00lib allocated descriptor with the | ||
1239 | * pointer to the _real_ hardware descriptor. | ||
1240 | * After that, map the beacon to DMA and update the | ||
1241 | * descriptor. | ||
1242 | */ | ||
1243 | memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len); | ||
1244 | skbdesc->desc = entry_priv->desc; | ||
1245 | |||
1246 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); | 1248 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); |
1247 | 1249 | ||
1248 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1250 | rt2x00_desc_read(entry_priv->desc, 1, &word); |