ath9k: improve handling of blockackreq (should improve aggregation behavior under...
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 561-ath9k_reduce_indentation.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -490,27 +490,25 @@ static void ath_tx_complete_aggr(struct
4 } else if (!isaggr && txok) {
5 /* transmit completion */
6 acked_cnt++;
7 + } else if ((tid->state & AGGR_CLEANUP) || !retry) {
8 + /*
9 + * cleanup in progress, just fail
10 + * the un-acked sub-frames
11 + */
12 + txfail = 1;
13 + } else if (flush) {
14 + txpending = 1;
15 + } else if (fi->retries < ATH_MAX_SW_RETRIES) {
16 + if (txok || !an->sleeping)
17 + ath_tx_set_retry(sc, txq, bf->bf_mpdu,
18 + retries);
19 +
20 + txpending = 1;
21 } else {
22 - if ((tid->state & AGGR_CLEANUP) || !retry) {
23 - /*
24 - * cleanup in progress, just fail
25 - * the un-acked sub-frames
26 - */
27 - txfail = 1;
28 - } else if (flush) {
29 - txpending = 1;
30 - } else if (fi->retries < ATH_MAX_SW_RETRIES) {
31 - if (txok || !an->sleeping)
32 - ath_tx_set_retry(sc, txq, bf->bf_mpdu,
33 - retries);
34 -
35 - txpending = 1;
36 - } else {
37 - txfail = 1;
38 - txfail_cnt++;
39 - bar_index = max_t(int, bar_index,
40 - ATH_BA_INDEX(seq_first, seqno));
41 - }
42 + txfail = 1;
43 + txfail_cnt++;
44 + bar_index = max_t(int, bar_index,
45 + ATH_BA_INDEX(seq_first, seqno));
46 }
47
48 /*
49 @@ -541,32 +539,29 @@ static void ath_tx_complete_aggr(struct
50 !txfail);
51 } else {
52 /* retry the un-acked ones */
53 - if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
54 - if (bf->bf_next == NULL && bf_last->bf_stale) {
55 - struct ath_buf *tbf;
56 -
57 - tbf = ath_clone_txbuf(sc, bf_last);
58 - /*
59 - * Update tx baw and complete the
60 - * frame with failed status if we
61 - * run out of tx buf.
62 - */
63 - if (!tbf) {
64 - spin_lock_bh(&txq->axq_lock);
65 - ath_tx_update_baw(sc, tid, seqno);
66 - spin_unlock_bh(&txq->axq_lock);
67 -
68 - ath_tx_complete_buf(sc, bf, txq,
69 - &bf_head,
70 - ts, 0);
71 - bar_index = max_t(int, bar_index,
72 - ATH_BA_INDEX(seq_first,
73 - seqno));
74 - break;
75 - }
76 + if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
77 + bf->bf_next == NULL && bf_last->bf_stale) {
78 + struct ath_buf *tbf;
79
80 - fi->bf = tbf;
81 + tbf = ath_clone_txbuf(sc, bf_last);
82 + /*
83 + * Update tx baw and complete the
84 + * frame with failed status if we
85 + * run out of tx buf.
86 + */
87 + if (!tbf) {
88 + spin_lock_bh(&txq->axq_lock);
89 + ath_tx_update_baw(sc, tid, seqno);
90 + spin_unlock_bh(&txq->axq_lock);
91 +
92 + ath_tx_complete_buf(sc, bf, txq,
93 + &bf_head, ts, 0);
94 + bar_index = max_t(int, bar_index,
95 + ATH_BA_INDEX(seq_first, seqno));
96 + break;
97 }
98 +
99 + fi->bf = tbf;
100 }
101
102 /*
103 @@ -654,24 +649,26 @@ static u32 ath_lookup_rate(struct ath_so
104 max_4ms_framelen = ATH_AMPDU_LIMIT_MAX;
105
106 for (i = 0; i < 4; i++) {
107 - if (rates[i].count) {
108 - int modeidx;
109 - if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
110 - legacy = 1;
111 - break;
112 - }
113 -
114 - if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
115 - modeidx = MCS_HT40;
116 - else
117 - modeidx = MCS_HT20;
118 + int modeidx;
119
120 - if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
121 - modeidx++;
122 + if (!rates[i].count)
123 + continue;
124
125 - frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
126 - max_4ms_framelen = min(max_4ms_framelen, frmlen);
127 + if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
128 + legacy = 1;
129 + break;
130 }
131 +
132 + if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
133 + modeidx = MCS_HT40;
134 + else
135 + modeidx = MCS_HT20;
136 +
137 + if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
138 + modeidx++;
139 +
140 + frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
141 + max_4ms_framelen = min(max_4ms_framelen, frmlen);
142 }
143
144 /*
145 @@ -1598,11 +1595,9 @@ void ath_txq_schedule(struct ath_softc *
146 break;
147 }
148
149 - if (!list_empty(&ac->tid_q)) {
150 - if (!ac->sched) {
151 - ac->sched = true;
152 - list_add_tail(&ac->list, &txq->axq_acq);
153 - }
154 + if (!list_empty(&ac->tid_q) && !ac->sched) {
155 + ac->sched = true;
156 + list_add_tail(&ac->list, &txq->axq_acq);
157 }
158
159 if (ac == last_ac ||