2019-11-23 09:58:40 +02:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
|
2024-05-21 11:08:10 +03:00
|
|
|
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
2019-11-23 09:58:40 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ATH11K_REG_H
|
|
|
|
|
#define ATH11K_REG_H
|
|
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
#include <net/regulatory.h>
|
|
|
|
|
|
|
|
|
|
struct ath11k_base;
|
|
|
|
|
struct ath11k;
|
|
|
|
|
|
|
|
|
|
/* DFS regdomains supported by Firmware */
|
|
|
|
|
enum ath11k_dfs_region {
|
|
|
|
|
ATH11K_DFS_REG_UNSET,
|
|
|
|
|
ATH11K_DFS_REG_FCC,
|
|
|
|
|
ATH11K_DFS_REG_ETSI,
|
|
|
|
|
ATH11K_DFS_REG_MKK,
|
|
|
|
|
ATH11K_DFS_REG_CN,
|
|
|
|
|
ATH11K_DFS_REG_KR,
|
2020-11-05 13:34:35 +05:30
|
|
|
ATH11K_DFS_REG_MKK_N,
|
2019-11-23 09:58:40 +02:00
|
|
|
ATH11K_DFS_REG_UNDEF,
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-10 10:27:19 +03:00
|
|
|
/* Phy bitmaps */
|
|
|
|
|
#define ATH11K_REG_PHY_BITMAP_NO11AX BIT(5)
|
|
|
|
|
|
2019-11-23 09:58:40 +02:00
|
|
|
/* ATH11K Regulatory API's */
|
|
|
|
|
void ath11k_reg_init(struct ath11k *ar);
|
2024-01-11 15:56:57 +02:00
|
|
|
void ath11k_reg_reset_info(struct cur_regulatory_info *reg_info);
|
2019-11-23 09:58:40 +02:00
|
|
|
void ath11k_reg_free(struct ath11k_base *ab);
|
|
|
|
|
void ath11k_regd_update_work(struct work_struct *work);
|
|
|
|
|
struct ieee80211_regdomain *
|
|
|
|
|
ath11k_reg_build_regd(struct ath11k_base *ab,
|
2024-01-11 15:56:57 +02:00
|
|
|
struct cur_regulatory_info *reg_info, bool intersect,
|
|
|
|
|
enum wmi_vdev_type vdev_type,
|
|
|
|
|
enum ieee80211_ap_reg_power power_type);
|
2021-09-28 12:05:40 +03:00
|
|
|
int ath11k_regd_update(struct ath11k *ar);
|
ath11k: reduce the wait time of 11d scan and hw scan while add interface
(cherry picked from commit 1f682dc9fb3790aa7ec27d3d122ff32b1eda1365 in wireless-next)
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 9dcf6808b253 ("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: 9dcf6808b253 ("ath11k: add 11d scan offload support")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215777
Cc: <stable@vger.kernel.org>
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220328035832.14122-1-quic_wgong@quicinc.com
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220427111619.9758-1-kvalo@kernel.org
2022-04-27 14:16:19 +03:00
|
|
|
int ath11k_reg_update_chan_list(struct ath11k *ar, bool wait);
|
2024-01-11 15:56:57 +02:00
|
|
|
enum wmi_reg_6ghz_ap_type
|
|
|
|
|
ath11k_reg_ap_pwr_convert(enum ieee80211_ap_reg_power power_type);
|
2024-01-11 15:56:57 +02:00
|
|
|
int ath11k_reg_handle_chan_list(struct ath11k_base *ab,
|
|
|
|
|
struct cur_regulatory_info *reg_info,
|
|
|
|
|
enum ieee80211_ap_reg_power power_type);
|
2024-05-21 11:08:10 +03:00
|
|
|
int ath11k_reg_set_cc(struct ath11k *ar);
|
2019-11-23 09:58:40 +02:00
|
|
|
#endif
|