diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 55 | ||||
-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/rt2x00debug.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dump.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 71 |
13 files changed, 158 insertions, 136 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); |
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); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index e88d7033fbc9..9ae96a626e6d 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1034,12 +1034,30 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1034 | struct txentry_desc *txdesc) | 1034 | struct txentry_desc *txdesc) |
1035 | { | 1035 | { |
1036 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1036 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1037 | __le32 *txd = skbdesc->desc; | 1037 | __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE); |
1038 | u32 word; | 1038 | u32 word; |
1039 | 1039 | ||
1040 | /* | 1040 | /* |
1041 | * Start writing the descriptor words. | 1041 | * Start writing the descriptor words. |
1042 | */ | 1042 | */ |
1043 | rt2x00_desc_read(txd, 0, &word); | ||
1044 | rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit); | ||
1045 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | ||
1046 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
1047 | rt2x00_set_field32(&word, TXD_W0_ACK, | ||
1048 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1049 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1050 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1051 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1052 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1053 | rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, | ||
1054 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); | ||
1055 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1056 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1057 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); | ||
1058 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); | ||
1059 | rt2x00_desc_write(txd, 0, word); | ||
1060 | |||
1043 | rt2x00_desc_read(txd, 1, &word); | 1061 | rt2x00_desc_read(txd, 1, &word); |
1044 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); | 1062 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); |
1045 | rt2x00_set_field32(&word, TXD_W1_AIFS, txdesc->aifs); | 1063 | rt2x00_set_field32(&word, TXD_W1_AIFS, txdesc->aifs); |
@@ -1059,23 +1077,11 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1059 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); | 1077 | _rt2x00_desc_write(txd, 4, skbdesc->iv[1]); |
1060 | } | 1078 | } |
1061 | 1079 | ||
1062 | rt2x00_desc_read(txd, 0, &word); | 1080 | /* |
1063 | rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit); | 1081 | * Register descriptor details in skb frame descriptor. |
1064 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1082 | */ |
1065 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | 1083 | skbdesc->desc = txd; |
1066 | rt2x00_set_field32(&word, TXD_W0_ACK, | 1084 | skbdesc->desc_len = TXD_DESC_SIZE; |
1067 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1068 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1069 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1070 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1071 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1072 | rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, | ||
1073 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); | ||
1074 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1075 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1076 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); | ||
1077 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); | ||
1078 | rt2x00_desc_write(txd, 0, word); | ||
1079 | } | 1085 | } |
1080 | 1086 | ||
1081 | /* | 1087 | /* |
@@ -1089,19 +1095,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1089 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1095 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1090 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 1096 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
1091 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; | 1097 | struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; |
1092 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
1093 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); | 1098 | int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); |
1094 | int length; | 1099 | int length; |
1095 | u16 reg, reg0; | 1100 | u16 reg, reg0; |
1096 | 1101 | ||
1097 | /* | 1102 | /* |
1098 | * Add the descriptor in front of the skb. | ||
1099 | */ | ||
1100 | skb_push(entry->skb, entry->queue->desc_size); | ||
1101 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
1102 | skbdesc->desc = entry->skb->data; | ||
1103 | |||
1104 | /* | ||
1105 | * Disable beaconing while we are reloading the beacon data, | 1103 | * Disable beaconing while we are reloading the beacon data, |
1106 | * otherwise we might be sending out invalid data. | 1104 | * otherwise we might be sending out invalid data. |
1107 | */ | 1105 | */ |
@@ -1110,6 +1108,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1110 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | 1108 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); |
1111 | 1109 | ||
1112 | /* | 1110 | /* |
1111 | * Take the descriptor in front of the skb into account. | ||
1112 | */ | ||
1113 | skb_push(entry->skb, TXD_DESC_SIZE); | ||
1114 | |||
1115 | /* | ||
1113 | * USB devices cannot blindly pass the skb->len as the | 1116 | * USB devices cannot blindly pass the skb->len as the |
1114 | * length of the data to usb_fill_bulk_urb. Pass the skb | 1117 | * length of the data to usb_fill_bulk_urb. Pass the skb |
1115 | * to the driver to determine what the length should be. | 1118 | * 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 8ad0669a1b99..0f8b84b7224c 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/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c index e2497f820d75..e9fe93fd8042 100644 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c | |||
@@ -156,10 +156,11 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, | |||
156 | enum rt2x00_dump_type type, struct sk_buff *skb) | 156 | enum rt2x00_dump_type type, struct sk_buff *skb) |
157 | { | 157 | { |
158 | struct rt2x00debug_intf *intf = rt2x00dev->debugfs_intf; | 158 | struct rt2x00debug_intf *intf = rt2x00dev->debugfs_intf; |
159 | struct skb_frame_desc *desc = get_skb_frame_desc(skb); | 159 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
160 | struct sk_buff *skbcopy; | 160 | struct sk_buff *skbcopy; |
161 | struct rt2x00dump_hdr *dump_hdr; | 161 | struct rt2x00dump_hdr *dump_hdr; |
162 | struct timeval timestamp; | 162 | struct timeval timestamp; |
163 | u32 data_len; | ||
163 | 164 | ||
164 | do_gettimeofday(×tamp); | 165 | do_gettimeofday(×tamp); |
165 | 166 | ||
@@ -171,7 +172,11 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, | |||
171 | return; | 172 | return; |
172 | } | 173 | } |
173 | 174 | ||
174 | skbcopy = alloc_skb(sizeof(*dump_hdr) + desc->desc_len + skb->len, | 175 | data_len = skb->len; |
176 | if (skbdesc->flags & SKBDESC_DESC_IN_SKB) | ||
177 | data_len -= skbdesc->desc_len; | ||
178 | |||
179 | skbcopy = alloc_skb(sizeof(*dump_hdr) + skbdesc->desc_len + data_len, | ||
175 | GFP_ATOMIC); | 180 | GFP_ATOMIC); |
176 | if (!skbcopy) { | 181 | if (!skbcopy) { |
177 | DEBUG(rt2x00dev, "Failed to copy skb for dump.\n"); | 182 | DEBUG(rt2x00dev, "Failed to copy skb for dump.\n"); |
@@ -181,18 +186,20 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, | |||
181 | dump_hdr = (struct rt2x00dump_hdr *)skb_put(skbcopy, sizeof(*dump_hdr)); | 186 | dump_hdr = (struct rt2x00dump_hdr *)skb_put(skbcopy, sizeof(*dump_hdr)); |
182 | dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION); | 187 | dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION); |
183 | dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr)); | 188 | dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr)); |
184 | dump_hdr->desc_length = cpu_to_le32(desc->desc_len); | 189 | dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len); |
185 | dump_hdr->data_length = cpu_to_le32(skb->len); | 190 | dump_hdr->data_length = cpu_to_le32(data_len); |
186 | dump_hdr->chip_rt = cpu_to_le16(rt2x00dev->chip.rt); | 191 | dump_hdr->chip_rt = cpu_to_le16(rt2x00dev->chip.rt); |
187 | dump_hdr->chip_rf = cpu_to_le16(rt2x00dev->chip.rf); | 192 | dump_hdr->chip_rf = cpu_to_le16(rt2x00dev->chip.rf); |
188 | dump_hdr->chip_rev = cpu_to_le16(rt2x00dev->chip.rev); | 193 | dump_hdr->chip_rev = cpu_to_le16(rt2x00dev->chip.rev); |
189 | dump_hdr->type = cpu_to_le16(type); | 194 | dump_hdr->type = cpu_to_le16(type); |
190 | dump_hdr->queue_index = desc->entry->queue->qid; | 195 | dump_hdr->queue_index = skbdesc->entry->queue->qid; |
191 | dump_hdr->entry_index = desc->entry->entry_idx; | 196 | dump_hdr->entry_index = skbdesc->entry->entry_idx; |
192 | dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec); | 197 | dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec); |
193 | dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec); | 198 | dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec); |
194 | 199 | ||
195 | memcpy(skb_put(skbcopy, desc->desc_len), desc->desc, desc->desc_len); | 200 | if (!(skbdesc->flags & SKBDESC_DESC_IN_SKB)) |
201 | memcpy(skb_put(skbcopy, skbdesc->desc_len), skbdesc->desc, | ||
202 | skbdesc->desc_len); | ||
196 | memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len); | 203 | memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len); |
197 | 204 | ||
198 | skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy); | 205 | skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dump.h b/drivers/net/wireless/rt2x00/rt2x00dump.h index 727019a748e7..ed303b423e41 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dump.h +++ b/drivers/net/wireless/rt2x00/rt2x00dump.h | |||
@@ -62,11 +62,14 @@ | |||
62 | * the tx event which has either succeeded or failed. A frame | 62 | * the tx event which has either succeeded or failed. A frame |
63 | * with this type should also have been reported with as a | 63 | * with this type should also have been reported with as a |
64 | * %DUMP_FRAME_TX frame. | 64 | * %DUMP_FRAME_TX frame. |
65 | * @DUMP_FRAME_BEACON: This beacon frame is queued for transmission to the | ||
66 | * hardware. | ||
65 | */ | 67 | */ |
66 | enum rt2x00_dump_type { | 68 | enum rt2x00_dump_type { |
67 | DUMP_FRAME_RXDONE = 1, | 69 | DUMP_FRAME_RXDONE = 1, |
68 | DUMP_FRAME_TX = 2, | 70 | DUMP_FRAME_TX = 2, |
69 | DUMP_FRAME_TXDONE = 3, | 71 | DUMP_FRAME_TXDONE = 3, |
72 | DUMP_FRAME_BEACON = 4, | ||
70 | }; | 73 | }; |
71 | 74 | ||
72 | /** | 75 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 4b941e9c794e..a016f7ccde29 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -67,8 +67,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry, | |||
67 | struct txentry_desc *txdesc) | 67 | struct txentry_desc *txdesc) |
68 | { | 68 | { |
69 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 69 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
70 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; | ||
71 | struct skb_frame_desc *skbdesc; | ||
72 | 70 | ||
73 | /* | 71 | /* |
74 | * This should not happen, we already checked the entry | 72 | * This should not happen, we already checked the entry |
@@ -83,13 +81,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry, | |||
83 | return -EINVAL; | 81 | return -EINVAL; |
84 | } | 82 | } |
85 | 83 | ||
86 | /* | ||
87 | * Fill in skb descriptor | ||
88 | */ | ||
89 | skbdesc = get_skb_frame_desc(entry->skb); | ||
90 | skbdesc->desc = entry_priv->desc; | ||
91 | skbdesc->desc_len = entry->queue->desc_size; | ||
92 | |||
93 | return 0; | 84 | return 0; |
94 | } | 85 | } |
95 | EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); | 86 | EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 089a12c7b90f..20dbdd6fb904 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -421,6 +421,7 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, | |||
421 | { | 421 | { |
422 | struct data_queue *queue = entry->queue; | 422 | struct data_queue *queue = entry->queue; |
423 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | 423 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; |
424 | enum rt2x00_dump_type dump_type; | ||
424 | 425 | ||
425 | rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, entry->skb, txdesc); | 426 | rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, entry->skb, txdesc); |
426 | 427 | ||
@@ -428,7 +429,9 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, | |||
428 | * All processing on the frame has been completed, this means | 429 | * All processing on the frame has been completed, this means |
429 | * it is now ready to be dumped to userspace through debugfs. | 430 | * it is now ready to be dumped to userspace through debugfs. |
430 | */ | 431 | */ |
431 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb); | 432 | dump_type = (txdesc->queue == QID_BEACON) ? |
433 | DUMP_FRAME_BEACON : DUMP_FRAME_TX; | ||
434 | rt2x00debug_dump_frame(rt2x00dev, dump_type, entry->skb); | ||
432 | } | 435 | } |
433 | 436 | ||
434 | static void rt2x00queue_kick_tx_queue(struct queue_entry *entry, | 437 | static void rt2x00queue_kick_tx_queue(struct queue_entry *entry, |
@@ -553,7 +556,6 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, | |||
553 | struct rt2x00_intf *intf = vif_to_intf(vif); | 556 | struct rt2x00_intf *intf = vif_to_intf(vif); |
554 | struct skb_frame_desc *skbdesc; | 557 | struct skb_frame_desc *skbdesc; |
555 | struct txentry_desc txdesc; | 558 | struct txentry_desc txdesc; |
556 | __le32 desc[16]; | ||
557 | 559 | ||
558 | if (unlikely(!intf->beacon)) | 560 | if (unlikely(!intf->beacon)) |
559 | return -ENOBUFS; | 561 | return -ENOBUFS; |
@@ -586,19 +588,10 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, | |||
586 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); | 588 | rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); |
587 | 589 | ||
588 | /* | 590 | /* |
589 | * For the descriptor we use a local array from where the | ||
590 | * driver can move it to the correct location required for | ||
591 | * the hardware. | ||
592 | */ | ||
593 | memset(desc, 0, sizeof(desc)); | ||
594 | |||
595 | /* | ||
596 | * Fill in skb descriptor | 591 | * Fill in skb descriptor |
597 | */ | 592 | */ |
598 | skbdesc = get_skb_frame_desc(intf->beacon->skb); | 593 | skbdesc = get_skb_frame_desc(intf->beacon->skb); |
599 | memset(skbdesc, 0, sizeof(*skbdesc)); | 594 | memset(skbdesc, 0, sizeof(*skbdesc)); |
600 | skbdesc->desc = desc; | ||
601 | skbdesc->desc_len = intf->beacon->queue->desc_size; | ||
602 | skbdesc->entry = intf->beacon; | 595 | skbdesc->entry = intf->beacon; |
603 | 596 | ||
604 | /* | 597 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 36a957adc1f9..f79170849add 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -94,12 +94,15 @@ enum data_queue_qid { | |||
94 | * mac80211 but was stripped for processing by the driver. | 94 | * mac80211 but was stripped for processing by the driver. |
95 | * @SKBDESC_NOT_MAC80211: Frame didn't originate from mac80211, | 95 | * @SKBDESC_NOT_MAC80211: Frame didn't originate from mac80211, |
96 | * don't try to pass it back. | 96 | * don't try to pass it back. |
97 | * @SKBDESC_DESC_IN_SKB: The descriptor is at the start of the | ||
98 | * skb, instead of in the desc field. | ||
97 | */ | 99 | */ |
98 | enum skb_frame_desc_flags { | 100 | enum skb_frame_desc_flags { |
99 | SKBDESC_DMA_MAPPED_RX = 1 << 0, | 101 | SKBDESC_DMA_MAPPED_RX = 1 << 0, |
100 | SKBDESC_DMA_MAPPED_TX = 1 << 1, | 102 | SKBDESC_DMA_MAPPED_TX = 1 << 1, |
101 | SKBDESC_IV_STRIPPED = 1 << 2, | 103 | SKBDESC_IV_STRIPPED = 1 << 2, |
102 | SKBDESC_NOT_MAC80211 = 1 << 3, | 104 | SKBDESC_NOT_MAC80211 = 1 << 3, |
105 | SKBDESC_DESC_IN_SKB = 1 << 4, | ||
103 | }; | 106 | }; |
104 | 107 | ||
105 | /** | 108 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index da111c0c2928..bd1546ba7ad2 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -222,7 +222,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
222 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 222 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
223 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); | 223 | struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); |
224 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; | 224 | struct queue_entry_priv_usb *entry_priv = entry->priv_data; |
225 | struct skb_frame_desc *skbdesc; | ||
226 | u32 length; | 225 | u32 length; |
227 | 226 | ||
228 | /* | 227 | /* |
@@ -232,13 +231,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, | |||
232 | memset(entry->skb->data, 0, entry->queue->desc_size); | 231 | memset(entry->skb->data, 0, entry->queue->desc_size); |
233 | 232 | ||
234 | /* | 233 | /* |
235 | * Fill in skb descriptor | ||
236 | */ | ||
237 | skbdesc = get_skb_frame_desc(entry->skb); | ||
238 | skbdesc->desc = entry->skb->data; | ||
239 | skbdesc->desc_len = entry->queue->desc_size; | ||
240 | |||
241 | /* | ||
242 | * USB devices cannot blindly pass the skb->len as the | 234 | * USB devices cannot blindly pass the skb->len as the |
243 | * length of the data to usb_fill_bulk_urb. Pass the skb | 235 | * length of the data to usb_fill_bulk_urb. Pass the skb |
244 | * to the driver to determine what the length should be. | 236 | * 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 86c75b9c3f25..2e3076f67535 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1764,7 +1764,8 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1764 | struct txentry_desc *txdesc) | 1764 | struct txentry_desc *txdesc) |
1765 | { | 1765 | { |
1766 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1766 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1767 | __le32 *txd = skbdesc->desc; | 1767 | struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; |
1768 | __le32 *txd = entry_priv->desc; | ||
1768 | u32 word; | 1769 | u32 word; |
1769 | 1770 | ||
1770 | /* | 1771 | /* |
@@ -1802,18 +1803,23 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1802 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1803 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1803 | rt2x00_desc_write(txd, 5, word); | 1804 | rt2x00_desc_write(txd, 5, word); |
1804 | 1805 | ||
1805 | rt2x00_desc_read(txd, 6, &word); | 1806 | if (txdesc->queue != QID_BEACON) { |
1806 | rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS, | 1807 | rt2x00_desc_read(txd, 6, &word); |
1807 | skbdesc->skb_dma); | 1808 | rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS, |
1808 | rt2x00_desc_write(txd, 6, word); | 1809 | skbdesc->skb_dma); |
1810 | rt2x00_desc_write(txd, 6, word); | ||
1809 | 1811 | ||
1810 | if (skbdesc->desc_len > TXINFO_SIZE) { | ||
1811 | rt2x00_desc_read(txd, 11, &word); | 1812 | rt2x00_desc_read(txd, 11, &word); |
1812 | rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, | 1813 | rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, |
1813 | txdesc->length); | 1814 | txdesc->length); |
1814 | rt2x00_desc_write(txd, 11, word); | 1815 | rt2x00_desc_write(txd, 11, word); |
1815 | } | 1816 | } |
1816 | 1817 | ||
1818 | /* | ||
1819 | * Writing TXD word 0 must the last to prevent a race condition with | ||
1820 | * the device, whereby the device may take hold of the TXD before we | ||
1821 | * finished updating it. | ||
1822 | */ | ||
1817 | rt2x00_desc_read(txd, 0, &word); | 1823 | rt2x00_desc_read(txd, 0, &word); |
1818 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); | 1824 | rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1); |
1819 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | 1825 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); |
@@ -1838,6 +1844,13 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1838 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 1844 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
1839 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | 1845 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); |
1840 | rt2x00_desc_write(txd, 0, word); | 1846 | rt2x00_desc_write(txd, 0, word); |
1847 | |||
1848 | /* | ||
1849 | * Register descriptor details in skb frame descriptor. | ||
1850 | */ | ||
1851 | skbdesc->desc = txd; | ||
1852 | skbdesc->desc_len = | ||
1853 | (txdesc->queue == QID_BEACON) ? TXINFO_SIZE : TXD_DESC_SIZE; | ||
1841 | } | 1854 | } |
1842 | 1855 | ||
1843 | /* | 1856 | /* |
@@ -1847,7 +1860,7 @@ static void rt61pci_write_beacon(struct queue_entry *entry, | |||
1847 | struct txentry_desc *txdesc) | 1860 | struct txentry_desc *txdesc) |
1848 | { | 1861 | { |
1849 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1862 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1850 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | 1863 | struct queue_entry_priv_pci *entry_priv = entry->priv_data; |
1851 | unsigned int beacon_base; | 1864 | unsigned int beacon_base; |
1852 | u32 reg; | 1865 | u32 reg; |
1853 | 1866 | ||
@@ -1863,11 +1876,9 @@ static void rt61pci_write_beacon(struct queue_entry *entry, | |||
1863 | * Write entire beacon with descriptor to register. | 1876 | * Write entire beacon with descriptor to register. |
1864 | */ | 1877 | */ |
1865 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1878 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |
1866 | rt2x00pci_register_multiwrite(rt2x00dev, | 1879 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base, |
1867 | beacon_base, | 1880 | entry_priv->desc, TXINFO_SIZE); |
1868 | skbdesc->desc, skbdesc->desc_len); | 1881 | rt2x00pci_register_multiwrite(rt2x00dev, beacon_base + TXINFO_SIZE, |
1869 | rt2x00pci_register_multiwrite(rt2x00dev, | ||
1870 | beacon_base + skbdesc->desc_len, | ||
1871 | entry->skb->data, entry->skb->len); | 1882 | entry->skb->data, entry->skb->len); |
1872 | 1883 | ||
1873 | /* | 1884 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 11c130748206..e35bd19c3c5a 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1441,12 +1441,38 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1441 | struct txentry_desc *txdesc) | 1441 | struct txentry_desc *txdesc) |
1442 | { | 1442 | { |
1443 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1443 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
1444 | __le32 *txd = skbdesc->desc; | 1444 | __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE); |
1445 | u32 word; | 1445 | u32 word; |
1446 | 1446 | ||
1447 | /* | 1447 | /* |
1448 | * Start writing the descriptor words. | 1448 | * Start writing the descriptor words. |
1449 | */ | 1449 | */ |
1450 | rt2x00_desc_read(txd, 0, &word); | ||
1451 | rt2x00_set_field32(&word, TXD_W0_BURST, | ||
1452 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1453 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | ||
1454 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | ||
1455 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
1456 | rt2x00_set_field32(&word, TXD_W0_ACK, | ||
1457 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1458 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1459 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1460 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1461 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1462 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1463 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | ||
1464 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | ||
1465 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, | ||
1466 | test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags)); | ||
1467 | rt2x00_set_field32(&word, TXD_W0_KEY_TABLE, | ||
1468 | test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags)); | ||
1469 | rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx); | ||
1470 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1471 | rt2x00_set_field32(&word, TXD_W0_BURST2, | ||
1472 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1473 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | ||
1474 | rt2x00_desc_write(txd, 0, word); | ||
1475 | |||
1450 | rt2x00_desc_read(txd, 1, &word); | 1476 | rt2x00_desc_read(txd, 1, &word); |
1451 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue); | 1477 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue); |
1452 | rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs); | 1478 | rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs); |
@@ -1475,31 +1501,11 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1475 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1501 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1476 | rt2x00_desc_write(txd, 5, word); | 1502 | rt2x00_desc_write(txd, 5, word); |
1477 | 1503 | ||
1478 | rt2x00_desc_read(txd, 0, &word); | 1504 | /* |
1479 | rt2x00_set_field32(&word, TXD_W0_BURST, | 1505 | * Register descriptor details in skb frame descriptor. |
1480 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 1506 | */ |
1481 | rt2x00_set_field32(&word, TXD_W0_VALID, 1); | 1507 | skbdesc->desc = txd; |
1482 | rt2x00_set_field32(&word, TXD_W0_MORE_FRAG, | 1508 | skbdesc->desc_len = TXD_DESC_SIZE; |
1483 | test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); | ||
1484 | rt2x00_set_field32(&word, TXD_W0_ACK, | ||
1485 | test_bit(ENTRY_TXD_ACK, &txdesc->flags)); | ||
1486 | rt2x00_set_field32(&word, TXD_W0_TIMESTAMP, | ||
1487 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | ||
1488 | rt2x00_set_field32(&word, TXD_W0_OFDM, | ||
1489 | (txdesc->rate_mode == RATE_MODE_OFDM)); | ||
1490 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | ||
1491 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | ||
1492 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | ||
1493 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, | ||
1494 | test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags)); | ||
1495 | rt2x00_set_field32(&word, TXD_W0_KEY_TABLE, | ||
1496 | test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags)); | ||
1497 | rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx); | ||
1498 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | ||
1499 | rt2x00_set_field32(&word, TXD_W0_BURST2, | ||
1500 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | ||
1501 | rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher); | ||
1502 | rt2x00_desc_write(txd, 0, word); | ||
1503 | } | 1509 | } |
1504 | 1510 | ||
1505 | /* | 1511 | /* |
@@ -1509,18 +1515,10 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1509 | struct txentry_desc *txdesc) | 1515 | struct txentry_desc *txdesc) |
1510 | { | 1516 | { |
1511 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1517 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1512 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
1513 | unsigned int beacon_base; | 1518 | unsigned int beacon_base; |
1514 | u32 reg; | 1519 | u32 reg; |
1515 | 1520 | ||
1516 | /* | 1521 | /* |
1517 | * Add the descriptor in front of the skb. | ||
1518 | */ | ||
1519 | skb_push(entry->skb, entry->queue->desc_size); | ||
1520 | memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len); | ||
1521 | skbdesc->desc = entry->skb->data; | ||
1522 | |||
1523 | /* | ||
1524 | * Disable beaconing while we are reloading the beacon data, | 1522 | * Disable beaconing while we are reloading the beacon data, |
1525 | * otherwise we might be sending out invalid data. | 1523 | * otherwise we might be sending out invalid data. |
1526 | */ | 1524 | */ |
@@ -1529,6 +1527,11 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1529 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 1527 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); |
1530 | 1528 | ||
1531 | /* | 1529 | /* |
1530 | * Take the descriptor in front of the skb into account. | ||
1531 | */ | ||
1532 | skb_push(entry->skb, TXD_DESC_SIZE); | ||
1533 | |||
1534 | /* | ||
1532 | * Write entire beacon with descriptor to register. | 1535 | * Write entire beacon with descriptor to register. |
1533 | */ | 1536 | */ |
1534 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1537 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |