]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: setting TBTT AGG number when mac port initialization
authorChih-Kang Chang <gary.chang@realtek.com>
Tue, 23 Dec 2025 03:06:50 +0000 (11:06 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 26 Dec 2025 03:03:13 +0000 (11:03 +0800)
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>
Link: https://patch.msgid.link/20251223030651.480633-12-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/mac.c

index 7cbe3ffd5dc86f7728b37546521ebbb5745725be..fae0527e50e8ee76987a5fcfa188492b7ebee2b9 100644 (file)
@@ -4382,6 +4382,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)
 
@@ -4685,6 +4686,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)
 {
@@ -4945,6 +4956,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);