2 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #ifndef _ATH10K_QMI_H_
17 #define _ATH10K_QMI_H_
19 #include <linux/soc/qcom/qmi.h>
20 #include <linux/qrtr.h>
21 #include "qmi_wlfw_v01.h"
23 #define MAX_NUM_MEMORY_REGIONS 2
24 #define MAX_TIMESTAMP_LEN 32
25 #define MAX_BUILD_ID_LEN 128
26 #define MAX_NUM_CAL_V01 5
28 enum ath10k_qmi_driver_event_type
{
29 ATH10K_QMI_EVENT_SERVER_ARRIVE
,
30 ATH10K_QMI_EVENT_SERVER_EXIT
,
31 ATH10K_QMI_EVENT_FW_READY_IND
,
32 ATH10K_QMI_EVENT_FW_DOWN_IND
,
33 ATH10K_QMI_EVENT_MSA_READY_IND
,
37 struct ath10k_msa_mem_info
{
43 struct ath10k_qmi_chip_info
{
48 struct ath10k_qmi_board_info
{
52 struct ath10k_qmi_soc_info
{
56 struct ath10k_qmi_cal_data
{
62 struct ath10k_tgt_pipe_cfg
{
71 struct ath10k_svc_pipe_cfg
{
77 struct ath10k_shadow_reg_cfg
{
82 struct ath10k_qmi_wlan_enable_cfg
{
84 struct ath10k_tgt_pipe_cfg
*ce_tgt_cfg
;
85 u32 num_ce_svc_pipe_cfg
;
86 struct ath10k_svc_pipe_cfg
*ce_svc_cfg
;
87 u32 num_shadow_reg_cfg
;
88 struct ath10k_shadow_reg_cfg
*shadow_reg_cfg
;
91 struct ath10k_qmi_driver_event
{
92 struct list_head list
;
93 enum ath10k_qmi_driver_event_type type
;
99 struct qmi_handle qmi_hdl
;
100 struct sockaddr_qrtr sq
;
101 struct work_struct event_work
;
102 struct workqueue_struct
*event_wq
;
103 struct list_head event_list
;
104 spinlock_t event_lock
; /* spinlock for qmi event list */
106 struct ath10k_msa_mem_info mem_region
[MAX_NUM_MEMORY_REGIONS
];
110 struct ath10k_qmi_chip_info chip_info
;
111 struct ath10k_qmi_board_info board_info
;
112 struct ath10k_qmi_soc_info soc_info
;
113 char fw_build_id
[MAX_BUILD_ID_LEN
+ 1];
116 char fw_build_timestamp
[MAX_TIMESTAMP_LEN
+ 1];
117 struct ath10k_qmi_cal_data cal_data
[MAX_NUM_CAL_V01
];
120 int ath10k_qmi_wlan_enable(struct ath10k
*ar
,
121 struct ath10k_qmi_wlan_enable_cfg
*config
,
122 enum wlfw_driver_mode_enum_v01 mode
,
123 const char *version
);
124 int ath10k_qmi_wlan_disable(struct ath10k
*ar
);
125 int ath10k_qmi_register_service_notifier(struct notifier_block
*nb
);
126 int ath10k_qmi_init(struct ath10k
*ar
, u32 msa_size
);
127 int ath10k_qmi_deinit(struct ath10k
*ar
);
129 #endif /* ATH10K_QMI_H */