wifi: rtw88: add flushing queue before HW scan
authorChih-Kang Chang <gary.chang@realtek.com>
Tue, 9 Aug 2022 08:41:05 +0000 (16:41 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 10 Aug 2022 05:48:46 +0000 (08:48 +0300)
We need to flush queue before HW scan to avoid packets dropped by hardware.

Signed-off-by: Chih-Kang Chang <gary.chang@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/20220809084107.38137-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/fw.c

index 992cae1..babba68 100644 (file)
@@ -15,6 +15,7 @@
 #include "wow.h"
 #include "ps.h"
 #include "phy.h"
+#include "mac.h"
 
 static void rtw_fw_c2h_cmd_handle_ext(struct rtw_dev *rtwdev,
                                      struct sk_buff *skb)
@@ -2056,6 +2057,9 @@ void rtw_hw_scan_start(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
        rtwvif->scan_req = req;
 
        ieee80211_stop_queues(rtwdev->hw);
+       rtw_leave_lps_deep(rtwdev);
+       rtw_hci_flush_all_queues(rtwdev, false);
+       rtw_mac_flush_all_queues(rtwdev, false);
        if (req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR)
                get_random_mask_addr(mac_addr, req->mac_addr,
                                     req->mac_addr_mask);