Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: mac80211: introduce ieee80211_refresh_tx_agg_session_timer()
@ 2023-02-17 17:50 Ryder Lee
  2023-02-17 17:50 ` [PATCH 2/2] wifi: mt76: connac: refresh tx session timer for WED device Ryder Lee
  2023-02-17 18:01 ` [PATCH 1/2] wifi: mac80211: introduce ieee80211_refresh_tx_agg_session_timer() Johannes Berg
  0 siblings, 2 replies; 10+ messages in thread
From: Ryder Lee @ 2023-02-17 17:50 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Shayne Chen, Evelyn Tsai, linux-wireless, linux-mediatek,
	Ryder Lee

This allows low level drivers to refresh the tx agg session timer, based on
querying stats from the firmware usually. Especially for some mt76 devices
support .net_fill_forward_path would bypass mac80211, which leads to tx BA
session timeout for certain clients.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 include/net/mac80211.h | 12 ++++++++++++
 net/mac80211/agg-tx.c  | 17 +++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 76a12bec71d5..920ea31620cd 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -5993,6 +5993,18 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw,
 				  struct delayed_work *dwork,
 				  unsigned long delay);
 
+/**
+ * ieee80211_refresh_tx_agg_session_timer - Refresh a tx agg session timer.
+ * @sta: the station for which to start a BA session
+ * @tid: the TID to BA on.
+ *
+ * This function allows low level driver to refresh tx agg session timer
+ * to maintain BA session, the session level will still be managed by the
+ * mac80211.
+ */
+void ieee80211_refresh_tx_agg_session_timer(struct ieee80211_sta *sta,
+					    u16 tid);
+
 /**
  * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
  * @sta: the station for which to start a BA session
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index f9514bacbd4a..3b651e7f5a73 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -554,6 +554,23 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
 	ieee80211_send_addba_with_timeout(sta, tid_tx);
 }
 
+void ieee80211_refresh_tx_agg_session_timer(struct ieee80211_sta *pubsta,
+					    u16 tid)
+{
+	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
+	struct tid_ampdu_tx *tid_tx;
+
+	if (WARN_ON_ONCE(tid >= IEEE80211_NUM_TIDS))
+		return;
+
+	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
+	if (!tid_tx)
+		return;
+
+	tid_tx->last_tx = jiffies;
+}
+EXPORT_SYMBOL(ieee80211_refresh_tx_agg_session_timer);
+
 /*
  * After accepting the AddBA Response we activated a timer,
  * resetting it after each frame that we send.
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-02-21 19:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-17 17:50 [PATCH 1/2] wifi: mac80211: introduce ieee80211_refresh_tx_agg_session_timer() Ryder Lee
2023-02-17 17:50 ` [PATCH 2/2] wifi: mt76: connac: refresh tx session timer for WED device Ryder Lee
2023-02-17 18:01 ` [PATCH 1/2] wifi: mac80211: introduce ieee80211_refresh_tx_agg_session_timer() Johannes Berg
2023-02-17 18:43   ` Ryder Lee
2023-02-17 18:53     ` Johannes Berg
2023-02-17 19:02       ` Ryder Lee
2023-02-20  2:55         ` Ryder Lee
2023-02-20  3:35           ` Ryder Lee
2023-02-21  9:57             ` Johannes Berg
2023-02-21 19:04               ` Ryder Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox