aa162b65476a774c900a10c6bf60683ba16ae427
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 571-ath9k_send_bar_fix.patch
1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -246,6 +246,7 @@ struct ath_atx_tid {
4 };
5
6 struct ath_node {
7 + struct ieee80211_vif *vif;
8 #ifdef CONFIG_ATH9K_DEBUGFS
9 struct list_head list; /* for sc->nodes */
10 struct ieee80211_sta *sta; /* station struct we're part of */
11 @@ -274,7 +275,6 @@ struct ath_tx_control {
12
13 #define ATH_TX_ERROR 0x01
14 #define ATH_TX_XRETRY 0x02
15 -#define ATH_TX_BAR 0x04
16
17 /**
18 * @txq_map: Index is mac80211 queue number. This is
19 --- a/drivers/net/wireless/ath/ath9k/main.c
20 +++ b/drivers/net/wireless/ath/ath9k/main.c
21 @@ -1801,6 +1801,7 @@ static int ath9k_sta_add(struct ieee8021
22 struct ieee80211_key_conf ps_key = { };
23
24 ath_node_attach(sc, sta);
25 + an->vif = vif;
26
27 if (vif->type != NL80211_IFTYPE_AP &&
28 vif->type != NL80211_IFTYPE_AP_VLAN)
29 --- a/drivers/net/wireless/ath/ath9k/xmit.c
30 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
31 @@ -51,7 +51,7 @@ static void ath_tx_send_normal(struct at
32 struct list_head *bf_head);
33 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
34 struct ath_txq *txq, struct list_head *bf_q,
35 - struct ath_tx_status *ts, int txok, int sendbar);
36 + struct ath_tx_status *ts, int txok);
37 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
38 struct list_head *head, bool internal);
39 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len);
40 @@ -166,7 +166,7 @@ static void ath_tx_flush_tid(struct ath_
41 fi = get_frame_info(bf->bf_mpdu);
42 if (fi->retries) {
43 ath_tx_update_baw(sc, tid, fi->seqno);
44 - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1);
45 + ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
46 } else {
47 ath_tx_send_normal(sc, txq, NULL, &bf_head);
48 }
49 @@ -238,7 +238,7 @@ static void ath_tid_drain(struct ath_sof
50 ath_tx_update_baw(sc, tid, fi->seqno);
51
52 spin_unlock(&txq->axq_lock);
53 - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
54 + ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
55 spin_lock(&txq->axq_lock);
56 }
57
58 @@ -381,8 +381,7 @@ static void ath_tx_complete_aggr(struct
59 list_move_tail(&bf->list, &bf_head);
60
61 ath_tx_rc_status(sc, bf, ts, 1, 1, 0, false);
62 - ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
63 - 0, 0);
64 + ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0);
65
66 bf = bf_next;
67 }
68 @@ -426,7 +425,7 @@ static void ath_tx_complete_aggr(struct
69
70 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
71 while (bf) {
72 - txfail = txpending = sendbar = 0;
73 + txfail = txpending = 0;
74 bf_next = bf->bf_next;
75
76 skb = bf->bf_mpdu;
77 @@ -489,7 +488,7 @@ static void ath_tx_complete_aggr(struct
78 }
79
80 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
81 - !txfail, sendbar);
82 + !txfail);
83 } else {
84 /* retry the un-acked ones */
85 ath9k_hw_set_clrdmask(sc->sc_ah, bf->bf_desc, false);
86 @@ -514,7 +513,7 @@ static void ath_tx_complete_aggr(struct
87 nbad, 0, false);
88 ath_tx_complete_buf(sc, bf, txq,
89 &bf_head,
90 - ts, 0, 0);
91 + ts, 0);
92 break;
93 }
94
95 @@ -564,6 +563,9 @@ static void ath_tx_complete_aggr(struct
96 }
97 }
98
99 + if (sendbar || (tid->state & AGGR_CLEANUP))
100 + ieee80211_send_bar(an->vif, sta->addr, tidno, tid->seq_start << 4);
101 +
102 rcu_read_unlock();
103
104 if (needreset)
105 @@ -900,6 +902,7 @@ void ath_tx_aggr_stop(struct ath_softc *
106 spin_unlock_bh(&txq->axq_lock);
107
108 ath_tx_flush_tid(sc, txtid);
109 + ieee80211_send_bar(an->vif, sta->addr, tid, txtid->seq_start << 4);
110 }
111
112 bool ath_tx_aggr_sleep(struct ath_softc *sc, struct ath_node *an)
113 @@ -1178,7 +1181,7 @@ static void ath_drain_txq_list(struct at
114 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0,
115 retry_tx);
116 else
117 - ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
118 + ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
119 spin_lock_bh(&txq->axq_lock);
120 }
121 }
122 @@ -1885,9 +1888,6 @@ static void ath_tx_complete(struct ath_s
123
124 ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
125
126 - if (tx_flags & ATH_TX_BAR)
127 - tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
128 -
129 if (!(tx_flags & (ATH_TX_ERROR | ATH_TX_XRETRY))) {
130 /* Frame was ACKed */
131 tx_info->flags |= IEEE80211_TX_STAT_ACK;
132 @@ -1932,15 +1932,12 @@ static void ath_tx_complete(struct ath_s
133
134 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
135 struct ath_txq *txq, struct list_head *bf_q,
136 - struct ath_tx_status *ts, int txok, int sendbar)
137 + struct ath_tx_status *ts, int txok)
138 {
139 struct sk_buff *skb = bf->bf_mpdu;
140 unsigned long flags;
141 int tx_flags = 0;
142
143 - if (sendbar)
144 - tx_flags = ATH_TX_BAR;
145 -
146 if (!txok) {
147 tx_flags |= ATH_TX_ERROR;
148
149 @@ -2056,7 +2053,7 @@ static void ath_tx_process_buffer(struct
150 if (ts->ts_status & ATH9K_TXERR_XRETRY)
151 bf->bf_state.bf_type |= BUF_XRETRY;
152 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok, true);
153 - ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0);
154 + ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok);
155 } else
156 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true);
157