f6d3d78d7c7efe0e83324a6f01fe63bb29ecf5c8
[openwrt/staging/dedeckeh.git] /
1 From: Ryder Lee <ryder.lee@mediatek.com>
2 Date: Sat, 18 Feb 2023 01:50:05 +0800
3 Subject: [PATCH] wifi: mac80211: introduce
4 ieee80211_refresh_tx_agg_session_timer()
5
6 This allows low level drivers to refresh the tx agg session timer, based on
7 querying stats from the firmware usually. Especially for some mt76 devices
8 support .net_fill_forward_path would bypass mac80211, which leads to tx BA
9 session timeout for certain clients.
10
11 Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
12 ---
13
14 --- a/include/net/mac80211.h
15 +++ b/include/net/mac80211.h
16 @@ -5968,6 +5968,18 @@ void ieee80211_queue_delayed_work(struct
17 unsigned long delay);
18
19 /**
20 + * ieee80211_refresh_tx_agg_session_timer - Refresh a tx agg session timer.
21 + * @sta: the station for which to start a BA session
22 + * @tid: the TID to BA on.
23 + *
24 + * This function allows low level driver to refresh tx agg session timer
25 + * to maintain BA session, the session level will still be managed by the
26 + * mac80211.
27 + */
28 +void ieee80211_refresh_tx_agg_session_timer(struct ieee80211_sta *sta,
29 + u16 tid);
30 +
31 +/**
32 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
33 * @sta: the station for which to start a BA session
34 * @tid: the TID to BA on.
35 --- a/net/mac80211/agg-tx.c
36 +++ b/net/mac80211/agg-tx.c
37 @@ -552,6 +552,23 @@ void ieee80211_tx_ba_session_handle_star
38 ieee80211_send_addba_with_timeout(sta, tid_tx);
39 }
40
41 +void ieee80211_refresh_tx_agg_session_timer(struct ieee80211_sta *pubsta,
42 + u16 tid)
43 +{
44 + struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
45 + struct tid_ampdu_tx *tid_tx;
46 +
47 + if (WARN_ON_ONCE(tid >= IEEE80211_NUM_TIDS))
48 + return;
49 +
50 + tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
51 + if (!tid_tx)
52 + return;
53 +
54 + tid_tx->last_tx = jiffies;
55 +}
56 +EXPORT_SYMBOL(ieee80211_refresh_tx_agg_session_timer);
57 +
58 /*
59 * After accepting the AddBA Response we activated a timer,
60 * resetting it after each frame that we send.