1487
1487
const struct b43_dma_ops *ops;
1488
1488
struct b43_dmaring *ring;
1489
1489
struct b43_dmadesc_meta *meta;
1490
static const struct b43_txstatus fake; /* filled with 0 */
1491
const struct b43_txstatus *txstat;
1490
1492
int slot, firstused;
1491
1493
bool frame_succeed;
1495
static u8 err_out1, err_out2;
1493
1497
ring = parse_cookie(dev, status->cookie, &slot);
1494
1498
if (unlikely(!ring))
1501
1505
firstused = ring->current_slot - ring->used_slots + 1;
1502
1506
if (firstused < 0)
1503
1507
firstused = ring->nr_slots + firstused;
1504
1510
if (unlikely(slot != firstused)) {
1505
1511
/* This possibly is a firmware bug and will result in
1506
* malfunction, memory leaks and/or stall of DMA functionality. */
1507
b43dbg(dev->wl, "Out of order TX status report on DMA ring %d. "
1508
"Expected %d, but got %d\n",
1509
ring->index, firstused, slot);
1512
* malfunction, memory leaks and/or stall of DMA functionality.
1514
if (slot == next_slot(ring, next_slot(ring, firstused))) {
1515
/* If a single header/data pair was missed, skip over
1516
* the first two slots in an attempt to recover.
1521
/* Report the error once. */
1523
"Skip on DMA ring %d slot %d.\n",
1528
/* More than a single header/data pair were missed.
1529
* Report this error once.
1533
"Out of order TX status report on DMA ring %d. Expected %d, but got %d\n",
1534
ring->index, firstused, slot);
1513
1540
ops = ring->ops;
1522
1549
slot, firstused, ring->index);
1525
1553
if (meta->skb) {
1526
1554
struct b43_private_tx_info *priv_info =
1527
b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb));
1555
b43_get_priv_tx_info(IEEE80211_SKB_CB(meta->skb));
1529
unmap_descbuffer(ring, meta->dmaaddr, meta->skb->len, 1);
1557
unmap_descbuffer(ring, meta->dmaaddr,
1530
1559
kfree(priv_info->bouncebuffer);
1531
1560
priv_info->bouncebuffer = NULL;
1538
1567
struct ieee80211_tx_info *info;
1540
1569
if (unlikely(!meta->skb)) {
1541
/* This is a scatter-gather fragment of a frame, so
1542
* the skb pointer must not be NULL. */
1570
/* This is a scatter-gather fragment of a frame,
1571
* so the skb pointer must not be NULL.
1543
1573
b43dbg(dev->wl, "TX status unexpected NULL skb "
1544
1574
"at slot %d (first=%d) on ring %d\n",
1545
1575
slot, firstused, ring->index);
1552
1582
* Call back to inform the ieee80211 subsystem about
1553
* the status of the transmission.
1583
* the status of the transmission. When skipping over
1584
* a missed TX status report, use a status structure
1585
* filled with zeros to indicate that the frame was not
1586
* sent (frame_count 0) and not acknowledged
1555
frame_succeed = b43_fill_txstatus_report(dev, info, status);
1593
frame_succeed = b43_fill_txstatus_report(dev, info,
1556
1595
#ifdef CONFIG_B43_DEBUG
1557
1596
if (frame_succeed)
1558
1597
ring->nr_succeed_tx_packets++;
1580
1619
/* Everything unmapped and free'd. So it's not used anymore. */
1581
1620
ring->used_slots--;
1583
if (meta->is_last_fragment) {
1622
if (meta->is_last_fragment && !skip) {
1584
1623
/* This is the last scatter-gather
1585
1624
* fragment of the frame. We are done. */
1588
1627
slot = next_slot(ring, slot);
1590
1631
if (ring->stopped) {
1591
1632
B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME);