]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
rtw88: fix incorrect frequency reported
authorPo-Hao Huang <phhuang@realtek.com>
Thu, 7 Apr 2022 09:58:54 +0000 (17:58 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 12 Apr 2022 13:52:05 +0000 (16:52 +0300)
We should only fill in frequency reported by firmware during scan.
Add this so frames won't be dropped by mac80211 due to frequency
mismatch.

Signed-off-by: Po-Hao Huang <phhuang@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/20220407095858.46807-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/rx.c

index d2d607e22198d6a5c1df221ed592576a0e80c26a..84aedabdf28530d2592f34482682d0db146ae1ea 100644 (file)
@@ -158,7 +158,8 @@ void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
        memset(rx_status, 0, sizeof(*rx_status));
        rx_status->freq = hw->conf.chandef.chan->center_freq;
        rx_status->band = hw->conf.chandef.chan->band;
-       if (rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_SCAN_OFFLOAD))
+       if (rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_SCAN_OFFLOAD) &&
+           test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
                rtw_set_rx_freq_by_pktstat(pkt_stat, rx_status);
        if (pkt_stat->crc_err)
                rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;