From: Felix Fietkau Date: Thu, 5 Dec 2013 14:20:53 +0000 (+0100) Subject: ath9k: fix duration calculation for non-aggregated packets X-Git-Tag: upstream/snapshot3+hdmi~3687^2~4^2^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbf807bc0697e577c137a5fffb30fca7c6a45da1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ath9k: fix duration calculation for non-aggregated packets When not aggregating packets, fi->framelen should be passed in as length to calculate the duration. Before the tx path rework, ath_tx_fill_desc was called for either one aggregate, or one single frame, with the length of the packet or the aggregate as a parameter. After the rework, ath_tx_sched_aggr can pass a burst of single frames to ath_tx_fill_desc and sets len=0. Fix broken duration calculation by overriding the length in ath_tx_fill_desc before passing it to ath_buf_set_rate. Cc: stable@vger.kernel.org Reported-by: Simon Wunderlich Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 09cdbcd..b5a19e0 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1276,6 +1276,10 @@ static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf, if (!rts_thresh || (len > rts_thresh)) rts = true; } + + if (!aggr) + len = fi->framelen; + ath_buf_set_rate(sc, bf, &info, len, rts); }