aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/b43legacy/dma.c')
-rw-r--r--drivers/net/wireless/b43legacy/dma.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index d6686f713b6d..33cc256c5baf 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -1205,10 +1205,10 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev,
1205} 1205}
1206 1206
1207static int dma_tx_fragment(struct b43legacy_dmaring *ring, 1207static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1208 struct sk_buff *skb, 1208 struct sk_buff *skb)
1209 struct ieee80211_tx_control *ctl)
1210{ 1209{
1211 const struct b43legacy_dma_ops *ops = ring->ops; 1210 const struct b43legacy_dma_ops *ops = ring->ops;
1211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1212 u8 *header; 1212 u8 *header;
1213 int slot, old_top_slot, old_used_slots; 1213 int slot, old_top_slot, old_used_slots;
1214 int err; 1214 int err;
@@ -1231,7 +1231,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1231 header = &(ring->txhdr_cache[slot * sizeof( 1231 header = &(ring->txhdr_cache[slot * sizeof(
1232 struct b43legacy_txhdr_fw3)]); 1232 struct b43legacy_txhdr_fw3)]);
1233 err = b43legacy_generate_txhdr(ring->dev, header, 1233 err = b43legacy_generate_txhdr(ring->dev, header,
1234 skb->data, skb->len, ctl, 1234 skb->data, skb->len, info,
1235 generate_cookie(ring, slot)); 1235 generate_cookie(ring, slot));
1236 if (unlikely(err)) { 1236 if (unlikely(err)) {
1237 ring->current_slot = old_top_slot; 1237 ring->current_slot = old_top_slot;
@@ -1255,7 +1255,6 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring,
1255 desc = ops->idx2desc(ring, slot, &meta); 1255 desc = ops->idx2desc(ring, slot, &meta);
1256 memset(meta, 0, sizeof(*meta)); 1256 memset(meta, 0, sizeof(*meta));
1257 1257
1258 memcpy(&meta->txstat.control, ctl, sizeof(*ctl));
1259 meta->skb = skb; 1258 meta->skb = skb;
1260 meta->is_last_fragment = 1; 1259 meta->is_last_fragment = 1;
1261 1260
@@ -1323,14 +1322,13 @@ int should_inject_overflow(struct b43legacy_dmaring *ring)
1323} 1322}
1324 1323
1325int b43legacy_dma_tx(struct b43legacy_wldev *dev, 1324int b43legacy_dma_tx(struct b43legacy_wldev *dev,
1326 struct sk_buff *skb, 1325 struct sk_buff *skb)
1327 struct ieee80211_tx_control *ctl)
1328{ 1326{
1329 struct b43legacy_dmaring *ring; 1327 struct b43legacy_dmaring *ring;
1330 int err = 0; 1328 int err = 0;
1331 unsigned long flags; 1329 unsigned long flags;
1332 1330
1333 ring = priority_to_txring(dev, ctl->queue); 1331 ring = priority_to_txring(dev, skb_get_queue_mapping(skb));
1334 spin_lock_irqsave(&ring->lock, flags); 1332 spin_lock_irqsave(&ring->lock, flags);
1335 B43legacy_WARN_ON(!ring->tx); 1333 B43legacy_WARN_ON(!ring->tx);
1336 if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { 1334 if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) {
@@ -1343,7 +1341,7 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
1343 * That would be a mac80211 bug. */ 1341 * That would be a mac80211 bug. */
1344 B43legacy_BUG_ON(ring->stopped); 1342 B43legacy_BUG_ON(ring->stopped);
1345 1343
1346 err = dma_tx_fragment(ring, skb, ctl); 1344 err = dma_tx_fragment(ring, skb);
1347 if (unlikely(err == -ENOKEY)) { 1345 if (unlikely(err == -ENOKEY)) {
1348 /* Drop this packet, as we don't have the encryption key 1346 /* Drop this packet, as we don't have the encryption key
1349 * anymore and must not transmit it unencrypted. */ 1347 * anymore and must not transmit it unencrypted. */
@@ -1401,26 +1399,29 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev,
1401 1); 1399 1);
1402 1400
1403 if (meta->is_last_fragment) { 1401 if (meta->is_last_fragment) {
1404 B43legacy_WARN_ON(!meta->skb); 1402 struct ieee80211_tx_info *info;
1403 BUG_ON(!meta->skb);
1404 info = IEEE80211_SKB_CB(meta->skb);
1405 /* Call back to inform the ieee80211 subsystem about the 1405 /* Call back to inform the ieee80211 subsystem about the
1406 * status of the transmission. 1406 * status of the transmission.
1407 * Some fields of txstat are already filled in dma_tx(). 1407 * Some fields of txstat are already filled in dma_tx().
1408 */ 1408 */
1409
1410 memset(&info->status, 0, sizeof(info->status));
1411
1409 if (status->acked) { 1412 if (status->acked) {
1410 meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; 1413 info->flags |= IEEE80211_TX_STAT_ACK;
1411 } else { 1414 } else {
1412 if (!(meta->txstat.control.flags 1415 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
1413 & IEEE80211_TXCTL_NO_ACK)) 1416 info->status.excessive_retries = 1;
1414 meta->txstat.excessive_retries = 1;
1415 } 1417 }
1416 if (status->frame_count == 0) { 1418 if (status->frame_count == 0) {
1417 /* The frame was not transmitted at all. */ 1419 /* The frame was not transmitted at all. */
1418 meta->txstat.retry_count = 0; 1420 info->status.retry_count = 0;
1419 } else 1421 } else
1420 meta->txstat.retry_count = status->frame_count 1422 info->status.retry_count = status->frame_count
1421 - 1; 1423 - 1;
1422 ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb, 1424 ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb);
1423 &(meta->txstat));
1424 /* skb is freed by ieee80211_tx_status_irqsafe() */ 1425 /* skb is freed by ieee80211_tx_status_irqsafe() */
1425 meta->skb = NULL; 1426 meta->skb = NULL;
1426 } else { 1427 } else {