mt76: testmode: add support to send larger packet
[linux-2.6-microblaze.git] / drivers / net / wireless / mediatek / mt76 / tx.c
index b8fe8ad..04e4725 100644 (file)
@@ -213,7 +213,7 @@ void mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *sk
                if (phy->test.tx_queued == phy->test.tx_done)
                        wake_up(&dev->tx_wait);
 
-               ieee80211_free_txskb(hw, skb);
+               dev_kfree_skb_any(skb);
                return;
        }
 #endif
@@ -461,11 +461,11 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
        int ret = 0;
 
        while (1) {
+               int n_frames = 0;
+
                if (test_bit(MT76_STATE_PM, &phy->state) ||
-                   test_bit(MT76_RESET, &phy->state)) {
-                       ret = -EBUSY;
-                       break;
-               }
+                   test_bit(MT76_RESET, &phy->state))
+                       return -EBUSY;
 
                if (dev->queue_ops->tx_cleanup &&
                    q->queued + 2 * MT_TXQ_FREE_THR >= q->ndesc) {
@@ -497,11 +497,16 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
                }
 
                if (!mt76_txq_stopped(q))
-                       ret += mt76_txq_send_burst(phy, q, mtxq);
+                       n_frames = mt76_txq_send_burst(phy, q, mtxq);
 
                spin_unlock_bh(&q->lock);
 
                ieee80211_return_txq(phy->hw, txq, false);
+
+               if (unlikely(n_frames < 0))
+                       return n_frames;
+
+               ret += n_frames;
        }
 
        return ret;