Path: blob/main/sys/contrib/dev/athk/ath10k/qmi.h
106848 views
/* SPDX-License-Identifier: ISC */1/*2* Copyright (c) 2018 The Linux Foundation. All rights reserved.3*/4#ifndef _ATH10K_QMI_H_5#define _ATH10K_QMI_H_67#include <linux/soc/qcom/qmi.h>8#include <linux/qrtr.h>9#include "qmi_wlfw_v01.h"1011#define MAX_NUM_MEMORY_REGIONS 212#define MAX_TIMESTAMP_LEN 3213#define MAX_BUILD_ID_LEN 12814#define MAX_NUM_CAL_V01 51516enum ath10k_qmi_driver_event_type {17ATH10K_QMI_EVENT_SERVER_ARRIVE,18ATH10K_QMI_EVENT_SERVER_EXIT,19ATH10K_QMI_EVENT_FW_READY_IND,20ATH10K_QMI_EVENT_FW_DOWN_IND,21ATH10K_QMI_EVENT_MSA_READY_IND,22ATH10K_QMI_EVENT_MAX,23};2425struct ath10k_msa_mem_info {26phys_addr_t addr;27u32 size;28bool secure;29};3031struct ath10k_qmi_chip_info {32u32 chip_id;33u32 chip_family;34};3536struct ath10k_qmi_board_info {37u32 board_id;38};3940struct ath10k_qmi_soc_info {41u32 soc_id;42};4344struct ath10k_qmi_cal_data {45u32 cal_id;46u32 total_size;47u8 *data;48};4950struct ath10k_tgt_pipe_cfg {51__le32 pipe_num;52__le32 pipe_dir;53__le32 nentries;54__le32 nbytes_max;55__le32 flags;56__le32 reserved;57};5859struct ath10k_svc_pipe_cfg {60__le32 service_id;61__le32 pipe_dir;62__le32 pipe_num;63};6465struct ath10k_shadow_reg_cfg {66__le16 ce_id;67__le16 reg_offset;68};6970struct ath10k_qmi_wlan_enable_cfg {71u32 num_ce_tgt_cfg;72struct ath10k_tgt_pipe_cfg *ce_tgt_cfg;73u32 num_ce_svc_pipe_cfg;74struct ath10k_svc_pipe_cfg *ce_svc_cfg;75u32 num_shadow_reg_cfg;76struct ath10k_shadow_reg_cfg *shadow_reg_cfg;77};7879struct ath10k_qmi_driver_event {80struct list_head list;81enum ath10k_qmi_driver_event_type type;82void *data;83};8485enum ath10k_qmi_state {86ATH10K_QMI_STATE_INIT_DONE,87ATH10K_QMI_STATE_DEINIT,88};8990struct ath10k_qmi {91struct ath10k *ar;92struct qmi_handle qmi_hdl;93struct sockaddr_qrtr sq;94struct work_struct event_work;95struct workqueue_struct *event_wq;96struct list_head event_list;97spinlock_t event_lock; /* spinlock for qmi event list */98u32 nr_mem_region;99struct ath10k_msa_mem_info mem_region[MAX_NUM_MEMORY_REGIONS];100struct ath10k_qmi_chip_info chip_info;101struct ath10k_qmi_board_info board_info;102struct ath10k_qmi_soc_info soc_info;103char fw_build_id[MAX_BUILD_ID_LEN + 1];104u32 fw_version;105bool fw_ready;106char fw_build_timestamp[MAX_TIMESTAMP_LEN + 1];107struct ath10k_qmi_cal_data cal_data[MAX_NUM_CAL_V01];108bool msa_fixed_perm;109bool no_msa_ready_indicator;110enum ath10k_qmi_state state;111};112113int ath10k_qmi_wlan_enable(struct ath10k *ar,114struct ath10k_qmi_wlan_enable_cfg *config,115enum wlfw_driver_mode_enum_v01 mode,116const char *version);117int ath10k_qmi_wlan_disable(struct ath10k *ar);118int ath10k_qmi_init(struct ath10k *ar, u32 msa_size);119int ath10k_qmi_deinit(struct ath10k *ar);120int ath10k_qmi_set_fw_log_mode(struct ath10k *ar, u8 fw_log_mode);121122#endif /* ATH10K_QMI_H */123124125