nvram: handle nvram at varying offsets within the eraseblock (fixes Edimax PS-1208mfg...
[openwrt/openwrt.git] / package / mac80211 / patches / 524-ath9k_aggr_status_validate.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
3 @@ -287,6 +287,7 @@ static int ar9002_hw_proc_txdesc(struct
4 ts->ts_shortretry = MS(ads->ds_txstatus1, AR_RTSFailCnt);
5 ts->ts_longretry = MS(ads->ds_txstatus1, AR_DataFailCnt);
6 ts->ts_virtcol = MS(ads->ds_txstatus1, AR_VirtRetryCnt);
7 + ts->tid = MS(ads->ds_txstatus9, AR_TxTid);
8 ts->ts_antenna = 0;
9
10 return 0;
11 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.h
12 +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.h
13 @@ -33,9 +33,6 @@
14 #define AR_TxDescId_S 16
15 #define AR_TxPtrChkSum 0x0000ffff
16
17 -#define AR_TxTid 0xf0000000
18 -#define AR_TxTid_S 28
19 -
20 #define AR_LowRxChain 0x00004000
21
22 #define AR_Not_Sounding 0x20000000
23 --- a/drivers/net/wireless/ath/ath9k/mac.h
24 +++ b/drivers/net/wireless/ath/ath9k/mac.h
25 @@ -485,6 +485,9 @@ struct ar5416_desc {
26 #define AR_TxRSSICombined 0xff000000
27 #define AR_TxRSSICombined_S 24
28
29 +#define AR_TxTid 0xf0000000
30 +#define AR_TxTid_S 28
31 +
32 #define AR_TxEVM0 ds_txstatus5
33 #define AR_TxEVM1 ds_txstatus6
34 #define AR_TxEVM2 ds_txstatus7
35 --- a/drivers/net/wireless/ath/ath9k/xmit.c
36 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
37 @@ -355,6 +355,14 @@ static void ath_tx_complete_aggr(struct
38 an = (struct ath_node *)sta->drv_priv;
39 tid = ATH_AN_2_TID(an, bf->bf_tidno);
40
41 + /*
42 + * The hardware occasionally sends a tx status for the wrong TID.
43 + * In this case, the BA status cannot be considered valid and all
44 + * subframes need to be retransmitted
45 + */
46 + if (bf->bf_tidno != ts->tid)
47 + txok = false;
48 +
49 isaggr = bf_isaggr(bf);
50 memset(ba, 0, WME_BA_BMP_SIZE >> 3);
51