wifi: rtw89: coex: Parsing Wi-Fi firmware error message from reports

Parsing firmware error message from original version and v1 reports to
show up exception counter of commands from firmware in debug message.
Then, we can make sure exchange commands are correct totally.

In the later version Wi-Fi firmware(v1), the report format was changed.
With this update, we can yield correct report from proper struct.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220913092546.43722-5-pkshih@realtek.com
This commit is contained in:
Ching-Te Ku 2022-09-13 17:25:43 +08:00 committed by Kalle Valo
parent 8468446a62
commit 287657e77b
1 changed files with 16 additions and 6 deletions

View File

@ -5963,14 +5963,24 @@ static void _show_dm_info(struct rtw89_dev *rtwdev, struct seq_file *m)
static void _show_error(struct rtw89_dev *rtwdev, struct seq_file *m)
{
const struct rtw89_chip_info *chip = rtwdev->chip;
struct rtw89_btc *btc = &rtwdev->btc;
struct rtw89_btc_btf_fwinfo *pfwinfo = &btc->fwinfo;
struct rtw89_btc_fbtc_cysta *pcysta = NULL;
struct rtw89_btc_fbtc_cysta *pcysta;
struct rtw89_btc_fbtc_cysta_v1 *pcysta_v1;
u32 except_cnt, exception_map;
pcysta = &pfwinfo->rpt_fbtc_cysta.finfo;
if (chip->chip_id == RTL8852A) {
pcysta = &pfwinfo->rpt_fbtc_cysta.finfo;
except_cnt = le32_to_cpu(pcysta->except_cnt);
exception_map = le32_to_cpu(pcysta->exception);
} else {
pcysta_v1 = &pfwinfo->rpt_fbtc_cysta.finfo_v1;
except_cnt = le32_to_cpu(pcysta_v1->except_cnt);
exception_map = le32_to_cpu(pcysta_v1->except_map);
}
if (pfwinfo->event[BTF_EVNT_BUF_OVERFLOW] == 0 &&
pcysta->except_cnt == 0 &&
if (pfwinfo->event[BTF_EVNT_BUF_OVERFLOW] == 0 && except_cnt == 0 &&
!pfwinfo->len_mismch && !pfwinfo->fver_mismch)
return;
@ -5995,10 +6005,10 @@ static void _show_error(struct rtw89_dev *rtwdev, struct seq_file *m)
}
/* cycle statistics exceptions */
if (pcysta->exception || pcysta->except_cnt) {
if (exception_map || except_cnt) {
seq_printf(m,
"exception-type: 0x%x, exception-cnt = %d",
pcysta->exception, pcysta->except_cnt);
exception_map, except_cnt);
}
seq_puts(m, "\n");
}