blob: 784aadc94e0d892d673fc3ffea6fda82952893d8 [file] [log] [blame]
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -08001/* SPDX-License-Identifier: GPL-2.0-only */
2/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. */
3
4#ifndef _CNSS_QMI_H
5#define _CNSS_QMI_H
6
7#include <linux/soc/qcom/qmi.h>
8
9struct cnss_plat_data;
10
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -080011struct cnss_qmi_event_server_arrive_data {
12 unsigned int node;
13 unsigned int port;
14};
15
Yuanyuan Liu36d1fba2019-01-02 14:13:15 -080016#define QDSS_TRACE_SEG_LEN_MAX 32
17#define QDSS_TRACE_FILE_NAME_MAX 16
18
19struct cnss_mem_seg {
20 u64 addr;
21 u32 size;
22};
23
24struct cnss_qmi_event_qdss_trace_save_data {
25 u32 total_size;
26 u32 mem_seg_len;
27 struct cnss_mem_seg mem_seg[QDSS_TRACE_SEG_LEN_MAX];
28 char file_name[QDSS_TRACE_FILE_NAME_MAX + 1];
29};
30
31#ifdef CONFIG_CNSS2_QMI
32#include "wlan_firmware_service_v01.h"
33#include "coexistence_service_v01.h"
34
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -080035int cnss_qmi_init(struct cnss_plat_data *plat_priv);
36void cnss_qmi_deinit(struct cnss_plat_data *plat_priv);
37unsigned int cnss_get_qmi_timeout(struct cnss_plat_data *plat_priv);
38int cnss_wlfw_server_arrive(struct cnss_plat_data *plat_priv, void *data);
39int cnss_wlfw_server_exit(struct cnss_plat_data *plat_priv);
40int cnss_wlfw_respond_mem_send_sync(struct cnss_plat_data *plat_priv);
41int cnss_wlfw_tgt_cap_send_sync(struct cnss_plat_data *plat_priv);
Yue Mad3534c42019-02-25 15:18:41 -080042int cnss_wlfw_bdf_dnld_send_sync(struct cnss_plat_data *plat_priv,
43 u32 bdf_type);
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -080044int cnss_wlfw_m3_dnld_send_sync(struct cnss_plat_data *plat_priv);
45int cnss_wlfw_wlan_mode_send_sync(struct cnss_plat_data *plat_priv,
46 enum cnss_driver_mode mode);
47int cnss_wlfw_wlan_cfg_send_sync(struct cnss_plat_data *plat_priv,
48 struct cnss_wlan_enable_cfg *config,
49 const char *host_version);
50int cnss_wlfw_athdiag_read_send_sync(struct cnss_plat_data *plat_priv,
51 u32 offset, u32 mem_type,
52 u32 data_len, u8 *data);
53int cnss_wlfw_athdiag_write_send_sync(struct cnss_plat_data *plat_priv,
54 u32 offset, u32 mem_type,
55 u32 data_len, u8 *data);
56int cnss_wlfw_ini_send_sync(struct cnss_plat_data *plat_priv,
57 u8 fw_log_mode);
Yuanyuan Liua1683832019-01-29 11:01:29 -080058int cnss_wlfw_antenna_switch_send_sync(struct cnss_plat_data *plat_priv);
59int cnss_wlfw_antenna_grant_send_sync(struct cnss_plat_data *plat_priv);
Yuanyuan Liu659d5f32019-01-25 14:29:22 -080060int cnss_register_coex_service(struct cnss_plat_data *plat_priv);
61void cnss_unregister_coex_service(struct cnss_plat_data *plat_priv);
62int coex_antenna_switch_to_wlan_send_sync_msg(struct cnss_plat_data *plat_priv);
63int coex_antenna_switch_to_mdm_send_sync_msg(struct cnss_plat_data *plat_priv);
Yuanyuan Liu36d1fba2019-01-02 14:13:15 -080064int cnss_wlfw_qdss_trace_mem_info_send_sync(struct cnss_plat_data *plat_priv);
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -080065#else
66#define QMI_WLFW_TIMEOUT_MS 10000
67
68static inline int cnss_qmi_init(struct cnss_plat_data *plat_priv)
69{
70 return 0;
71}
72
73static inline void cnss_qmi_deinit(struct cnss_plat_data *plat_priv)
74{
75}
76
77static inline
78unsigned int cnss_get_qmi_timeout(struct cnss_plat_data *plat_priv)
79{
80 return QMI_WLFW_TIMEOUT_MS;
81}
82
83static inline int cnss_wlfw_server_arrive(struct cnss_plat_data *plat_priv,
84 void *data)
85{
86 return 0;
87}
88
89static inline int cnss_wlfw_server_exit(struct cnss_plat_data *plat_priv)
90{
91 return 0;
92}
93
94static inline
95int cnss_wlfw_respond_mem_send_sync(struct cnss_plat_data *plat_priv)
96{
97 return 0;
98}
99
100static inline int cnss_wlfw_tgt_cap_send_sync(struct cnss_plat_data *plat_priv)
101{
102 return 0;
103}
104
Yue Mad3534c42019-02-25 15:18:41 -0800105static inline int cnss_wlfw_bdf_dnld_send_sync(struct cnss_plat_data *plat_priv,
106 u32 bdf_type)
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -0800107{
108 return 0;
109}
110
111static inline int cnss_wlfw_m3_dnld_send_sync(struct cnss_plat_data *plat_priv)
112{
113 return 0;
114}
115
116static inline
117int cnss_wlfw_wlan_mode_send_sync(struct cnss_plat_data *plat_priv,
118 enum cnss_driver_mode mode)
119{
120 return 0;
121}
122
123static inline
124int cnss_wlfw_wlan_cfg_send_sync(struct cnss_plat_data *plat_priv,
125 struct cnss_wlan_enable_cfg *config,
126 const char *host_version)
127{
128 return 0;
129}
130
131static inline
132int cnss_wlfw_athdiag_read_send_sync(struct cnss_plat_data *plat_priv,
133 u32 offset, u32 mem_type,
134 u32 data_len, u8 *data)
135{
136 return 0;
137}
138
139static inline
140int cnss_wlfw_athdiag_write_send_sync(struct cnss_plat_data *plat_priv,
141 u32 offset, u32 mem_type,
142 u32 data_len, u8 *data)
143{
144 return 0;
145}
146
147static inline
148int cnss_wlfw_ini_send_sync(struct cnss_plat_data *plat_priv,
149 u8 fw_log_mode)
150{
151 return 0;
152}
Yuanyuan Liua1683832019-01-29 11:01:29 -0800153
154static inline
155int cnss_wlfw_antenna_switch_send_sync(struct cnss_plat_data *plat_priv)
156{
157 return 0;
158}
159
160static inline
161int cnss_wlfw_antenna_grant_send_sync(struct cnss_plat_data *plat_priv)
162{
163 return 0;
164}
Yuanyuan Liu659d5f32019-01-25 14:29:22 -0800165
166static inline
167int cnss_register_coex_service(struct cnss_plat_data *plat_priv)
168{
169 return 0;
170}
171
172static inline
173void cnss_unregister_coex_service(struct cnss_plat_data *plat_priv) {}
174
175static inline
176int coex_antenna_switch_to_wlan_send_sync_msg(struct cnss_plat_data *plat_priv)
177{
178 return 0;
179}
180
181static inline
182int coex_antenna_switch_to_mdm_send_sync_msg(struct cnss_plat_data *plat_priv)
Yuanyuan Liu36d1fba2019-01-02 14:13:15 -0800183
184static inline
185int cnss_wlfw_qdss_trace_mem_info_send_sync(struct cnss_plat_data *plat_priv)
Yuanyuan Liu659d5f32019-01-25 14:29:22 -0800186{
187 return 0;
188}
Yuanyuan Liud5ec14c2019-01-03 11:25:40 -0800189#endif /* CONFIG_CNSS2_QMI */
190
191#endif /* _CNSS_QMI_H */