ath9k: fix some tx aggregation issues - reduces the number of tx dma stop failures
[openwrt/openwrt.git] / package / mac80211 / patches / 573-ath9k_fix_tx_flush_bar.patch
1 --- a/drivers/net/wireless/ath/ath9k/mac.h
2 +++ b/drivers/net/wireless/ath/ath9k/mac.h
3 @@ -75,9 +75,10 @@
4 #define ATH9K_TXERR_XTXOP 0x08
5 #define ATH9K_TXERR_TIMER_EXPIRED 0x10
6 #define ATH9K_TX_ACKED 0x20
7 +#define ATH9K_TX_FLUSH 0x40
8 #define ATH9K_TXERR_MASK \
9 (ATH9K_TXERR_XRETRY | ATH9K_TXERR_FILT | ATH9K_TXERR_FIFO | \
10 - ATH9K_TXERR_XTXOP | ATH9K_TXERR_TIMER_EXPIRED)
11 + ATH9K_TXERR_XTXOP | ATH9K_TXERR_TIMER_EXPIRED | ATH9K_TX_FLUSH)
12
13 #define ATH9K_TX_BA 0x01
14 #define ATH9K_TX_PWRMGMT 0x02
15 --- a/drivers/net/wireless/ath/ath9k/xmit.c
16 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
17 @@ -389,6 +389,7 @@ static void ath_tx_complete_aggr(struct
18 u8 tidno;
19 bool clear_filter;
20 int i, retries;
21 + bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
22
23 skb = bf->bf_mpdu;
24 hdr = (struct ieee80211_hdr *)skb->data;
25 @@ -483,6 +484,8 @@ static void ath_tx_complete_aggr(struct
26 * the un-acked sub-frames
27 */
28 txfail = 1;
29 + } else if (flush) {
30 + txpending = 1;
31 } else if (fi->retries < ATH_MAX_SW_RETRIES) {
32 if (!(ts->ts_status & ATH9K_TXERR_FILT) &&
33 !an->sleeping)
34 @@ -543,7 +546,8 @@ static void ath_tx_complete_aggr(struct
35
36 ath_tx_complete_buf(sc, bf, txq,
37 &bf_head,
38 - ts, 0, 1,
39 + ts, 0,
40 + !flush,
41 sta);
42 break;
43 }
44 @@ -1447,6 +1451,7 @@ static void ath_drain_txq_list(struct at
45 struct ath_tx_status ts;
46
47 memset(&ts, 0, sizeof(ts));
48 + ts.ts_status = ATH9K_TX_FLUSH;
49 INIT_LIST_HEAD(&bf_head);
50
51 while (!list_empty(list)) {