]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: scan abort when assign/unassign_vif
authorChih-Kang Chang <gary.chang@realtek.com>
Tue, 10 Jun 2025 13:00:34 +0000 (21:00 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 16 Jun 2025 05:37:34 +0000 (13:37 +0800)
If scan happen during start_ap, the register which control TX might be
turned off during scan. Additionally, if set_channel occurs during scan
will backup this register and set to firmware after set_channel done.
When scan complete, firmware will also set TX by this register, causing
TX to be disabled and beacon can't be TX. Therefore, in assign/unassign_vif
call scan abort before set_channel to avoid scan racing with set_channel.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250610130034.14692-13-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/chan.c

index 2a77b1978c380b29c38d74c2c4c7c511021c222b..2d4d730c8195d4568cc465d573a60a125dd254d2 100644 (file)
@@ -2910,6 +2910,9 @@ int rtw89_chanctx_ops_assign_vif(struct rtw89_dev *rtwdev,
        rtwvif_link->chanctx_assigned = true;
        cfg->ref_count++;
 
+       if (rtwdev->scanning)
+               rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
+
        if (list_empty(&rtwvif->mgnt_entry))
                list_add_tail(&rtwvif->mgnt_entry, &mgnt->active_list);
 
@@ -2949,6 +2952,9 @@ void rtw89_chanctx_ops_unassign_vif(struct rtw89_dev *rtwdev,
        rtwvif_link->chanctx_assigned = false;
        cfg->ref_count--;
 
+       if (rtwdev->scanning)
+               rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
+
        if (!rtw89_vif_is_active_role(rtwvif))
                list_del_init(&rtwvif->mgnt_entry);