Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <ku920601@realtek.com>, <kevin_yang@realtek.com>
Subject: [PATCH rtw-next 1/7] wifi: rtw89: coex: log FCX report version mismatch without dropping
Date: Wed, 23 Sep 2026 15:13:48 +0800	[thread overview]
Message-ID: <20260923071354.50864-2-pkshih@realtek.com> (raw)
In-Reply-To: <20260923071354.50864-1-pkshih@realtek.com>

From: Ching-Te Ku <ku920601@realtek.com>

_chk_btc_report() validated the reported firmware struct version only
for the control report, so a version mismatch on any other report type
was copied in silently and left no trace, making a ver_defs or firmware
version error hard to diagnose.

Read the reported fver, which is the leading field of every report
struct, and when it differs from the driver-selected version set the
per-type bit in fver_mismch and emit a debug line. The length-valid
report is still processed, because the driver must stay compatible with
every released firmware and a mismatch usually points at a ver_defs
entry that needs fixing rather than a report that should be discarded.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/coex.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
index 305d8edb0d4d..d3f9ef02e982 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.c
+++ b/drivers/net/wireless/realtek/rtw89/coex.c
@@ -1866,6 +1866,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
 	u32 cnt_leak_slot, bt_slot_real, bt_slot_set, cnt_rx_imr;
 	u8 i, j, val = 0, val1, val2;
 	u32 *bt_cnt, start_idx;
+	const u8 *rpt_fver;
 
 	rtw89_debug(rtwdev, RTW89_DBG_BTC,
 		    "[BTC], %s(): index:%d\n",
@@ -2181,6 +2182,21 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
 	memcpy(pfinfo, rpt_content, pcinfo->req_len);
 	pcinfo->valid = 1;
 
+	/*
+	 * fver is the leading field of every report struct. A mismatch
+	 * vs the driver-selected version means ver_defs needs a fix, so
+	 * flag it for debug but keep processing the length-valid report.
+	 */
+	rpt_fver = pfinfo;
+	pcinfo->rsp_fver = rpt_fver[0];
+	if (pcinfo->rsp_fver != pcinfo->req_fver) {
+		pfwinfo->fver_mismch |= BIT(rpt_type);
+		rtw89_debug(rtwdev, RTW89_DBG_BTC,
+			    "[BTC], %s(): %d rsp_fver:%d!=req_fver:%d\n",
+			    __func__, rpt_type, pcinfo->rsp_fver,
+			    pcinfo->req_fver);
+	}
+
 	switch (rpt_type) {
 	case BTC_RPT_TYPE_CTRL:
 		if (ver->fcxbtcrpt == 1) {
-- 
2.25.1


  reply	other threads:[~2026-09-23  7:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  7:13 [PATCH rtw-next 0/7] wifi: rtw89: coex: update to support newer firmware especially RTL8852C Ping-Ke Shih
2026-09-23  7:13 ` Ping-Ke Shih [this message]
2026-09-30  2:14   ` [PATCH rtw-next 1/7] wifi: rtw89: coex: log FCX report version mismatch without dropping Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 2/7] wifi: rtw89: coex: add fbtc_rpt_ctrl v205 report struct and handling Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 3/7] wifi: rtw89: coex: Add firmware 0.27.130.1 support for RTL8852C Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 4/7] wifi: rtw89: coex: fix BT scoreboard update for non-C2H paths Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 5/7] wifi: rtw89: add instance of IO ops for (un)pack and [um]delay Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 6/7] wifi: rtw89: coex: offload 8852C IO writes via firmware CMD pack region Ping-Ke Shih
2026-09-23  7:13 ` [PATCH rtw-next 7/7] wifi: rtw89: coex: batch PTA init with masked IO offload 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=20260923071354.50864-2-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kevin_yang@realtek.com \
    --cc=ku920601@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    /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