mac80211: update to wireless-testing 2011-09-14
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 541-ath9k_sw_retry_reduce.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -259,14 +259,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 @@ -382,6 +385,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 @@ -390,6 +394,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 @@ -475,7 +483,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 @@ -540,7 +540,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 */