From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH rtw-next v1 02/13] wifi: rtw89: Get dle_mem via rtw89_hci_dle_mem()
Date: Mon, 26 May 2025 01:04:53 +0300 [thread overview]
Message-ID: <83a7ade0-2c9a-4148-b998-db52e05587b8@gmail.com> (raw)
In-Reply-To: <e587721eeb7244beaa1f07b88d9b4f59@realtek.com>
On 14/05/2025 03:56, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> Don't access dle_mem in get_dle_mem_cfg() directly. USB 2, USB 3, and
>> SDIO will need different sets of values.
>>
>> Rename dle_mem in struct rtw89_chip_info to dle_mem_pcie and get it
>> via rtw89_hci_dle_mem() and rtw89_pci_ops_dle_mem().
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>> drivers/net/wireless/realtek/rtw89/core.h | 10 +++++++++-
>> drivers/net/wireless/realtek/rtw89/mac.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/pci.c | 8 ++++++++
>> drivers/net/wireless/realtek/rtw89/rtw8851b.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/rtw8852a.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/rtw8852b.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/rtw8852bt.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 +-
>> drivers/net/wireless/realtek/rtw89/rtw8922a.c | 2 +-
>> 9 files changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
>> index be1259cfa712..afcf0353a625 100644
>> --- a/drivers/net/wireless/realtek/rtw89/core.h
>> +++ b/drivers/net/wireless/realtek/rtw89/core.h
>> @@ -3579,6 +3579,8 @@ struct rtw89_hci_ops {
>> void (*disable_intr)(struct rtw89_dev *rtwdev);
>> void (*enable_intr)(struct rtw89_dev *rtwdev);
>> int (*rst_bdram)(struct rtw89_dev *rtwdev);
>
> an empty line
>
>> + const struct rtw89_dle_mem *(*dle_mem)(struct rtw89_dev *rtwdev,
>> + u8 qta_mode);
>> };
>>
>> struct rtw89_hci_info {
>> @@ -4271,7 +4273,7 @@ struct rtw89_chip_info {
>> bool dis_2g_40m_ul_ofdma;
>> u32 rsvd_ple_ofst;
>> const struct rtw89_hfc_param_ini *hfc_param_ini;
>> - const struct rtw89_dle_mem *dle_mem;
>> + const struct rtw89_dle_mem *dle_mem_pcie;
>
> I reconsider if this can be an array with a new enum = {PCIE, USB2, USB3, SDIO}
> stored in hal->hci_dle_mem_type. Then, consumers can just access it via
> chip->dle_mem[hal->hci_dle_mem_type][quota]. But, I'm not sure if USB
> subsystem can notify driver when USB speed is changed.
>
> This is a thought to simply the struct definition.
>
The hard part is naming the new enum. It's basically rtw89_hci_type
but more detailed.
I don't expect the USB speed to change during the lifetime of struct
rtw89_dev. When the device switches from USB 2 to USB 3 it disconnects
and reappears as a new device:
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: new high-speed USB device number 17 using xhci_hcd
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: New USB device found, idVendor=0bda, idProduct=c832, bcdDevice= 0.00
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: Product: 802.11ax WLAN Adapter
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: Manufacturer: Realtek
Apr 21 22:02:22 ideapad2 kernel: usb 1-4: SerialNumber: 00e04c000001
Apr 21 22:02:24 ideapad2 kernel: eric-tx CALL alloc_txring !!!!
Apr 21 22:02:24 ideapad2 kernel: usb 1-4: USB disconnect, device number 17
Apr 21 22:02:24 ideapad2 kernel: rtl8852cu 1-4:1.0: Runtime PM usage count underflow!
Apr 21 22:02:27 ideapad2 kernel: usb 2-4: new SuperSpeed USB device number 2 using xhci_hcd
Apr 21 22:02:27 ideapad2 kernel: usb 2-4: New USB device found, idVendor=0bda, idProduct=c832, bcdDevice= 0.00
Apr 21 22:02:28 ideapad2 kernel: usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 21 22:02:28 ideapad2 kernel: usb 2-4: Product: 802.11ax WLAN Adapter
Apr 21 22:02:28 ideapad2 kernel: usb 2-4: Manufacturer: Realtek
Apr 21 22:02:28 ideapad2 kernel: usb 2-4: SerialNumber: 00e04c000001
Apr 21 22:02:28 ideapad2 kernel: eric-tx CALL alloc_txring !!!!
Apr 21 22:02:28 ideapad2 kernel: rtl8852cu 2-4:1.0 wlp3s0f3u4: renamed from wlan0
>> u8 wde_qempty_acq_grpnum;
>> u8 wde_qempty_mgq_grpsel;
>> u32 rf_base_addr[2];
>> @@ -6146,6 +6148,12 @@ static inline void rtw89_hci_clear(struct rtw89_dev *rtwdev, struct pci_dev *pde
>> rtwdev->hci.ops->clear(rtwdev, pdev);
>> }
>>
>> +static inline const
>> +struct rtw89_dle_mem *rtw89_hci_dle_mem(struct rtw89_dev *rtwdev, u8 qta_mode)
>> +{
>> + return rtwdev->hci.ops->dle_mem(rtwdev, qta_mode);
>> +}
>> +
>> static inline
>> struct rtw89_tx_skb_data *RTW89_TX_SKB_CB(struct sk_buff *skb)
>> {
>> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
>> index 592fbb6d2728..77d35db3e133 100644
>> --- a/drivers/net/wireless/realtek/rtw89/mac.c
>> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
>> @@ -1719,7 +1719,7 @@ static const struct rtw89_dle_mem *get_dle_mem_cfg(struct rtw89_dev *rtwdev,
>> struct rtw89_mac_info *mac = &rtwdev->mac;
>> const struct rtw89_dle_mem *cfg;
>>
>> - cfg = &rtwdev->chip->dle_mem[mode];
>> + cfg = rtw89_hci_dle_mem(rtwdev, mode);
>> if (!cfg)
>> return NULL;
>>
>> diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
>> index c2fe5a898dc7..1dec603012ba 100644
>> --- a/drivers/net/wireless/realtek/rtw89/pci.c
>> +++ b/drivers/net/wireless/realtek/rtw89/pci.c
>> @@ -4341,6 +4341,13 @@ static int __maybe_unused rtw89_pci_resume(struct device *dev)
>> SIMPLE_DEV_PM_OPS(rtw89_pm_ops, rtw89_pci_suspend, rtw89_pci_resume);
>> EXPORT_SYMBOL(rtw89_pm_ops);
>>
>> +static const
>> +struct rtw89_dle_mem *rtw89_pci_ops_dle_mem(struct rtw89_dev *rtwdev,
>> + u8 qta_mode)
>> +{
>> + return &rtwdev->chip->dle_mem_pcie[qta_mode];
>> +}
>> +
>> const struct rtw89_pci_gen_def rtw89_pci_gen_ax = {
>> .isr_rdu = B_AX_RDU_INT,
>> .isr_halt_c2h = B_AX_HALT_C2H_INT_EN,
>> @@ -4413,6 +4420,7 @@ static const struct rtw89_hci_ops rtw89_pci_ops = {
>> .disable_intr = rtw89_pci_disable_intr_lock,
>> .enable_intr = rtw89_pci_enable_intr_lock,
>> .rst_bdram = rtw89_pci_reset_bdram,
>
> an empty line
>
>> + .dle_mem = rtw89_pci_ops_dle_mem,
>> };
>>
>
> [...]
>
>
next prev parent reply other threads:[~2025-05-25 22:04 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-04 20:47 [PATCH rtw-next v1 00/13] wifi: rtw89: Add support for USB devices Bitterblue Smith
2025-05-04 20:49 ` [PATCH rtw-next v1 01/13] wifi: rtw89: 8851b: Accept USB devices and load their MAC address Bitterblue Smith
2025-05-13 2:46 ` Ping-Ke Shih
2025-05-04 20:49 ` [PATCH rtw-next v1 02/13] wifi: rtw89: Get dle_mem via rtw89_hci_dle_mem() Bitterblue Smith
2025-05-13 2:51 ` Ping-Ke Shih
2025-05-14 0:56 ` Ping-Ke Shih
2025-05-25 22:04 ` Bitterblue Smith [this message]
2025-05-26 2:52 ` Ping-Ke Shih
2025-05-04 20:49 ` [PATCH rtw-next v1 03/13] wifi: rtw89: Rename hfc_param_ini to hfc_param_ini_pcie Bitterblue Smith
2025-05-13 3:04 ` Ping-Ke Shih
2025-05-04 20:50 ` [PATCH rtw-next v1 04/13] wifi: rtw89: Add dle_mem_usb2 and dle_mem_usb3 Bitterblue Smith
2025-05-13 3:06 ` Ping-Ke Shih
2025-05-04 20:51 ` [PATCH rtw-next v1 05/13] wifi: rtw89: Add hfc_param_ini_usb Bitterblue Smith
2025-05-13 3:12 ` Ping-Ke Shih
2025-05-25 21:55 ` Bitterblue Smith
2025-05-26 1:51 ` Ping-Ke Shih
2025-05-26 6:29 ` Ping-Ke Shih
2025-05-31 20:57 ` Bitterblue Smith
2025-05-31 20:54 ` Bitterblue Smith
2025-05-04 20:51 ` [PATCH rtw-next v1 06/13] wifi: rtw89: Disable some power saving for USB Bitterblue Smith
2025-05-13 3:27 ` Ping-Ke Shih
2025-05-25 21:57 ` Bitterblue Smith
2025-05-26 2:36 ` Ping-Ke Shih
2025-05-04 20:51 ` [PATCH rtw-next v1 07/13] wifi: rtw89: Add extra TX headroom " Bitterblue Smith
2025-05-13 3:28 ` Ping-Ke Shih
2025-05-04 20:52 ` [PATCH rtw-next v1 08/13] wifi: rtw89: Hide some errors when the device is unplugged Bitterblue Smith
2025-05-13 3:43 ` Ping-Ke Shih
2025-05-25 21:58 ` Bitterblue Smith
2025-05-04 20:52 ` [PATCH rtw-next v1 09/13] wifi: rtw89: Fix rtw89_mac_power_switch() for USB Bitterblue Smith
2025-05-13 3:50 ` Ping-Ke Shih
2025-05-25 21:58 ` Bitterblue Smith
2025-05-26 2:45 ` Ping-Ke Shih
2025-05-04 20:53 ` [PATCH rtw-next v1 10/13] wifi: rtw89: Add some definitions " Bitterblue Smith
2025-05-13 3:52 ` Ping-Ke Shih
2025-05-04 20:54 ` [PATCH rtw-next v1 11/13] wifi: rtw89: Add usb.{c,h} Bitterblue Smith
2025-05-13 6:12 ` Ping-Ke Shih
2025-05-25 22:03 ` Bitterblue Smith
2025-05-26 3:18 ` Ping-Ke Shih
2025-05-31 21:03 ` Bitterblue Smith
2025-05-04 20:54 ` [PATCH rtw-next v1 12/13] wifi: rtw89: Add rtw8851bu.c Bitterblue Smith
2025-05-13 6:14 ` Ping-Ke Shih
2025-05-04 20:55 ` [PATCH rtw-next v1 13/13] wifi: rtw89: Enable the new USB modules Bitterblue Smith
2025-05-13 6:14 ` Ping-Ke Shih
2025-05-13 6:22 ` [PATCH rtw-next v1 00/13] wifi: rtw89: Add support for USB devices Ping-Ke Shih
2025-05-13 7:07 ` Ping-Ke Shih
2025-05-25 22:03 ` Bitterblue Smith
2025-05-26 1:35 ` 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=83a7ade0-2c9a-4148-b998-db52e05587b8@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.