ath9k: revert temperature compensation support patch (FS#111)
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 336-ath9k-improve-powersave-filter-handling.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Tue, 2 Aug 2016 12:13:35 +0200
3 Subject: [PATCH] ath9k: improve powersave filter handling
4
5 For non-aggregated frames, ath9k was leaving handling of powersave
6 filtered packets to mac80211. This can be too slow if the intermediate
7 queue is already filled with packets and mac80211 does not immediately
8 send a new packet via drv_tx().
9
10 Improve response time with filtered frames by triggering clearing the
11 powersave filter internally.
12
13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 ---
15
16 --- a/drivers/net/wireless/ath/ath9k/xmit.c
17 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
18 @@ -461,13 +461,13 @@ static void ath_tx_count_frames(struct a
19 static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
20 struct ath_buf *bf, struct list_head *bf_q,
21 struct ieee80211_sta *sta,
22 + struct ath_atx_tid *tid,
23 struct ath_tx_status *ts, int txok)
24 {
25 struct ath_node *an = NULL;
26 struct sk_buff *skb;
27 struct ieee80211_hdr *hdr;
28 struct ieee80211_tx_info *tx_info;
29 - struct ath_atx_tid *tid = NULL;
30 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
31 struct list_head bf_head;
32 struct sk_buff_head bf_pending;
33 @@ -509,7 +509,6 @@ static void ath_tx_complete_aggr(struct
34 }
35
36 an = (struct ath_node *)sta->drv_priv;
37 - tid = ath_get_skb_tid(sc, an, skb);
38 seq_first = tid->seq_start;
39 isba = ts->ts_flags & ATH9K_TX_BA;
40
41 @@ -695,6 +694,7 @@ static void ath_tx_process_buffer(struct
42 struct ieee80211_tx_info *info;
43 struct ieee80211_sta *sta;
44 struct ieee80211_hdr *hdr;
45 + struct ath_atx_tid *tid = NULL;
46 bool txok, flush;
47
48 txok = !(ts->ts_status & ATH9K_TXERR_MASK);
49 @@ -710,6 +710,12 @@ static void ath_tx_process_buffer(struct
50
51 hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
52 sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
53 + if (sta) {
54 + struct ath_node *an = (struct ath_node *)sta->drv_priv;
55 + tid = ath_get_skb_tid(sc, an, bf->bf_mpdu);
56 + if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY))
57 + tid->clear_ps_filter = true;
58 + }
59
60 if (!bf_isampdu(bf)) {
61 if (!flush) {
62 @@ -721,7 +727,7 @@ static void ath_tx_process_buffer(struct
63 }
64 ath_tx_complete_buf(sc, bf, txq, bf_head, sta, ts, txok);
65 } else
66 - ath_tx_complete_aggr(sc, txq, bf, bf_head, sta, ts, txok);
67 + ath_tx_complete_aggr(sc, txq, bf, bf_head, sta, tid, ts, txok);
68
69 if (!flush)
70 ath_txq_schedule(sc, txq);