diff options
Diffstat (limited to 'drivers/net/wireless/p54/p54common.c')
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 409ae930d766..fac6b416e9e9 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -874,7 +874,27 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
874 | return -EINVAL; | 874 | return -EINVAL; |
875 | 875 | ||
876 | spin_lock_irqsave(&priv->tx_queue.lock, flags); | 876 | spin_lock_irqsave(&priv->tx_queue.lock, flags); |
877 | |||
877 | left = skb_queue_len(&priv->tx_queue); | 878 | left = skb_queue_len(&priv->tx_queue); |
879 | if (unlikely(left >= 28)) { | ||
880 | /* | ||
881 | * The tx_queue is nearly full! | ||
882 | * We have throttle normal data traffic, because we must | ||
883 | * have a few spare slots for control frames left. | ||
884 | */ | ||
885 | ieee80211_stop_queues(dev); | ||
886 | |||
887 | if (unlikely(left == 32)) { | ||
888 | /* | ||
889 | * The tx_queue is now really full. | ||
890 | * | ||
891 | * TODO: check if the device has crashed and reset it. | ||
892 | */ | ||
893 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | ||
894 | return -ENOSPC; | ||
895 | } | ||
896 | } | ||
897 | |||
878 | while (left--) { | 898 | while (left--) { |
879 | u32 hole_size; | 899 | u32 hole_size; |
880 | info = IEEE80211_SKB_CB(entry); | 900 | info = IEEE80211_SKB_CB(entry); |
@@ -903,7 +923,7 @@ static int p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
903 | if (!target_skb) { | 923 | if (!target_skb) { |
904 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | 924 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); |
905 | ieee80211_stop_queues(dev); | 925 | ieee80211_stop_queues(dev); |
906 | return -ENOMEM; | 926 | return -ENOSPC; |
907 | } | 927 | } |
908 | 928 | ||
909 | info = IEEE80211_SKB_CB(skb); | 929 | info = IEEE80211_SKB_CB(skb); |