Commit 287657e7 authored by Ching-Te Ku's avatar Ching-Te Ku Committed by Kalle Valo

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: default avatarChing-Te Ku <ku920601@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220913092546.43722-5-pkshih@realtek.com
parent 8468446a
......@@ -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");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment