From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Subject: [PATCH rtw-next v2 04/11] wifi: rtw89: usb: Fix rtw89_usb_ops_mac_post_init() for RTL8852CU
Date: Fri, 1 Aug 2025 23:53:29 +0300 [thread overview]
Message-ID: <2e628a7b-5548-434c-860b-ddeefe3fa4e1@gmail.com> (raw)
In-Reply-To: <f4a7a1c4-3d64-4af3-bc77-b12d7c1320e7@gmail.com>
The registers used in this function are located at different offsets in
RTL8852CU compared to other chips. Use the right registers for each
chip.
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v2:
- No change, messed up sending v1.
---
drivers/net/wireless/realtek/rtw89/usb.c | 25 +++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c
index e749a37ac1b5..1c65fbdf7673 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.c
+++ b/drivers/net/wireless/realtek/rtw89/usb.c
@@ -772,10 +772,29 @@ static int rtw89_usb_ops_mac_pre_deinit(struct rtw89_dev *rtwdev)
static int rtw89_usb_ops_mac_post_init(struct rtw89_dev *rtwdev)
{
struct rtw89_usb *rtwusb = rtw89_usb_priv(rtwdev);
+ u32 usb3_mac_npi_config_intf_0, usb_endpoint_0, usb_endpoint_2;
enum usb_device_speed speed;
u32 ep;
- rtw89_write32_clr(rtwdev, R_AX_USB3_MAC_NPI_CONFIG_INTF_0,
+ switch (rtwdev->chip->chip_id) {
+ case RTL8851B:
+ case RTL8852A:
+ case RTL8852B:
+ usb3_mac_npi_config_intf_0 = R_AX_USB3_MAC_NPI_CONFIG_INTF_0;
+ usb_endpoint_0 = R_AX_USB_ENDPOINT_0;
+ usb_endpoint_2 = R_AX_USB_ENDPOINT_2;
+ break;
+ case RTL8852C:
+ usb3_mac_npi_config_intf_0 = R_AX_USB3_MAC_NPI_CONFIG_INTF_0_V1;
+ usb_endpoint_0 = R_AX_USB_ENDPOINT_0_V1;
+ usb_endpoint_2 = R_AX_USB_ENDPOINT_2_V1;
+ break;
+ default:
+ rtw89_err(rtwdev, "%s: unknown chip\n", __func__);
+ return -EOPNOTSUPP;
+ }
+
+ rtw89_write32_clr(rtwdev, usb3_mac_npi_config_intf_0,
B_AX_SSPHY_LFPS_FILTER);
speed = rtwusb->udev->speed;
@@ -791,9 +810,9 @@ static int rtw89_usb_ops_mac_post_init(struct rtw89_dev *rtwdev)
if (ep == 8)
continue;
- rtw89_write8_mask(rtwdev, R_AX_USB_ENDPOINT_0,
+ rtw89_write8_mask(rtwdev, usb_endpoint_0,
B_AX_EP_IDX, ep);
- rtw89_write8(rtwdev, R_AX_USB_ENDPOINT_2 + 1, NUMP);
+ rtw89_write8(rtwdev, usb_endpoint_2 + 1, NUMP);
}
return 0;
--
2.50.0
next prev parent reply other threads:[~2025-08-01 20:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 20:49 [PATCH rtw-next v2 00/11] wifi: rtw89: Add support for RTL8852CU Bitterblue Smith
2025-08-01 20:51 ` [PATCH rtw-next v2 01/11] wifi: rtw89: Fix rtw89_core_get_ch_dma() " Bitterblue Smith
2025-08-04 18:44 ` Bitterblue Smith
2025-08-05 0:40 ` Ping-Ke Shih
2025-08-10 21:37 ` Bitterblue Smith
2025-08-26 9:00 ` Ping-Ke Shih
2025-08-26 16:38 ` Bitterblue Smith
2025-08-01 20:52 ` [PATCH rtw-next v2 02/11] wifi: rtw89: usb: Fix rtw89_usb_get_bulkout_id() " Bitterblue Smith
2025-08-08 5:54 ` Ping-Ke Shih
2025-08-10 21:58 ` Bitterblue Smith
2025-08-01 20:53 ` [PATCH rtw-next v2 03/11] wifi: rtw89: usb: Fix rtw89_usb_ops_mac_pre_init() " Bitterblue Smith
2025-08-08 6:00 ` Ping-Ke Shih
2025-08-01 20:53 ` Bitterblue Smith [this message]
2025-08-08 6:02 ` [PATCH rtw-next v2 04/11] wifi: rtw89: usb: Fix rtw89_usb_ops_mac_post_init() " Ping-Ke Shih
2025-08-01 20:54 ` [PATCH rtw-next v2 05/11] wifi: rtw89: Fix rtw89_mac_dmac_func_pre_en_ax() for USB/SDIO Bitterblue Smith
2025-08-08 6:03 ` Ping-Ke Shih
2025-08-01 20:54 ` [PATCH rtw-next v2 06/11] wifi: rtw89: 8852c: Fix rtw8852c_pwr_{on,off}_func() for USB Bitterblue Smith
2025-08-08 6:04 ` Ping-Ke Shih
2025-08-01 21:03 ` [PATCH rtw-next v2 07/11] wifi: rtw89: Add rtw8852c_dle_mem_usb{2,3} Bitterblue Smith
2025-08-08 6:05 ` Ping-Ke Shih
2025-08-01 21:03 ` [PATCH rtw-next v2 08/11] wifi: rtw89: Add rtw8852c_hfc_param_ini_usb Bitterblue Smith
2025-08-08 6:07 ` Ping-Ke Shih
2025-08-01 21:04 ` [PATCH rtw-next v2 09/11] wifi: rtw89: 8852c: Accept USB devices and load their MAC address Bitterblue Smith
2025-08-08 6:11 ` Ping-Ke Shih
2025-08-01 21:06 ` [PATCH rtw-next v2 10/11] wifi: rtw89: Add rtw8852cu.c Bitterblue Smith
2025-08-08 6:13 ` Ping-Ke Shih
2025-08-01 21:07 ` [PATCH rtw-next v2 11/11] wifi: rtw89: Enable the new rtw89_8852cu module Bitterblue Smith
2025-08-08 6:13 ` Ping-Ke Shih
2025-08-01 23:08 ` rtw89: RTL8832CU loses the connection Bitterblue Smith
2025-08-08 6:21 ` Ping-Ke Shih
2025-08-10 22:06 ` Bitterblue Smith
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=2e628a7b-5548-434c-860b-ddeefe3fa4e1@gmail.com \
--to=rtl8821cerfe2@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
/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.