Commit cb139ecc authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville
Browse files

carl9170: fix tx_ampdu_upload counter



tx_ampdu_upload was not decreased when an a-MPDU
frame had to be kicked out from the tx_pending
queues.

This broke ampdu aggregation, because the scheduler
waits until tx_ampdu_upload drops to zero, before
making the next aggregate.

Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 042c53f6
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -230,10 +230,17 @@ static void carl9170_flush(struct ar9170 *ar, bool drop_queued)
		for (i = 0; i < ar->hw->queues; i++) {
			struct sk_buff *skb;

			while ((skb = skb_dequeue(&ar->tx_pending[i])))
			while ((skb = skb_dequeue(&ar->tx_pending[i]))) {
				struct ieee80211_tx_info *info;

				info = IEEE80211_SKB_CB(skb);
				if (info->flags & IEEE80211_TX_CTL_AMPDU)
					atomic_dec(&ar->tx_ampdu_upload);

				carl9170_tx_status(ar, skb, false);
			}
		}
	}

	/* Wait for all other outstanding frames to timeout. */
	if (atomic_read(&ar->tx_total_queued))
@@ -1462,6 +1469,7 @@ static void carl9170_op_sta_notify(struct ieee80211_hw *hw,
			skb_queue_walk_safe(&ar->tx_pending[i], skb, tmp) {
				struct _carl9170_tx_superframe *super;
				struct ieee80211_hdr *hdr;
				struct ieee80211_tx_info *info;

				super = (void *) skb->data;
				hdr = (void *) super->frame_data;
@@ -1470,6 +1478,11 @@ static void carl9170_op_sta_notify(struct ieee80211_hw *hw,
					continue;

				__skb_unlink(skb, &ar->tx_pending[i]);

				info = IEEE80211_SKB_CB(skb);
				if (info->flags & IEEE80211_TX_CTL_AMPDU)
					atomic_dec(&ar->tx_ampdu_upload);

				carl9170_tx_status(ar, skb, false);
			}
			spin_unlock_bh(&ar->tx_pending[i].lock);