On 15/08/2024 09:10, Ping-Ke Shih wrote: > Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> wrote: >> RTL8821AU and RTL8812AU don't support this. They hit the "failed to read >> hw feature report" error. >> >> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> >> --- >> drivers/net/wireless/realtek/rtw88/main.c | 4 ++++ >> drivers/net/wireless/realtek/rtw88/main.h | 1 + >> drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 + >> drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 + >> drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + >> drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + >> drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + >> 7 files changed, 10 insertions(+) >> >> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c >> index ff045dfdca4a..aeb21ac25e2e 100644 >> --- a/drivers/net/wireless/realtek/rtw88/main.c >> +++ b/drivers/net/wireless/realtek/rtw88/main.c >> @@ -1923,6 +1923,9 @@ static int rtw_dump_hw_feature(struct rtw_dev *rtwdev) >> u8 bw; >> int i; >> >> + if (!rtwdev->chip->hw_feature_report) >> + goto print_hw_cap; > > Since chips don't support of hw_feature_report, printing hw capabilities seems > useless. Just 'return'? > efuse->hw_cap is filled earlier in rtw8812a_read_usb_type(), so printing here is not entirely useless. But maybe it is cleaner to return here and print these things in rtw8812a_read_usb_type(). >> + >> id = rtw_read8(rtwdev, REG_C2HEVT); >> if (id != C2H_HW_FEATURE_REPORT) { >> rtw_err(rtwdev, "failed to read hw feature report\n"); >> @@ -1947,6 +1950,7 @@ static int rtw_dump_hw_feature(struct rtw_dev *rtwdev) >> efuse->hw_cap.nss > rtwdev->hal.rf_path_num) >> efuse->hw_cap.nss = rtwdev->hal.rf_path_num; >> >> +print_hw_cap: >> rtw_dbg(rtwdev, RTW_DBG_EFUSE, >> "hw cap: hci=0x%02x, bw=0x%02x, ptcl=0x%02x, ant_num=%d, nss=%d\n", >> efuse->hw_cap.hci, efuse->hw_cap.bw, efuse->hw_cap.ptcl, > > [...] >