• Wen Gong's avatar
    ath11k: reduce the wait time of 11d scan and hw scan while add interface · 1f682dc9
    Wen Gong authored
    Currently ath11k will wait 11d scan complete while add interface in
    ath11k_mac_op_add_interface(), when system resume without enable
    wowlan, ath11k_mac_op_add_interface() is called for each resume, thus
    it increase the resume time of system. And ath11k_mac_op_hw_scan()
    after ath11k_mac_op_add_interface() also needs some time cost because
    the previous 11d scan need more than 5 seconds when 6 GHz is enabled,
    then the scan started event will indicated to ath11k after the 11d
    scan completed.
    
    While 11d scan/hw scan is running in firmware, if ath11k update channel
    list to firmware by WMI_SCAN_CHAN_LIST_CMDID, then firmware will cancel
    the current scan which is running, it lead the scan failed. The patch
    commit 9dcf6808 ("ath11k: add 11d scan offload support") used
    finish_11d_scan/finish_11d_ch_list/pending_11d to synchronize the 11d
    scan/hw scan/channel list between ath11k/firmware/mac80211 and to avoid
    the scan fail.
    
    Add wait operation before ath11k update channel list, function
    ath11k_reg_update_chan_list() will wait until the current 11d scan/hw
    scan completed. And remove the wait operation of start 11d scan and
    waiting channel list complete in hw scan. After these changes, resume
    time cost reduce about 5 seconds and also hw scan time cost reduced
    obviously, and scan failed not seen.
    
    The 11d scan is sent to firmware only one time for each interface added
    in mac.c, and it is moved after the 1st hw scan because 11d scan will
    cost some time and thus leads the AP scan result update to UI delay.
    Currently priority of ath11k's hw scan is WMI_SCAN_PRIORITY_LOW, and
    priority of 11d scan in firmware is WMI_SCAN_PRIORITY_MEDIUM, then the
    11d scan which sent after hw scan will cancel the hw scan in firmware,
    so change the priority to WMI_SCAN_PRIORITY_MEDIUM for the hw scan which
    is in front of the 11d scan, thus it will not happen scan cancel in
    firmware.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
    
    Fixes: 9dcf6808 ("ath11k: add 11d scan offload support")
    Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
    Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
    Link: https://lore.kernel.org/r/20220328035832.14122-1-quic_wgong@quicinc.com
    1f682dc9
reg.h 926 Bytes