Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159393
b: refs/heads/master
c: c1be515
h: refs/heads/master
i:
  159391: 800e3ac
v: v3
  • Loading branch information
Larry Finger authored and John W. Linville committed Aug 4, 2009
1 parent d85e7a8 commit ec80862
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ad201496badddd8e1cda87ee6d29e8b3b8e1279
refs/heads/master: c1be5152860218dffea6a47cff5ea31a56c6cff5
22 changes: 16 additions & 6 deletions trunk/drivers/net/wireless/b43legacy/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,15 +1366,25 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev,
ring = priority_to_txring(dev, skb_get_queue_mapping(skb));
spin_lock_irqsave(&ring->lock, flags);
B43legacy_WARN_ON(!ring->tx);
if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) {
b43legacywarn(dev->wl, "DMA queue overflow\n");

if (unlikely(ring->stopped)) {
/* We get here only because of a bug in mac80211.
* Because of a race, one packet may be queued after
* the queue is stopped, thus we got called when we shouldn't.
* For now, just refuse the transmit. */
if (b43legacy_debug(dev, B43legacy_DBG_DMAVERBOSE))
b43legacyerr(dev->wl, "Packet after queue stopped\n");
err = -ENOSPC;
goto out_unlock;
}

if (unlikely(WARN_ON(free_slots(ring) < SLOTS_PER_PACKET))) {
/* If we get here, we have a real error with the queue
* full, but queues not stopped. */
b43legacyerr(dev->wl, "DMA queue overflow\n");
err = -ENOSPC;
goto out_unlock;
}
/* Check if the queue was stopped in mac80211,
* but we got called nevertheless.
* That would be a mac80211 bug. */
B43legacy_BUG_ON(ring->stopped);

err = dma_tx_fragment(ring, skb);
if (unlikely(err == -ENOKEY)) {
Expand Down

0 comments on commit ec80862

Please sign in to comment.