[backfire] mac80211: revert r29210 for now, it breaks on several architectures
[openwrt-10.03/.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 @@ -388,6 +388,7 @@ static void ath_tx_complete_aggr(struct 
18         int nframes;
19         u8 tidno;
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 @@ -482,6 +483,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 (txok || !an->sleeping)
33                                         ath_tx_set_retry(sc, txq, bf->bf_mpdu,
34 @@ -540,7 +543,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 @@ -1446,6 +1450,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)) {