diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 21 |
10 files changed, 72 insertions, 81 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 1eff6ec88457..def3fa45ae7a 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1006,15 +1006,15 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1006 | { | 1006 | { |
1007 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1007 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1008 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | 1008 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1009 | __le32 *txd = skbdesc->desc; | 1009 | __le32 *txd = entry_priv->desc; |
1010 | u32 word; | 1010 | u32 word; |
1011 | 1011 | ||
1012 | /* | 1012 | /* |
1013 | * Start writing the descriptor words. | 1013 | * Start writing the descriptor words. |
1014 | */ | 1014 | */ |
1015 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1015 | rt2x00_desc_read(txd, 1, &word); |
1016 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); | 1016 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); |
1017 | rt2x00_desc_write(entry_priv->desc, 1, word); | 1017 | rt2x00_desc_write(txd, 1, word); |
1018 | 1018 | ||
1019 | rt2x00_desc_read(txd, 2, &word); | 1019 | rt2x00_desc_read(txd, 2, &word); |
1020 | rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); | 1020 | rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length); |
@@ -1059,6 +1059,12 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1059 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | 1059 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, |
1060 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | 1060 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); |
1061 | rt2x00_desc_write(txd, 0, word); | 1061 | rt2x00_desc_write(txd, 0, word); |
1062 | |||
1063 | /* | ||
1064 | * Register descriptor details in skb frame descriptor. | ||
1065 | */ | ||
1066 | skbdesc->desc = txd; | ||
1067 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1062 | } | 1068 | } |
1063 | 1069 | ||
1064 | /* | 1070 | /* |
@@ -1081,15 +1087,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry, | |||
1081 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | 1087 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); |
1082 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1088 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1083 | 1089 | ||
1084 | /* | ||
1085 | * Replace rt2x00lib allocated descriptor with the | ||
1086 | * pointer to the _real_ hardware descriptor. | ||
1087 | * After that, map the beacon to DMA and update the | ||
1088 | * descriptor. | ||
1089 | */ | ||
1090 | memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len); | ||
1091 | skbdesc->desc = entry_priv->desc; | ||
1092 | |||
1093 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); | 1090 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); |
1094 | 1091 | ||
1095 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1092 | rt2x00_desc_read(entry_priv->desc, 1, &word); |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 8d3e95e0dcfe..070c23ed4013 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1164,15 +1164,15 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1164 | { | 1164 | { |
1165 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1165 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1166 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; | 1166 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1167 | __le32 *txd = skbdesc->desc; | 1167 | __le32 *txd = entry_priv->desc; |
1168 | u32 word; | 1168 | u32 word; |
1169 | 1169 | ||
1170 | /* | 1170 | /* |
1171 | * Start writing the descriptor words. | 1171 | * Start writing the descriptor words. |
1172 | */ | 1172 | */ |
1173 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1173 | rt2x00_desc_read(txd, 1, &word); |
1174 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); | 1174 | rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); |
1175 | rt2x00_desc_write(entry_priv->desc, 1, word); | 1175 | rt2x00_desc_write(txd, 1, word); |
1176 | 1176 | ||
1177 | rt2x00_desc_read(txd, 2, &word); | 1177 | rt2x00_desc_read(txd, 2, &word); |
1178 | rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER); | 1178 | rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER); |
@@ -1216,6 +1216,12 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1216 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | 1216 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); |
1217 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); | 1217 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); |
1218 | rt2x00_desc_write(txd, 0, word); | 1218 | rt2x00_desc_write(txd, 0, word); |
1219 | |||
1220 | /* | ||
1221 | * Register descriptor details in skb frame descriptor. | ||
1222 | */ | ||
1223 | skbdesc->desc = txd; | ||
1224 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1219 | } | 1225 | } |
1220 | 1226 | ||
1221 | /* | 1227 | /* |
@@ -1238,15 +1244,6 @@ static void rt2500pci_write_beacon(struct queue_entry *entry, | |||
1238 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | 1244 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); |
1239 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | 1245 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); |
1240 | 1246 | ||
1241 | /* | ||
1242 | * Replace rt2x00lib allocated descriptor with the | ||
1243 | * pointer to the _real_ hardware descriptor. | ||
1244 | * After that, map the beacon to DMA and update the | ||
1245 | * descriptor. | ||
1246 | */ | ||
1247 | memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len); | ||
1248 | skbdesc->desc = entry_priv->desc; | ||
1249 | |||
1250 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); | 1247 | rt2x00queue_map_txskb(rt2x00dev, entry->skb); |
1251 | 1248 | ||
1252 | rt2x00_desc_read(entry_priv->desc, 1, &word); | 1249 | rt2x00_desc_read(entry_priv->desc, 1, &word); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 9a915be547b3..b985d8f8cc6e 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1033,7 +1033,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1033 | struct txentry_desc *txdesc) | 1033 | struct txentry_desc *txdesc) |
1034 | { | 1034 | { |
1035 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1035 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1036 | __le32 *txd = skbdesc->desc; | 1036 | __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE); |
1037 | u32 word; | 1037 | u32 word; |
1038 | 1038 | ||
1039 | /* | 1039 | /* |
@@ -1075,6 +1075,12 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1075 | _rt2x00_desc_write(txd, 3, skbdesc->iv[0]); | 1075 | _rt2x00_desc_write(txd, 3, skbdesc->iv[0]); |
1076 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); | 1076 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); |
1077 | } | 1077 | } |
1078 | |||
1079 | /* | ||
1080 | * Register descriptor details in skb frame descriptor. | ||
1081 | */ | ||
1082 | skbdesc->desc = txd; | ||
1083 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1078 | } | 1084 | } |
1079 | 1085 | ||
1080 | /* | 1086 | /* |
@@ -1088,19 +1094,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1088 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1094 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1089 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 1095 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
1090 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; | 1096 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; |
1091 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
1092 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); | 1097 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); |
1093 | int length; | 1098 | int length; |
1094 | u16 reg, reg0; | 1099 | u16 reg, reg0; |
1095 | 1100 | ||
1096 | /* | 1101 | /* |
1097 | * Add the descriptor in front of the skb. | ||
1098 | */ | ||
1099 | skb_push(entry->skb, entry->queue->desc_size); | ||
1100 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
1101 | skbdesc->desc = entry->skb->data; | ||
1102 | |||
1103 | /* | ||
1104 | * Disable beaconing while we are reloading the beacon data, | 1102 | * Disable beaconing while we are reloading the beacon data, |
1105 | * otherwise we might be sending out invalid data. | 1103 | * otherwise we might be sending out invalid data. |
1106 | */ | 1104 | */ |
@@ -1109,6 +1107,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1109 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | 1107 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); |
1110 | 1108 | ||
1111 | /* | 1109 | /* |
1110 | * Take the descriptor in front of the skb into account. | ||
1111 | */ | ||
1112 | skb_push(entry->skb, TXD_DESC_SIZE); | ||
1113 | |||
1114 | /* | ||
1112 | * USB devices cannot blindly pass the skb->len as the | 1115 | * USB devices cannot blindly pass the skb->len as the |
1113 | * length of the data to usb_fill_bulk_urb. Pass the skb | 1116 | * length of the data to usb_fill_bulk_urb. Pass the skb |
1114 | * to the driver to determine what the length should be. | 1117 | * to the driver to determine what the length should be. |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 7d4778d66e77..b2f23272c3aa 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -633,7 +633,8 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
633 | struct txentry_desc *txdesc) | 633 | struct txentry_desc *txdesc) |
634 | { | 634 | { |
635 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 635 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
636 | __le32 *txd = skbdesc->desc; | 636 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
637 | __le32 *txd = entry_priv->desc; | ||
637 | u32 word; | 638 | u32 word; |
638 | 639 | ||
639 | /* | 640 | /* |
@@ -657,15 +658,14 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
657 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | 658 | !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); |
658 | rt2x00_set_field32(&word, TXD_W1_BURST, | 659 | rt2x00_set_field32(&word, TXD_W1_BURST, |
659 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 660 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
660 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, | 661 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE); |
661 | rt2x00dev->ops->extra_tx_headroom); | ||
662 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); | 662 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); |
663 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); | 663 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); |
664 | rt2x00_desc_write(txd, 1, word); | 664 | rt2x00_desc_write(txd, 1, word); |
665 | 665 | ||
666 | rt2x00_desc_read(txd, 2, &word); | 666 | rt2x00_desc_read(txd, 2, &word); |
667 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, | 667 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, |
668 | skbdesc->skb_dma + rt2x00dev->ops->extra_tx_headroom); | 668 | skbdesc->skb_dma + TXWI_DESC_SIZE); |
669 | rt2x00_desc_write(txd, 2, word); | 669 | rt2x00_desc_write(txd, 2, word); |
670 | 670 | ||
671 | rt2x00_desc_read(txd, 3, &word); | 671 | rt2x00_desc_read(txd, 3, &word); |
@@ -673,6 +673,12 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
673 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); | 673 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); |
674 | rt2x00_set_field32(&word, TXD_W3_QSEL, 2); | 674 | rt2x00_set_field32(&word, TXD_W3_QSEL, 2); |
675 | rt2x00_desc_write(txd, 3, word); | 675 | rt2x00_desc_write(txd, 3, word); |
676 | |||
677 | /* | ||
678 | * Register descriptor details in skb frame descriptor. | ||
679 | */ | ||
680 | skbdesc->desc = txd; | ||
681 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
676 | } | 682 | } |
677 | 683 | ||
678 | /* | 684 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index d48d705d1808..1b87daa19456 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -400,7 +400,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
400 | struct txentry_desc *txdesc) | 400 | struct txentry_desc *txdesc) |
401 | { | 401 | { |
402 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 402 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
403 | __le32 *txi = skbdesc->desc; | 403 | __le32 *txi = (__le32 *)(skb->data - TXWI_DESC_SIZE - TXINFO_DESC_SIZE); |
404 | u32 word; | 404 | u32 word; |
405 | 405 | ||
406 | /* | 406 | /* |
@@ -422,6 +422,12 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
422 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_BURST, | 422 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_BURST, |
423 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 423 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
424 | rt2x00_desc_write(txi, 0, word); | 424 | rt2x00_desc_write(txi, 0, word); |
425 | |||
426 | /* | ||
427 | * Register descriptor details in skb frame descriptor. | ||
428 | */ | ||
429 | skbdesc->desc = txi; | ||
430 | skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; | ||
425 | } | 431 | } |
426 | 432 | ||
427 | /* | 433 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 2fe9f295351f..ff80ef710d4e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -66,8 +66,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry, | |||
66 | struct txentry_desc *txdesc) | 66 | struct txentry_desc *txdesc) |
67 | { | 67 | { |
68 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 68 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
69 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; | ||
70 | struct skb_frame_desc *skbdesc; | ||
71 | 69 | ||
72 | /* | 70 | /* |
73 | * This should not happen, we already checked the entry | 71 | * This should not happen, we already checked the entry |
@@ -82,13 +80,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry, | |||
82 | return -EINVAL; | 80 | return -EINVAL; |
83 | } | 81 | } |
84 | 82 | ||
85 | /* | ||
86 | * Fill in skb descriptor | ||
87 | */ | ||
88 | skbdesc = get_skb_frame_desc(entry->skb); | ||
89 | skbdesc->desc = entry_priv->desc; | ||
90 | skbdesc->desc_len = entry->queue->desc_size; | ||
91 | |||
92 | return 0; | 83 | return 0; |
93 | } | 84 | } |
94 | EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); | 85 | EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 97b2c7650656..891d5f72716e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -552,7 +552,6 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, | |||
552 | struct rt2x00_intf *intf = vif_to_intf(vif); | 552 | struct rt2x00_intf *intf = vif_to_intf(vif); |
553 | struct skb_frame_desc *skbdesc; | 553 | struct skb_frame_desc *skbdesc; |
554 | struct txentry_desc txdesc; | 554 | struct txentry_desc txdesc; |
555 | __le32 desc[16]; | ||
556 | 555 | ||
557 | if (unlikely(!intf->beacon)) | 556 | if (unlikely(!intf->beacon)) |
558 | return -ENOBUFS; | 557 | return -ENOBUFS; |
@@ -585,19 +584,10 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, | |||
585 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); | 584 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
586 | 585 | ||
587 | /* | 586 | /* |
588 | * For the descriptor we use a local array from where the | ||
589 | * driver can move it to the correct location required for | ||
590 | * the hardware. | ||
591 | */ | ||
592 | memset(desc, 0, sizeof(desc)); | ||
593 | |||
594 | /* | ||
595 | * Fill in skb descriptor | 587 | * Fill in skb descriptor |
596 | */ | 588 | */ |
597 | skbdesc = get_skb_frame_desc(intf->beacon->skb); | 589 | skbdesc = get_skb_frame_desc(intf->beacon->skb); |
598 | memset(skbdesc, 0, sizeof(*skbdesc)); | 590 | memset(skbdesc, 0, sizeof(*skbdesc)); |
599 | skbdesc->desc = desc; | ||
600 | skbdesc->desc_len = intf->beacon->queue->desc_size; | ||
601 | skbdesc->entry = intf->beacon; | 591 | skbdesc->entry = intf->beacon; |
602 | 592 | ||
603 | /* | 593 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index acf3282fc13e..a4f0551422ae 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -221,7 +221,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
221 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 221 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
222 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 222 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
223 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | 223 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; |
224 | struct skb_frame_desc *skbdesc; | ||
225 | u32 length; | 224 | u32 length; |
226 | 225 | ||
227 | /* | 226 | /* |
@@ -231,13 +230,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
231 | memset(entry->skb->data, 0, entry->queue->desc_size); | 230 | memset(entry->skb->data, 0, entry->queue->desc_size); |
232 | 231 | ||
233 | /* | 232 | /* |
234 | * Fill in skb descriptor | ||
235 | */ | ||
236 | skbdesc = get_skb_frame_desc(entry->skb); | ||
237 | skbdesc->desc = entry->skb->data; | ||
238 | skbdesc->desc_len = entry->queue->desc_size; | ||
239 | |||
240 | /* | ||
241 | * USB devices cannot blindly pass the skb->len as the | 233 | * USB devices cannot blindly pass the skb->len as the |
242 | * length of the data to usb_fill_bulk_urb. Pass the skb | 234 | * length of the data to usb_fill_bulk_urb. Pass the skb |
243 | * to the driver to determine what the length should be. | 235 | * to the driver to determine what the length should be. |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 55aa010aeee2..1be1d7d585d8 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1763,7 +1763,8 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1763 | struct txentry_desc *txdesc) | 1763 | struct txentry_desc *txdesc) |
1764 | { | 1764 | { |
1765 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1765 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1766 | __le32 *txd = skbdesc->desc; | 1766 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1767 | __le32 *txd = entry_priv->desc; | ||
1767 | u32 word; | 1768 | u32 word; |
1768 | 1769 | ||
1769 | /* | 1770 | /* |
@@ -1842,6 +1843,13 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1842 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 1843 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
1843 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | 1844 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); |
1844 | rt2x00_desc_write(txd, 0, word); | 1845 | rt2x00_desc_write(txd, 0, word); |
1846 | |||
1847 | /* | ||
1848 | * Register descriptor details in skb frame descriptor. | ||
1849 | */ | ||
1850 | skbdesc->desc = txd; | ||
1851 | skbdesc->desc_len = | ||
1852 | (txdesc->queue == QID_BEACON) ? TXINFO_SIZE : TXD_DESC_SIZE; | ||
1845 | } | 1853 | } |
1846 | 1854 | ||
1847 | /* | 1855 | /* |
@@ -1851,7 +1859,7 @@ static void rt61pci_write_beacon(struct queue_entry *entry, | |||
1851 | struct txentry_desc *txdesc) | 1859 | struct txentry_desc *txdesc) |
1852 | { | 1860 | { |
1853 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1861 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1854 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | 1862 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
1855 | unsigned int beacon_base; | 1863 | unsigned int beacon_base; |
1856 | u32 reg; | 1864 | u32 reg; |
1857 | 1865 | ||
@@ -1867,11 +1875,9 @@ static void rt61pci_write_beacon(struct queue_entry *entry, | |||
1867 | * Write entire beacon with descriptor to register. | 1875 | * Write entire beacon with descriptor to register. |
1868 | */ | 1876 | */ |
1869 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1877 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |
1870 | rt2x00pci_register_multiwrite(rt2x00dev, | 1878 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, |
1871 | beacon_base, | 1879 | entry_priv->desc, TXINFO_SIZE); |
1872 | skbdesc->desc, skbdesc->desc_len); | 1880 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base + TXINFO_SIZE, |
1873 | rt2x00pci_register_multiwrite(rt2x00dev, | ||
1874 | beacon_base + skbdesc->desc_len, | ||
1875 | entry->skb->data, entry->skb->len); | 1881 | entry->skb->data, entry->skb->len); |
1876 | 1882 | ||
1877 | /* | 1883 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index fa40d434e729..fca661c2e2a3 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1440,7 +1440,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1440 | struct txentry_desc *txdesc) | 1440 | struct txentry_desc *txdesc) |
1441 | { | 1441 | { |
1442 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1442 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1443 | __le32 *txd = skbdesc->desc; | 1443 | __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE); |
1444 | u32 word; | 1444 | u32 word; |
1445 | 1445 | ||
1446 | /* | 1446 | /* |
@@ -1499,6 +1499,12 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1499 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); | 1499 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); |
1500 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1500 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1501 | rt2x00_desc_write(txd, 5, word); | 1501 | rt2x00_desc_write(txd, 5, word); |
1502 | |||
1503 | /* | ||
1504 | * Register descriptor details in skb frame descriptor. | ||
1505 | */ | ||
1506 | skbdesc->desc = txd; | ||
1507 | skbdesc->desc_len = TXD_DESC_SIZE; | ||
1502 | } | 1508 | } |
1503 | 1509 | ||
1504 | /* | 1510 | /* |
@@ -1508,18 +1514,10 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1508 | struct txentry_desc *txdesc) | 1514 | struct txentry_desc *txdesc) |
1509 | { | 1515 | { |
1510 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1516 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1511 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
1512 | unsigned int beacon_base; | 1517 | unsigned int beacon_base; |
1513 | u32 reg; | 1518 | u32 reg; |
1514 | 1519 | ||
1515 | /* | 1520 | /* |
1516 | * Add the descriptor in front of the skb. | ||
1517 | */ | ||
1518 | skb_push(entry->skb, entry->queue->desc_size); | ||
1519 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
1520 | skbdesc->desc = entry->skb->data; | ||
1521 | |||
1522 | /* | ||
1523 | * Disable beaconing while we are reloading the beacon data, | 1521 | * Disable beaconing while we are reloading the beacon data, |
1524 | * otherwise we might be sending out invalid data. | 1522 | * otherwise we might be sending out invalid data. |
1525 | */ | 1523 | */ |
@@ -1528,6 +1526,11 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1528 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 1526 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); |
1529 | 1527 | ||
1530 | /* | 1528 | /* |
1529 | * Take the descriptor in front of the skb into account. | ||
1530 | */ | ||
1531 | skb_push(entry->skb, TXD_DESC_SIZE); | ||
1532 | |||
1533 | /* | ||
1531 | * Write entire beacon with descriptor to register. | 1534 | * Write entire beacon with descriptor to register. |
1532 | */ | 1535 | */ |
1533 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1536 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |