All of lore.kernel.org
 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 01/11] wifi: rtw89: Fix rtw89_core_get_ch_dma() for RTL8852CU
Date: Tue, 5 Aug 2025 00:40:07 +0000	[thread overview]
Message-ID: <4203c4ab09df4975be85e341f5e24264@realtek.com> (raw)
In-Reply-To: <11f3e864-7509-4e5f-86ed-997f8a9b63e9@gmail.com>

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> On 01/08/2025 23:51, Bitterblue Smith wrote:
> > It seems RTL8852CU can only use TX channels 0, 2, and 8 (for band 0),
> > otherwise the chip stops working after downloading at maximum speed
> > for a few seconds.
> >
> > Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> > ---
> > v2:
> >  - No change, messed up sending v1.
> > ---
> >  drivers/net/wireless/realtek/rtw89/txrx.h | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >
> > diff --git a/drivers/net/wireless/realtek/rtw89/txrx.h b/drivers/net/wireless/realtek/rtw89/txrx.h
> > index ec01bfc363da..318fd0ac8726 100644
> > --- a/drivers/net/wireless/realtek/rtw89/txrx.h
> > +++ b/drivers/net/wireless/realtek/rtw89/txrx.h
> > @@ -734,6 +734,25 @@ rtw89_core_get_qsel_mgmt(struct rtw89_dev *rtwdev, struct rtw89_core_tx_request
> >
> >  static inline u8 rtw89_core_get_ch_dma(struct rtw89_dev *rtwdev, u8 qsel)
> >  {
> > +     if (rtwdev->hci.type == RTW89_HCI_TYPE_USB &&
> > +         rtwdev->chip->chip_id == RTL8852C) {
> > +             switch (qsel) {
> > +             default:
> > +                     rtw89_warn(rtwdev, "Cannot map qsel to dma: %d\n",
> > +                                qsel);
> > +                     fallthrough;
> > +             case RTW89_TX_QSEL_BE_0:
> > +             case RTW89_TX_QSEL_VO_0:
> > +                     return RTW89_TXCH_ACH0;
> > +             case RTW89_TX_QSEL_BK_0:
> > +             case RTW89_TX_QSEL_VI_0:
> > +                     return RTW89_TXCH_ACH2;
> > +             case RTW89_TX_QSEL_B0_MGMT:
> > +             case RTW89_TX_QSEL_B0_HI:
> > +                     return RTW89_TXCH_CH8;
> > +             }
> > +     }
> > +
> >       switch (qsel) {
> >       default:
> >               rtw89_warn(rtwdev, "Cannot map qsel to dma: %d\n", qsel);
> 
> I see now that RTL8922AU needs the same change. And same in patch 2/11
> as well.

The coming chip RTL8922DE uses different mapping rule, so I add a new
chip_ops:
 
--- a/core.h
+++ b/core.h
@@ -4072,6 +4072,7 @@ struct rtw89_chip_ops {
        void (*fill_txdesc_fwcmd)(struct rtw89_dev *rtwdev,
                                  struct rtw89_tx_desc_info *desc_info,
                                  void *txdesc);
+       u8 (*get_ch_dma)(struct rtw89_dev *rtwdev, u8 qsel);
        int (*cfg_ctrl_path)(struct rtw89_dev *rtwdev, bool wl);
        int (*mac_cfg_gnt)(struct rtw89_dev *rtwdev,
                           const struct rtw89_mac_ax_coex_gnt *gnt_cfg);
@@ -7428,6 +7429,14 @@ void rtw89_chip_fill_txdesc_fwcmd(struct rtw89_dev *rtwdev,
        chip->ops->fill_txdesc_fwcmd(rtwdev, desc_info, txdesc);
 }

+static inline
+u8 rtw89_chip_get_ch_dma(struct rtw89_dev *rtwdev, u8 qsel)
+{
+       const struct rtw89_chip_info *chip = rtwdev->chip;
+
+       return chip->ops->get_ch_dma(rtwdev, qsel);
+}
+
 static inline
 void rtw89_chip_mac_cfg_gnt(struct rtw89_dev *rtwdev,
                            const struct rtw89_mac_ax_coex_gnt *gnt_cfg)

Also the rtw89_core_get_ch_dma() is moved to core.c, and add
rtw89_core_get_ch_dma_v1() for RTL8922DE. 

However, USB can use different mapping rule, so we should extend the size
to RTW89_HCI_TYPE_NUM. Then, 

  return chip->ops->get_ch_dma[rtwdev->hci.type](rtwdev, qsel);

If you want my patch as first patch of this patchset, I can share it as RFC.


Since this is called in data path, I'd like to avoid if-condition to save
a little execution time.


  reply	other threads:[~2025-08-05  0:40 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 [this message]
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 ` [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=4203c4ab09df4975be85e341f5e24264@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 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.