ath9k: merge a fix for tx power limit testing
[openwrt.git] / package / mac80211 / patches / 551-ath9k_sw_retry_reduce.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -260,14 +260,17 @@ static void ath_tid_drain(struct ath_sof
4 }
5
6 static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq,
7 - struct sk_buff *skb)
8 + struct sk_buff *skb, int count)
9 {
10 struct ath_frame_info *fi = get_frame_info(skb);
11 struct ath_buf *bf = fi->bf;
12 struct ieee80211_hdr *hdr;
13 + int prev = fi->retries;
14
15 TX_STAT_INC(txq->axq_qnum, a_retries);
16 - if (fi->retries++ > 0)
17 + fi->retries += count;
18 +
19 + if (prev > 0)
20 return;
21
22 hdr = (struct ieee80211_hdr *)skb->data;
23 @@ -383,6 +386,7 @@ static void ath_tx_complete_aggr(struct
24 int nframes;
25 u8 tidno;
26 bool clear_filter;
27 + int i, retries;
28
29 skb = bf->bf_mpdu;
30 hdr = (struct ieee80211_hdr *)skb->data;
31 @@ -391,6 +395,10 @@ static void ath_tx_complete_aggr(struct
32
33 memcpy(rates, tx_info->control.rates, sizeof(rates));
34
35 + retries = ts->ts_longretry + 1;
36 + for (i = 0; i < ts->ts_rateindex; i++)
37 + retries += rates[i].count;
38 +
39 rcu_read_lock();
40
41 sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
42 @@ -478,7 +486,8 @@ static void ath_tx_complete_aggr(struct
43 } else if (fi->retries < ATH_MAX_SW_RETRIES) {
44 if (!(ts->ts_status & ATH9K_TXERR_FILT) ||
45 !an->sleeping)
46 - ath_tx_set_retry(sc, txq, bf->bf_mpdu);
47 + ath_tx_set_retry(sc, txq, bf->bf_mpdu,
48 + retries);
49
50 clear_filter = true;
51 txpending = 1;
52 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
53 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
54 @@ -543,7 +543,7 @@ struct ath_ant_comb {
55 #define DEFAULT_CACHELINE 32
56 #define ATH_REGCLASSIDS_MAX 10
57 #define ATH_CABQ_READY_TIME 80 /* % of beacon interval */
58 -#define ATH_MAX_SW_RETRIES 10
59 +#define ATH_MAX_SW_RETRIES 20
60 #define ATH_CHAN_MAX 255
61
62 #define ATH_TXPOWER_MAX 100 /* .5 dBm units */
This page took 0.042051 seconds and 5 git commands to generate.