mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	Luka Gejak <luka.gejak@linux.dev>
Subject: [PATCH v5 rtw-next 2/7] wifi: rtw88: assign the RCR per chip in rtw_core_init
Date: Wed, 30 Sep 2026 11:15:59 +0200	[thread overview]
Message-ID: <20260930091604.52891-3-luka.gejak@linux.dev> (raw)
In-Reply-To: <20260930091604.52891-1-luka.gejak@linux.dev>

The receive control word is the same for every chip today. The generic
default is written in rtw_core_init(), so a chip that needs a different
value has to overwrite it afterwards, in its own init path, far away
from where the default is decided.

Add an rcr field to struct rtw_chip_info and assign hal.rcr from it in
rtw_core_init(). Chips that do not set one keep the generic default, so
the field is optional and no existing chip changes behaviour.

Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
---
 drivers/net/wireless/realtek/rtw88/main.c | 10 ++++++----
 drivers/net/wireless/realtek/rtw88/main.h |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 0f23498b5c96..53d8552c0d35 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -2191,10 +2191,12 @@ int rtw_core_init(struct rtw_dev *rtwdev)
 
 	rtw_stats_init(rtwdev);
 
-	/* default rx filter setting */
-	rtwdev->hal.rcr = BIT_APP_FCS | BIT_APP_MIC | BIT_APP_ICV |
-			  BIT_PKTCTL_DLEN | BIT_HTC_LOC_CTRL | BIT_APP_PHYSTS |
-			  BIT_AB | BIT_AM | BIT_APM;
+	/* default rx filter setting, or the chip's own value if it has one */
+	rtwdev->hal.rcr = chip->rcr;
+	if (!chip->rcr)
+		rtwdev->hal.rcr = BIT_APP_FCS | BIT_APP_MIC | BIT_APP_ICV |
+				  BIT_PKTCTL_DLEN | BIT_HTC_LOC_CTRL |
+				  BIT_APP_PHYSTS | BIT_AB | BIT_AM | BIT_APM;
 
 	ret = rtw_load_firmware(rtwdev, RTW_NORMAL_FW);
 	if (ret) {
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index d59f6e323adf..e0f389040089 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1253,6 +1253,7 @@ struct rtw_chip_info {
 
 	/* init values */
 	u8 sys_func_en;
+	u32 rcr;
 	const struct rtw_pwr_seq_cmd * const *pwr_on_seq;
 	const struct rtw_pwr_seq_cmd * const *pwr_off_seq;
 	const struct rtw_rqpn *rqpn_table;
-- 
2.55.0


  parent reply	other threads:[~2026-09-30  9:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30  9:15 [PATCH v5 rtw-next 0/7] wifi: rtw88: add RTL8723B/RTL8723BS support Luka Gejak
2026-09-30  9:15 ` [PATCH v5 rtw-next 1/7] wifi: rtw88: move the shared 88xxa init helpers into the core Luka Gejak
2026-09-30 18:04   ` Bitterblue Smith
2026-09-30 20:53     ` Luka Gejak
2026-09-30  9:15 ` Luka Gejak [this message]
2026-09-30 18:03   ` [PATCH v5 rtw-next 2/7] wifi: rtw88: assign the RCR per chip in rtw_core_init Bitterblue Smith
2026-09-30 20:36     ` Luka Gejak
2026-09-30 21:27       ` Bitterblue Smith
2026-09-30 21:29         ` Luka Gejak
2026-09-30 21:46           ` Bitterblue Smith
2026-09-30 21:49             ` Luka Gejak
2026-09-30  9:16 ` [PATCH v5 rtw-next 3/7] wifi: rtw88: 8723b: add the RTL8723B register definitions Luka Gejak
2026-09-30  9:16 ` [PATCH v5 rtw-next 4/7] wifi: rtw88: 8723b: add the RTL8723B BB, RF and AGC tables Luka Gejak
2026-09-30  9:16 ` [PATCH v5 rtw-next 5/7] wifi: rtw88: 8723b: add the RTL8723B chip driver Luka Gejak
2026-09-30 18:03   ` Bitterblue Smith
2026-09-30 21:14     ` Luka Gejak
2026-09-30  9:16 ` [PATCH v5 rtw-next 6/7] wifi: rtw88: 8723bs: add the RTL8723BS SDIO bind Luka Gejak
2026-09-30  9:16 ` [PATCH v5 rtw-next 7/7] wifi: rtw88: 8723bs: enable building the RTL8723BS driver Luka Gejak

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=20260930091604.52891-3-luka.gejak@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    --cc=straube.linux@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

all inboxes | Powered by JetHome®