dc8afb9186f25029312f85bca9b994fc3a604a66
[openwrt/staging/nbd.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 24 Nov 2021 10:30:41 +0100
3 Subject: [PATCH] mac80211: fix regression in SSN handling of addba tx
4
5 Some drivers that do their own sequence number allocation (e.g. ath9k) rely
6 on being able to modify params->ssn on starting tx ampdu sessions.
7 This was broken by a change that modified it to use sta->tid_seq[tid] instead.
8
9 Cc: stable@vger.kernel.org
10 Fixes: 31d8bb4e07f8 ("mac80211: agg-tx: refactor sending addba")
11 Reported-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 ---
14
15 --- a/net/mac80211/agg-tx.c
16 +++ b/net/mac80211/agg-tx.c
17 @@ -480,8 +480,7 @@ static void ieee80211_send_addba_with_ti
18
19 /* send AddBA request */
20 ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
21 - tid_tx->dialog_token,
22 - sta->tid_seq[tid] >> 4,
23 + tid_tx->dialog_token, tid_tx->ssn,
24 buf_size, tid_tx->timeout);
25
26 WARN_ON(test_and_set_bit(HT_AGG_STATE_SENT_ADDBA, &tid_tx->state));
27 @@ -523,6 +522,7 @@ void ieee80211_tx_ba_session_handle_star
28
29 params.ssn = sta->tid_seq[tid] >> 4;
30 ret = drv_ampdu_action(local, sdata, &params);
31 + tid_tx->ssn = params.ssn;
32 if (ret == IEEE80211_AMPDU_TX_START_DELAY_ADDBA) {
33 return;
34 } else if (ret == IEEE80211_AMPDU_TX_START_IMMEDIATE) {
35 --- a/net/mac80211/sta_info.h
36 +++ b/net/mac80211/sta_info.h
37 @@ -199,6 +199,7 @@ struct tid_ampdu_tx {
38 u8 stop_initiator;
39 bool tx_stop;
40 u16 buf_size;
41 + u16 ssn;
42
43 u16 failed_bar_ssn;
44 bool bar_pending;