+
+ queue_len = skb_queue_len(&wl->tx_queue);
+ if (queue_len > 0) {
+ /* avoid stalling tx */
+ wl1251_tx_work_unlocked(wl, false);
+ queue_len = skb_queue_len(&wl->tx_queue);
+ }
+
+ if (queue_len > 0) {
+ /* still something to send? Schedule for later */
+ wl1251_debug(DEBUG_TX, "tx_complete: reschedule tx_work");
+ ieee80211_queue_work(wl->hw, &wl->tx_work);
+ }
+
+ if (wl->tx_queue_stopped &&
+ queue_len <= WL1251_TX_QUEUE_LOW_WATERMARK) {
+ /* tx_queue has space, restart queues */
+ wl1251_debug(DEBUG_TX, "tx_complete: waking queues");
+ spin_lock_irqsave(&wl->wl_lock, flags);
+ ieee80211_wake_queues(wl->hw);
+ wl->tx_queue_stopped = false;
+ spin_unlock_irqrestore(&wl->wl_lock, flags);
+ }