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
;
86 enum ath10k_qmi_state
{
87 ATH10K_QMI_STATE_INIT_DONE
,
88 ATH10K_QMI_STATE_DEINIT
,
93 struct qmi_handle qmi_hdl
;
94 struct sockaddr_qrtr sq
;
95 struct work_struct event_work
;
96 struct workqueue_struct
*event_wq
;
97 struct list_head event_list
;
98 spinlock_t event_lock
; /* spinlock for qmi event list */
100 struct ath10k_msa_mem_info mem_region
[MAX_NUM_MEMORY_REGIONS
];
101 struct ath10k_qmi_chip_info chip_info
;
102 struct ath10k_qmi_board_info board_info
;
103 struct ath10k_qmi_soc_info soc_info
;
104 char fw_build_id
[MAX_BUILD_ID_LEN
+ 1];
107 char fw_build_timestamp
[MAX_TIMESTAMP_LEN
+ 1];
108 struct ath10k_qmi_cal_data cal_data
[MAX_NUM_CAL_V01
];
110 enum ath10k_qmi_state state
;
113 int ath10k_qmi_wlan_enable(struct ath10k
*ar
,
114 struct ath10k_qmi_wlan_enable_cfg
*config
,
115 enum wlfw_driver_mode_enum_v01 mode
,
116 const char *version
);
117 int ath10k_qmi_wlan_disable(struct ath10k
*ar
);
118 int ath10k_qmi_init(struct ath10k
*ar
, u32 msa_size
);
119 int ath10k_qmi_deinit(struct ath10k
*ar
);
120 int ath10k_qmi_set_fw_log_mode(struct ath10k
*ar
, u8 fw_log_mode
);
122 #endif /* ATH10K_QMI_H */