rtw88: coex: change the decode method from firmware
authorChing-Te Ku <ku920601@realtek.com>
Thu, 12 Nov 2020 03:14:30 +0000 (11:14 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 24 Nov 2020 09:16:31 +0000 (11:16 +0200)
Fix sometimes FW information will be parsed as wrong value,
do a correction of sign bit to show the correct information.
(Ex, Value should be 20, but it shows 236.)

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201112031430.4846-12-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/coex.c

index 322b13c9150ec6c97b7f5db87d14a2c1aa4c8431..4bb0d373c8623f5253c50f68d2b04da4a7940765 100644 (file)
@@ -2882,7 +2882,7 @@ void rtw_coex_wl_fwdbginfo_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)
                if (buf[i] >= val)
                        coex_stat->wl_fw_dbg_info[i] = buf[i] - val;
                else
-                       coex_stat->wl_fw_dbg_info[i] = val - buf[i];
+                       coex_stat->wl_fw_dbg_info[i] = 255 - val + buf[i];
 
                coex_stat->wl_fw_dbg_info_pre[i] = buf[i];
        }