wifi: rtw89: parse PHY status only when PPDU is to_self
authorEric Huang <echuang@realtek.com>
Wed, 5 Oct 2022 08:32:08 +0000 (16:32 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 11 Oct 2022 16:45:19 +0000 (19:45 +0300)
Without this fix, some non-self packets are used to count CFO (center
frequency offset), and average CFO has unstable variation. Then, it causes
unexpected performance.

Signed-off-by: Eric Huang <echuang@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/20221005083212.45683-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c

index bc2994865372b86043e73d45584ba56f4b79d9a5..a0fa9639b5097a6607a0088065bdded3308620bc 100644 (file)
@@ -1255,6 +1255,9 @@ static int rtw89_core_rx_parse_phy_sts(struct rtw89_dev *rtwdev,
        if (phy_ppdu->ie < RTW89_CCK_PKT)
                return -EINVAL;
 
+       if (!phy_ppdu->to_self)
+               return 0;
+
        pos = (u8 *)phy_ppdu->buf + PHY_STS_HDR_LEN;
        end = (u8 *)phy_ppdu->buf + phy_ppdu->len;
        while (pos < end) {