Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122670
b: refs/heads/master
c: 39ca5bb
h: refs/heads/master
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Dec 12, 2008
1 parent b768865 commit 5410dfc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 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: 30dab79ed40f6c0f8a24e25fd9be7bd873eeeb8b
refs/heads/master: 39ca5bb76f3382b1cb0062d75ec45abd1c46e6d2
22 changes: 21 additions & 1 deletion trunk/drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,27 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb,
return -EINVAL;

spin_lock_irqsave(&priv->tx_queue.lock, flags);

left = skb_queue_len(&priv->tx_queue);
if (unlikely(left >= 28)) {
/*
* The tx_queue is nearly full!
* We have throttle normal data traffic, because we must
* have a few spare slots for control frames left.
*/
ieee80211_stop_queues(dev);

if (unlikely(left == 32)) {
/*
* The tx_queue is now really full.
*
* TODO: check if the device has crashed and reset it.
*/
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
return -ENOSPC;
}
}

while (left--) {
u32 hole_size;
info = IEEE80211_SKB_CB(entry);
Expand Down Expand Up @@ -903,7 +923,7 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb,
if (!target_skb) {
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
ieee80211_stop_queues(dev);
return -ENOMEM;
return -ENOSPC;
}

info = IEEE80211_SKB_CB(skb);
Expand Down
7 changes: 0 additions & 7 deletions trunk/drivers/net/wireless/p54/p54pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,6 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb,

P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE));
P54P_READ(dev_int);

/* FIXME: unlikely to happen because the device usually runs out of
memory before we fill the ring up, but we can make it impossible */
if (idx - device_idx > ARRAY_SIZE(ring_control->tx_data) - 2) {
p54_free_skb(dev, skb);
printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy));
}
}

static void p54p_stop(struct ieee80211_hw *dev)
Expand Down

0 comments on commit 5410dfc

Please sign in to comment.