All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <gary.chang@realtek.com>, <damon.chen@realtek.com>,
	<kevin_yang@realtek.com>
Subject: [PATCH rtw-next 11/12] wifi: rtw89: setting TBTT AGG number when mac port initialization
Date: Fri, 12 Dec 2025 11:13:02 +0800	[thread overview]
Message-ID: <20251212031303.19882-12-pkshih@realtek.com> (raw)
In-Reply-To: <20251212031303.19882-1-pkshih@realtek.com>

From: Chih-Kang Chang <gary.chang@realtek.com>

When initializing mac port, needs to set TBTT AGG number to trigger TBTT
related interrupts. Otherwise, after sending join info H2C command with
disconnection mode, firmware will clear TBTT AGG number. Without the
setting from mac port initialization after that, this port will not be
able to transmit beacons.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/mac.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 066c99f3e53a..7ffb039e7d1b 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -4422,6 +4422,7 @@ static void rtw89_mac_bcn_drop(struct rtw89_dev *rtwdev,
 #define BCN_HOLD_DEF 200
 #define BCN_MASK_DEF 0
 #define TBTT_ERLY_DEF 5
+#define TBTT_AGG_DEF 1
 #define BCN_SET_UNIT 32
 #define BCN_ERLY_SET_DLY (10 * 2)
 
@@ -4725,6 +4726,16 @@ static void rtw89_mac_port_cfg_tbtt_early(struct rtw89_dev *rtwdev,
 				B_AX_TBTTERLY_MASK, TBTT_ERLY_DEF);
 }
 
+static void rtw89_mac_port_cfg_tbtt_agg(struct rtw89_dev *rtwdev,
+					struct rtw89_vif_link *rtwvif_link)
+{
+	const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;
+	const struct rtw89_port_reg *p = mac->port_base;
+
+	rtw89_write16_port_mask(rtwdev, rtwvif_link, p->tbtt_agg,
+				B_AX_TBTT_AGG_NUM_MASK, TBTT_AGG_DEF);
+}
+
 static void rtw89_mac_port_cfg_bss_color(struct rtw89_dev *rtwdev,
 					 struct rtw89_vif_link *rtwvif_link)
 {
@@ -4985,6 +4996,7 @@ int rtw89_mac_port_update(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvi
 	rtw89_mac_port_cfg_bcn_hold_time(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_bcn_mask_area(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_tbtt_early(rtwdev, rtwvif_link);
+	rtw89_mac_port_cfg_tbtt_agg(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_bss_color(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_mbssid(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_func_en(rtwdev, rtwvif_link, true);
-- 
2.25.1


  parent reply	other threads:[~2025-12-12  3:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12  3:12 [PATCH rtw-next 00/12] wifi: rtw89: refine MLO, MCC and SER functions Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 01/12] wifi: rtw89: 8852b: increase beacon loss to 6 seconds Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 02/12] wifi: rtw89: mlo: fix missing TX null-data 1 during link switch Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 03/12] wifi: rtw89: mlo: fix incorrect link address in management frames Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 04/12] wifi: rtw89: mac: reset power state before switching to power on Ping-Ke Shih
2025-12-14 22:30   ` Bitterblue Smith
2025-12-15  2:05     ` Ping-Ke Shih
2025-12-15 18:06       ` Bitterblue Smith
2025-12-16  0:34         ` Ping-Ke Shih
2025-12-16  9:06           ` Ping-Ke Shih
2025-12-17 18:05             ` Bitterblue Smith
2025-12-12  3:12 ` [PATCH rtw-next 05/12] wifi: rtw89: ser: enable error IMR after recovering from L1 Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 06/12] wifi: rtw89: ser: L1 skip polling status if FW runs event mode Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 07/12] wifi: rtw89: debug: add ser_counters dbgfs Ping-Ke Shih
2025-12-12  3:12 ` [PATCH rtw-next 08/12] wifi: rtw89: debug: support SER L0/L1 simulation via halt H2C Ping-Ke Shih
2025-12-12  3:13 ` [PATCH rtw-next 09/12] wifi: rtw89: refine C2H reg event polling timeout for LPS Ping-Ke Shih
2025-12-12  3:13 ` [PATCH rtw-next 10/12] wifi: rtw89: warn unexpected polling value of XTAL SI Ping-Ke Shih
2025-12-14 22:32   ` Bitterblue Smith
2025-12-15  1:24     ` Ping-Ke Shih
2025-12-15 22:13       ` Bitterblue Smith
2025-12-16  0:29         ` Ping-Ke Shih
2025-12-12  3:13 ` Ping-Ke Shih [this message]
2025-12-12  3:13 ` [PATCH rtw-next 12/12] wifi: rtw89: mcc: reset probe counter when receiving beacon Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251212031303.19882-12-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=damon.chen@realtek.com \
    --cc=gary.chang@realtek.com \
    --cc=kevin_yang@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.