1 /* SPDX-License-Identifier: ISC */
3 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
8 #include <linux/soc/qcom/qmi.h>
9 #include <linux/qrtr.h>
10 #include "qmi_wlfw_v01.h"
12 #define MAX_NUM_MEMORY_REGIONS 2
13 #define MAX_TIMESTAMP_LEN 32
14 #define MAX_BUILD_ID_LEN 128
15 #define MAX_NUM_CAL_V01 5
17 enum ath10k_qmi_driver_event_type
{
18 ATH10K_QMI_EVENT_SERVER_ARRIVE
,
19 ATH10K_QMI_EVENT_SERVER_EXIT
,
20 ATH10K_QMI_EVENT_FW_READY_IND
,
21 ATH10K_QMI_EVENT_FW_DOWN_IND
,
22 ATH10K_QMI_EVENT_MSA_READY_IND
,
26 struct ath10k_msa_mem_info
{
32 struct ath10k_qmi_chip_info
{
37 struct ath10k_qmi_board_info
{
41 struct ath10k_qmi_soc_info
{
45 struct ath10k_qmi_cal_data
{
51 struct ath10k_tgt_pipe_cfg
{
60 struct ath10k_svc_pipe_cfg
{
66 struct ath10k_shadow_reg_cfg
{
71 struct ath10k_qmi_wlan_enable_cfg
{
73 struct ath10k_tgt_pipe_cfg
*ce_tgt_cfg
;
74 u32 num_ce_svc_pipe_cfg
;
75 struct ath10k_svc_pipe_cfg
*ce_svc_cfg
;
76 u32 num_shadow_reg_cfg
;
77 struct ath10k_shadow_reg_cfg
*shadow_reg_cfg
;
80 struct ath10k_qmi_driver_event
{
81 struct list_head list
;
82 enum ath10k_qmi_driver_event_type type
;
88 struct qmi_handle qmi_hdl
;
89 struct sockaddr_qrtr sq
;
90 struct work_struct event_work
;
91 struct workqueue_struct
*event_wq
;
92 struct list_head event_list
;
93 spinlock_t event_lock
; /* spinlock for qmi event list */
95 struct ath10k_msa_mem_info mem_region
[MAX_NUM_MEMORY_REGIONS
];
99 struct ath10k_qmi_chip_info chip_info
;
100 struct ath10k_qmi_board_info board_info
;
101 struct ath10k_qmi_soc_info soc_info
;
102 char fw_build_id
[MAX_BUILD_ID_LEN
+ 1];
105 char fw_build_timestamp
[MAX_TIMESTAMP_LEN
+ 1];
106 struct ath10k_qmi_cal_data cal_data
[MAX_NUM_CAL_V01
];
110 int ath10k_qmi_wlan_enable(struct ath10k
*ar
,
111 struct ath10k_qmi_wlan_enable_cfg
*config
,
112 enum wlfw_driver_mode_enum_v01 mode
,
113 const char *version
);
114 int ath10k_qmi_wlan_disable(struct ath10k
*ar
);
115 int ath10k_qmi_register_service_notifier(struct notifier_block
*nb
);
116 int ath10k_qmi_init(struct ath10k
*ar
, u32 msa_size
);
117 int ath10k_qmi_deinit(struct ath10k
*ar
);
118 int ath10k_qmi_set_fw_log_mode(struct ath10k
*ar
, u8 fw_log_mode
);
120 #endif /* ATH10K_QMI_H */