aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_tx.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index 2e057b0e3257..7926471cd095 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -278,22 +278,12 @@ void wl1271_tx_work(struct work_struct *work)
278 278
279 ret = wl1271_tx_frame(wl, skb); 279 ret = wl1271_tx_frame(wl, skb);
280 if (ret == -EBUSY) { 280 if (ret == -EBUSY) {
281 /* firmware buffer is full, stop queues */ 281 /* firmware buffer is full, lets stop transmitting. */
282 wl1271_debug(DEBUG_TX, "tx_work: fw buffer full, "
283 "stop queues");
284 ieee80211_stop_queues(wl->hw);
285 set_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags);
286 skb_queue_head(&wl->tx_queue, skb); 282 skb_queue_head(&wl->tx_queue, skb);
287 goto out_ack; 283 goto out_ack;
288 } else if (ret < 0) { 284 } else if (ret < 0) {
289 dev_kfree_skb(skb); 285 dev_kfree_skb(skb);
290 goto out_ack; 286 goto out_ack;
291 } else if (test_and_clear_bit(WL1271_FLAG_TX_QUEUE_STOPPED,
292 &wl->flags)) {
293 /* firmware buffer has space, restart queues */
294 wl1271_debug(DEBUG_TX,
295 "complete_packet: waking queues");
296 ieee80211_wake_queues(wl->hw);
297 } 287 }
298 } 288 }
299 289
@@ -380,8 +370,6 @@ void wl1271_tx_complete(struct wl1271 *wl)
380 u32 count, fw_counter; 370 u32 count, fw_counter;
381 u32 i; 371 u32 i;
382 372
383 wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count);
384
385 /* read the tx results from the chipset */ 373 /* read the tx results from the chipset */
386 wl1271_read(wl, le32_to_cpu(memmap->tx_result), 374 wl1271_read(wl, le32_to_cpu(memmap->tx_result),
387 wl->tx_res_if, sizeof(*wl->tx_res_if), false); 375 wl->tx_res_if, sizeof(*wl->tx_res_if), false);
@@ -393,6 +381,7 @@ void wl1271_tx_complete(struct wl1271 *wl)
393 tx_result_host_counter), fw_counter); 381 tx_result_host_counter), fw_counter);
394 382
395 count = fw_counter - wl->tx_results_count; 383 count = fw_counter - wl->tx_results_count;
384 wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count);
396 385
397 /* verify that the result buffer is not getting overrun */ 386 /* verify that the result buffer is not getting overrun */
398 if (unlikely(count > TX_HW_RESULT_QUEUE_LEN)) 387 if (unlikely(count > TX_HW_RESULT_QUEUE_LEN))
@@ -409,6 +398,19 @@ void wl1271_tx_complete(struct wl1271 *wl)
409 398
410 wl->tx_results_count++; 399 wl->tx_results_count++;
411 } 400 }
401
402 if (test_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags) &&
403 skb_queue_len(&wl->tx_queue) <= WL1271_TX_QUEUE_LOW_WATERMARK) {
404 unsigned long flags;
405
406 /* firmware buffer has space, restart queues */
407 wl1271_debug(DEBUG_TX, "tx_complete: waking queues");
408 spin_lock_irqsave(&wl->wl_lock, flags);
409 ieee80211_wake_queues(wl->hw);
410 clear_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags);
411 spin_unlock_irqrestore(&wl->wl_lock, flags);
412 ieee80211_queue_work(wl->hw, &wl->tx_work);
413 }
412} 414}
413 415
414/* caller must hold wl->mutex */ 416/* caller must hold wl->mutex */