summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-01-06 23:38:34 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:09:22 -0800
commit1230cb83f46731ca4eaa57c480788ed3c9d05935 (patch)
tree60be0e3211fafdd2d3afba7aa6527badb2e29790 /drivers/net/wireless/rt2x00/rt2x00mac.c
parent3e34c6dcb36bbd5294cae2654c32e24b9787da3a (diff)
rt2x00: Always call ieee80211_stop_queue() when return NETDEV_TX_BUSY
Apparently it was possible that ieee80211_stop_queue() was not full while NETDEV_TX_BUSY was being reported back. I think that is what causing the WARN_ON(). This moves all calls to ieee80211_stop_queue() in rt2x00mac.c where it is easier to determine if the queue should be halted. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index bae444292d6..1ab2fb6c38d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -84,7 +84,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
*/
if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) {
ieee80211_stop_queues(hw);
- return 0;
+ return NETDEV_TX_OK;
}
/*
@@ -110,15 +110,24 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
if (!is_rts_frame(frame_control) && !is_cts_frame(frame_control) &&
(control->flags & (IEEE80211_TXCTL_USE_RTS_CTS |
IEEE80211_TXCTL_USE_CTS_PROTECT))) {
- if (rt2x00_ring_free(ring) <= 1)
+ if (rt2x00_ring_free(ring) <= 1) {
+ ieee80211_stop_queue(rt2x00dev->hw, control->queue);
return NETDEV_TX_BUSY;
+ }
- if (rt2x00mac_tx_rts_cts(rt2x00dev, ring, skb, control))
+ if (rt2x00mac_tx_rts_cts(rt2x00dev, ring, skb, control)) {
+ ieee80211_stop_queue(rt2x00dev->hw, control->queue);
return NETDEV_TX_BUSY;
+ }
}
- if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, ring, skb, control))
+ if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, ring, skb, control)) {
+ ieee80211_stop_queue(rt2x00dev->hw, control->queue);
return NETDEV_TX_BUSY;
+ }
+
+ if (rt2x00_ring_full(ring))
+ ieee80211_stop_queue(rt2x00dev->hw, control->queue);
if (rt2x00dev->ops->lib->kick_tx_queue)
rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);