rtw88: fix wrong rx power calculation
authorTsang-Shian Lin <thlin@realtek.com>
Thu, 12 Sep 2019 06:39:14 +0000 (14:39 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 13 Sep 2019 15:07:18 +0000 (18:07 +0300)
Fix the wrong RF path for CCK rx power calculation.

Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Tsang-Shian Lin <thlin@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/rtw8822c.c

index f28563d..c9a2cbb 100644 (file)
@@ -1628,9 +1628,9 @@ static void query_phy_status_page0(struct rtw_dev *rtwdev, u8 *phy_status,
        else if (gain_a > u_bnd)
                rx_power[RF_PATH_A] -= (gain_a - u_bnd) << 1;
        if (gain_b < l_bnd)
-               rx_power[RF_PATH_A] += (l_bnd - gain_b) << 1;
+               rx_power[RF_PATH_B] += (l_bnd - gain_b) << 1;
        else if (gain_b > u_bnd)
-               rx_power[RF_PATH_A] -= (gain_b - u_bnd) << 1;
+               rx_power[RF_PATH_B] -= (gain_b - u_bnd) << 1;
 
        rx_power[RF_PATH_A] -= 110;
        rx_power[RF_PATH_B] -= 110;