linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH rtw-next v2 02/11] wifi: rtw89: usb: Fix rtw89_usb_get_bulkout_id() for RTL8852CU
Date: Fri, 8 Aug 2025 05:54:43 +0000	[thread overview]
Message-ID: <6e8f5326d25046fea5f2033bc6c9c5cb@realtek.com> (raw)
In-Reply-To: <3fcb3d66-4c01-4396-84b1-268bf4f0d2f6@gmail.com>

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Sent: Saturday, August 2, 2025 4:53 AM
> RTL8852CU can work in two bands at the same time, thus some USB bulk
> out endpoints are dedicated to one band, others to the other band.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
> v2:
>  - No change, messed up sending v1.
> ---
>  drivers/net/wireless/realtek/rtw89/usb.c | 64 +++++++++++++++++-------
>  1 file changed, 46 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c
> index 6cf89aee252e..eb9978a60d04 100644
> --- a/drivers/net/wireless/realtek/rtw89/usb.c
> +++ b/drivers/net/wireless/realtek/rtw89/usb.c
> @@ -167,24 +167,52 @@ rtw89_usb_ops_check_and_reclaim_tx_resource(struct rtw89_dev *rtwdev,
>         return 42; /* TODO some kind of calculation? */
>  }
> 
> -static u8 rtw89_usb_get_bulkout_id(u8 ch_dma)
> +static u8 rtw89_usb_get_bulkout_id(struct rtw89_dev *rtwdev, u8 ch_dma)
>  {
> -       switch (ch_dma) {
> -       case RTW89_DMA_ACH0:
> -               return 3;
> -       case RTW89_DMA_ACH1:
> -               return 4;
> -       case RTW89_DMA_ACH2:
> -               return 5;
> -       case RTW89_DMA_ACH3:
> -               return 6;
> -       default:
> -       case RTW89_DMA_B0MG:
> -               return 0;
> -       case RTW89_DMA_B0HI:
> -               return 1;
> -       case RTW89_DMA_H2C:
> -               return 2;
> +       if (rtwdev->chip->chip_id == RTL8852C) {

Not sure if you like a rtw89_usb_info similar to rtw89_pci_info, so that
the you can describe the difference between chips. Even make a mapping
table. 

> +               switch (ch_dma) {
> +               case RTW89_DMA_ACH0:
> +                       return 3;
> +               case RTW89_DMA_ACH2:
> +                       return 5;
> +               case RTW89_DMA_ACH4:
> +                       return 4;
> +               case RTW89_DMA_ACH6:
> +                       return 6;
> +               default:
> +                       rtw89_warn(rtwdev, "unexpected TX channel %d\n",
> +                                  ch_dma);
> +                       fallthrough;
> +               case RTW89_DMA_B0MG:
> +               case RTW89_DMA_B0HI:
> +                       return 0;
> +               case RTW89_DMA_B1MG:
> +               case RTW89_DMA_B1HI:
> +                       return 1;
> +               case RTW89_DMA_H2C:
> +                       return 2;
> +               }
> +       } else {
> +               switch (ch_dma) {
> +               case RTW89_DMA_ACH0:
> +                       return 3;
> +               case RTW89_DMA_ACH1:
> +                       return 4;
> +               case RTW89_DMA_ACH2:
> +                       return 5;
> +               case RTW89_DMA_ACH3:
> +                       return 6;
> +               default:
> +                       rtw89_warn(rtwdev, "unexpected TX channel %d\n",
> +                                  ch_dma);
> +                       fallthrough;
> +               case RTW89_DMA_B0MG:
> +                       return 0;
> +               case RTW89_DMA_B0HI:
> +                       return 1;
> +               case RTW89_DMA_H2C:
> +                       return 2;
> +               }
>         }
>  }
> 
> @@ -251,7 +279,7 @@ static int rtw89_usb_write_port(struct rtw89_dev *rtwdev, u8 ch_dma,
>         struct rtw89_usb *rtwusb = rtw89_usb_priv(rtwdev);
>         struct usb_device *usbd = rtwusb->udev;
>         struct urb *urb;
> -       u8 bulkout_id = rtw89_usb_get_bulkout_id(ch_dma);
> +       u8 bulkout_id = rtw89_usb_get_bulkout_id(rtwdev, ch_dma);
>         unsigned int pipe;
>         int ret;
> 
> --
> 2.50.0


  reply	other threads:[~2025-08-08  5:54 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 [this message]
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 ` [PATCH rtw-next v2 04/11] wifi: rtw89: usb: Fix rtw89_usb_ops_mac_post_init() " Bitterblue Smith
2025-08-08  6:02   ` 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=6e8f5326d25046fea5f2033bc6c9c5cb@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rtl8821cerfe2@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).