[PATCH 2/4] wifi: ath12k: add 11d scan offload support
Jeff Johnson
quic_jjohnson at quicinc.com
Fri Sep 8 07:59:12 PDT 2023
On 9/6/2023 1:29 AM, Wen Gong wrote:
> Add handler for WMI_11D_NEW_COUNTRY_EVENTID, WMI_11D_SCAN_START_CMDID,
> WMI_11D_SCAN_STOP_CMDID.
>
> The priority of 11d scan WMI_SCAN_PRIORITY_MEDIUM in firmware, the
> priority of hw scan is WMI_SCAN_PRIORITY_LOW, then the 11d scan will
> cancel the hw scan which is running. To avoid this, change the priority
> of the 1st hw scan to WMI_SCAN_PRIORITY_MEDIUM. Add wait_for_completion_timeout
> for ar->scan.completed in ath12k_reg_update_chan_list(), plus the existing
> wait in ath12k_scan_stop(), then ath12k have 2 place to wait the
> ar->scan.completed, they run in different thread, thus it is possible to
> happen that the two threads both enter wait status. To handle this scenario,
> ath12k should change the complete() to complete_all() for the ar->scan.completed,
> this also work well when it is only one thread wait for ar->scan.completed.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Signed-off-by: Wen Gong <quic_wgong at quicinc.com>
> ---
> drivers/net/wireless/ath/ath12k/core.c | 35 ++++-
> drivers/net/wireless/ath/ath12k/core.h | 16 +++
> drivers/net/wireless/ath/ath12k/mac.c | 170 ++++++++++++++++++++++++-
> drivers/net/wireless/ath/ath12k/mac.h | 7 +
> drivers/net/wireless/ath/ath12k/reg.c | 37 +++++-
> drivers/net/wireless/ath/ath12k/reg.h | 3 +-
> drivers/net/wireless/ath/ath12k/wmi.c | 123 +++++++++++++++++-
> drivers/net/wireless/ath/ath12k/wmi.h | 25 ++++
> 8 files changed, 406 insertions(+), 10 deletions(-)
...
> diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
> index 8940b8154091..890063c9e268 100644
> --- a/drivers/net/wireless/ath/ath12k/wmi.h
> +++ b/drivers/net/wireless/ath/ath12k/wmi.h
> @@ -3792,6 +3792,28 @@ struct wmi_init_country_cmd {
> } cc_info;
> } __packed;
>
> +struct wmi_11d_scan_start_params {
> + u32 vdev_id;
> + u32 scan_period_msec;
> + u32 start_interval_msec;
> +};
> +
> +struct wmi_11d_scan_start_cmd {
> + __le32 tlv_header;
> + __le32 vdev_id;
> + __le32 scan_period_msec;
> + __le32 start_interval_msec;
> +} __packed;
> +
> +struct wmi_11d_scan_stop_cmd {
> + __le32 tlv_header;
> + __le32 vdev_id;
> +} __packed;
> +
> +struct wmi_11d_new_cc_ev {
one nit: does not conform to the naming convention:
* _event means that this is a firmware event sent from firmware to host
> + __le32 new_alpha2;
> +} __packed;
> +
> struct wmi_delba_send_cmd {
> __le32 tlv_header;
> __le32 vdev_id;
> @@ -4897,6 +4919,9 @@ int ath12k_wmi_peer_rx_reorder_queue_setup(struct ath12k *ar,
> dma_addr_t paddr, u8 tid,
> u8 ba_window_size_valid,
> u32 ba_window_size);
> +int ath12k_wmi_send_11d_scan_start_cmd(struct ath12k *ar,
> + struct wmi_11d_scan_start_params *param);
> +int ath12k_wmi_send_11d_scan_stop_cmd(struct ath12k *ar, u32 vdev_id);
> int
> ath12k_wmi_rx_reord_queue_remove(struct ath12k *ar,
> struct ath12k_wmi_rx_reorder_queue_remove_arg *arg);
More information about the ath12k
mailing list