All of lore.kernel.org
 help / color / mirror / Atom feed
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 v4 05/14] wifi: rtw89: Add rtw8851b_hfc_param_ini_usb
Date: Mon, 30 Jun 2025 23:42:55 +0300	[thread overview]
Message-ID: <a0dec631-de05-4302-9ef1-e730eb233f08@gmail.com> (raw)
In-Reply-To: <7880bca2-17de-4d55-93a1-16977dd6502e@gmail.com>

"hfc" means "hci fc" which is "Host Control Interface Flow Control".
These are some parameters needed for RTL8851BU.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
---
v2:
 - Adapt to the changes in patch 3.
 - Add more information in the commit message.

v3:
 - Add Acked-by.
 - Adjust the wording of the commit message.

v4:
 - No change.
---
 drivers/net/wireless/realtek/rtw89/rtw8851b.c | 46 ++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c
index 7fa3d15ee10f..5fda45174dfb 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8851b.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c
@@ -51,6 +51,48 @@ static const struct rtw89_hfc_param_ini rtw8851b_hfc_param_ini_pcie[] = {
 	[RTW89_QTA_INVALID] = {NULL},
 };
 
+static const struct rtw89_hfc_ch_cfg rtw8851b_hfc_chcfg_usb[] = {
+	{18, 152, grp_0}, /* ACH 0 */
+	{18, 152, grp_0}, /* ACH 1 */
+	{18, 152, grp_0}, /* ACH 2 */
+	{18, 152, grp_0}, /* ACH 3 */
+	{0, 0, grp_0}, /* ACH 4 */
+	{0, 0, grp_0}, /* ACH 5 */
+	{0, 0, grp_0}, /* ACH 6 */
+	{0, 0, grp_0}, /* ACH 7 */
+	{18, 152, grp_0}, /* B0MGQ */
+	{18, 152, grp_0}, /* B0HIQ */
+	{0, 0, grp_0}, /* B1MGQ */
+	{0, 0, grp_0}, /* B1HIQ */
+	{0, 0, 0} /* FWCMDQ */
+};
+
+static const struct rtw89_hfc_pub_cfg rtw8851b_hfc_pubcfg_usb = {
+	152, /* Group 0 */
+	0, /* Group 1 */
+	152, /* Public Max */
+	0 /* WP threshold */
+};
+
+static const struct rtw89_hfc_prec_cfg rtw8851b_hfc_preccfg_usb = {
+	9, /* CH 0-11 pre-cost */
+	32, /* H2C pre-cost */
+	64, /* WP CH 0-7 pre-cost */
+	24, /* WP CH 8-11 pre-cost */
+	1, /* CH 0-11 full condition */
+	1, /* H2C full condition */
+	1, /* WP CH 0-7 full condition */
+	1, /* WP CH 8-11 full condition */
+};
+
+static const struct rtw89_hfc_param_ini rtw8851b_hfc_param_ini_usb[] = {
+	[RTW89_QTA_SCC] = {rtw8851b_hfc_chcfg_usb, &rtw8851b_hfc_pubcfg_usb,
+			   &rtw8851b_hfc_preccfg_usb, RTW89_HCIFC_STF},
+	[RTW89_QTA_DLFW] = {NULL, NULL,
+			   &rtw8851b_hfc_preccfg_usb, RTW89_HCIFC_STF},
+	[RTW89_QTA_INVALID] = {NULL},
+};
+
 static const struct rtw89_dle_mem rtw8851b_dle_mem_pcie[] = {
 	[RTW89_QTA_SCC] = {RTW89_QTA_SCC, &rtw89_mac_size.wde_size6,
 			   &rtw89_mac_size.ple_size6, &rtw89_mac_size.wde_qt6,
@@ -2491,7 +2533,9 @@ const struct rtw89_chip_info rtw8851b_chip_info = {
 	.max_amsdu_limit	= 3500,
 	.dis_2g_40m_ul_ofdma	= true,
 	.rsvd_ple_ofst		= 0x2f800,
-	.hfc_param_ini		= {rtw8851b_hfc_param_ini_pcie, NULL, NULL},
+	.hfc_param_ini		= {rtw8851b_hfc_param_ini_pcie,
+				   rtw8851b_hfc_param_ini_usb,
+				   NULL},
 	.dle_mem		= {rtw8851b_dle_mem_pcie,
 				   rtw8851b_dle_mem_usb2,
 				   rtw8851b_dle_mem_usb3,
-- 
2.49.0


  parent reply	other threads:[~2025-06-30 20:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 20:39 [PATCH rtw-next v4 00/14] wifi: rtw89: Add support for USB devices Bitterblue Smith
2025-06-30 20:40 ` [PATCH rtw-next v4 01/14] wifi: rtw89: 8851b: Accept USB devices and load their MAC address Bitterblue Smith
2025-07-04  3:08   ` Ping-Ke Shih
2025-07-04  3:36     ` Ping-Ke Shih
2025-07-04  9:53       ` Bitterblue Smith
2025-06-30 20:41 ` [PATCH rtw-next v4 02/14] wifi: rtw89: Make dle_mem in rtw89_chip_info an array Bitterblue Smith
2025-06-30 20:42 ` [PATCH rtw-next v4 03/14] wifi: rtw89: Make hfc_param_ini " Bitterblue Smith
2025-06-30 20:42 ` [PATCH rtw-next v4 04/14] wifi: rtw89: Add rtw8851b_dle_mem_usb{2,3} Bitterblue Smith
2025-06-30 20:42 ` Bitterblue Smith [this message]
2025-06-30 20:43 ` [PATCH rtw-next v4 06/14] wifi: rtw89: Disable deep power saving for USB/SDIO Bitterblue Smith
2025-06-30 20:44 ` [PATCH rtw-next v4 07/14] wifi: rtw89: Add extra TX headroom for USB Bitterblue Smith
2025-06-30 20:45 ` [PATCH rtw-next v4 08/14] wifi: rtw89: Hide some errors when the device is unplugged Bitterblue Smith
2025-06-30 20:45 ` [PATCH rtw-next v4 09/14] wifi: rtw89: 8851b: Modify rtw8851b_pwr_{on,off}_func() for USB Bitterblue Smith
2025-06-30 20:45 ` [PATCH rtw-next v4 10/14] wifi: rtw89: Fix rtw89_mac_power_switch() " Bitterblue Smith
2025-06-30 20:46 ` [PATCH rtw-next v4 11/14] wifi: rtw89: Add some definitions " Bitterblue Smith
2025-06-30 20:46 ` [PATCH rtw-next v4 12/14] wifi: rtw89: Add usb.{c,h} Bitterblue Smith
2025-07-01  2:21   ` Ping-Ke Shih
2025-07-01 10:58     ` Bitterblue Smith
2025-06-30 20:47 ` [PATCH rtw-next v4 13/14] wifi: rtw89: Add rtw8851bu.c Bitterblue Smith
2025-06-30 20:47 ` [PATCH rtw-next v4 14/14] wifi: rtw89: Enable the new USB modules Bitterblue Smith
2025-07-05 14:15   ` kernel test robot

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=a0dec631-de05-4302-9ef1-e730eb233f08@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.