aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-01-06 17:38:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:22 -0500
commit1230cb83f46731ca4eaa57c480788ed3c9d05935 (patch)
tree60be0e3211fafdd2d3afba7aa6527badb2e29790 /drivers/net/wireless
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')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c17
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c8
3 files changed, 15 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index bae444292d63..1ab2fb6c38da 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,
84 */ 84 */
85 if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) { 85 if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) {
86 ieee80211_stop_queues(hw); 86 ieee80211_stop_queues(hw);
87 return 0; 87 return NETDEV_TX_OK;
88 } 88 }
89 89
90 /* 90 /*
@@ -110,15 +110,24 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
110 if (!is_rts_frame(frame_control) && !is_cts_frame(frame_control) && 110 if (!is_rts_frame(frame_control) && !is_cts_frame(frame_control) &&
111 (control->flags & (IEEE80211_TXCTL_USE_RTS_CTS | 111 (control->flags & (IEEE80211_TXCTL_USE_RTS_CTS |
112 IEEE80211_TXCTL_USE_CTS_PROTECT))) { 112 IEEE80211_TXCTL_USE_CTS_PROTECT))) {
113 if (rt2x00_ring_free(ring) <= 1) 113 if (rt2x00_ring_free(ring) <= 1) {
114 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
114 return NETDEV_TX_BUSY; 115 return NETDEV_TX_BUSY;
116 }
115 117
116 if (rt2x00mac_tx_rts_cts(rt2x00dev, ring, skb, control)) 118 if (rt2x00mac_tx_rts_cts(rt2x00dev, ring, skb, control)) {
119 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
117 return NETDEV_TX_BUSY; 120 return NETDEV_TX_BUSY;
121 }
118 } 122 }
119 123
120 if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, ring, skb, control)) 124 if (rt2x00dev->ops->lib->write_tx_data(rt2x00dev, ring, skb, control)) {
125 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
121 return NETDEV_TX_BUSY; 126 return NETDEV_TX_BUSY;
127 }
128
129 if (rt2x00_ring_full(ring))
130 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
122 131
123 if (rt2x00dev->ops->lib->kick_tx_queue) 132 if (rt2x00dev->ops->lib->kick_tx_queue)
124 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue); 133 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 483380819f9d..804a9980055d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -86,10 +86,8 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
86 struct skb_desc *desc; 86 struct skb_desc *desc;
87 u32 word; 87 u32 word;
88 88
89 if (rt2x00_ring_full(ring)) { 89 if (rt2x00_ring_full(ring))
90 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
91 return -EINVAL; 90 return -EINVAL;
92 }
93 91
94 rt2x00_desc_read(txd, 0, &word); 92 rt2x00_desc_read(txd, 0, &word);
95 93
@@ -99,7 +97,6 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
99 "Arrived at non-free entry in the non-full queue %d.\n" 97 "Arrived at non-free entry in the non-full queue %d.\n"
100 "Please file bug report to %s.\n", 98 "Please file bug report to %s.\n",
101 control->queue, DRV_PROJECT); 99 control->queue, DRV_PROJECT);
102 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
103 return -EINVAL; 100 return -EINVAL;
104 } 101 }
105 102
@@ -119,9 +116,6 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
119 116
120 rt2x00_ring_index_inc(ring); 117 rt2x00_ring_index_inc(ring);
121 118
122 if (rt2x00_ring_full(ring))
123 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
124
125 return 0; 119 return 0;
126} 120}
127EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data); 121EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 9778fae313ab..fa0cdd8b3e1a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -179,17 +179,14 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
179 struct skb_desc *desc; 179 struct skb_desc *desc;
180 u32 length; 180 u32 length;
181 181
182 if (rt2x00_ring_full(ring)) { 182 if (rt2x00_ring_full(ring))
183 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
184 return -EINVAL; 183 return -EINVAL;
185 }
186 184
187 if (test_bit(ENTRY_OWNER_NIC, &entry->flags)) { 185 if (test_bit(ENTRY_OWNER_NIC, &entry->flags)) {
188 ERROR(rt2x00dev, 186 ERROR(rt2x00dev,
189 "Arrived at non-free entry in the non-full queue %d.\n" 187 "Arrived at non-free entry in the non-full queue %d.\n"
190 "Please file bug report to %s.\n", 188 "Please file bug report to %s.\n",
191 control->queue, DRV_PROJECT); 189 control->queue, DRV_PROJECT);
192 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
193 return -EINVAL; 190 return -EINVAL;
194 } 191 }
195 192
@@ -229,9 +226,6 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
229 226
230 rt2x00_ring_index_inc(ring); 227 rt2x00_ring_index_inc(ring);
231 228
232 if (rt2x00_ring_full(ring))
233 ieee80211_stop_queue(rt2x00dev->hw, control->queue);
234
235 return 0; 229 return 0;
236} 230}
237EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data); 231EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);