ath9k: add a bunch of powersave handling fixes
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 341-ath9k-release-PS-buffered-frames-as-A-MPDU-if-enable.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 28 Aug 2016 13:15:10 +0200
3 Subject: [PATCH] ath9k: release PS buffered frames as A-MPDU if enabled
4
5 Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 ---
7
8 --- a/drivers/net/wireless/ath/ath9k/xmit.c
9 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
10 @@ -1660,10 +1660,11 @@ void ath9k_release_buffered_frames(struc
11 struct ath_node *an = (struct ath_node *)sta->drv_priv;
12 struct ath_txq *txq = sc->tx.uapsdq;
13 struct ieee80211_tx_info *info;
14 + struct ath_frame_info *fi;
15 struct list_head bf_q;
16 struct ath_buf *bf_tail = NULL, *bf;
17 int sent = 0;
18 - int i;
19 + int n, i;
20
21 INIT_LIST_HEAD(&bf_q);
22 for (i = 0; tids && nframes; i++, tids >>= 1) {
23 @@ -1683,10 +1684,15 @@ void ath9k_release_buffered_frames(struc
24 ath9k_set_moredata(sc, bf, true);
25 list_add_tail(&bf->list, &bf_q);
26 ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
27 - if (bf_isampdu(bf)) {
28 + if (bf_isampdu(bf))
29 ath_tx_addto_baw(sc, tid, bf);
30 - bf->bf_state.bf_type &= ~BUF_AGGR;
31 + if (bf_isaggr(bf)) {
32 + fi = get_frame_info(bf->bf_mpdu);
33 + n = ath_compute_num_delims(sc, tid, bf,
34 + fi->framelen, true);
35 + bf->bf_state.ndelim = n;
36 }
37 +
38 if (bf_tail)
39 bf_tail->bf_next = bf;
40