1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2021, The Linux Foundation. All rights reserved. */
3 
4 #include "cnss_plat_ipc_service_v01.h"
5 #include <linux/module.h>
6 
7 struct qmi_elem_info cnss_plat_ipc_qmi_init_setup_req_msg_v01_ei[] = {
8 	{
9 		.data_type      = QMI_UNSIGNED_1_BYTE,
10 		.elem_len       = 1,
11 		.elem_size      = sizeof(u8),
12 		.array_type       = NO_ARRAY,
13 		.tlv_type       = 0x01,
14 		.offset         = offsetof(struct
15 					   cnss_plat_ipc_qmi_init_setup_req_msg_v01,
16 					   dms_mac_addr_supported),
17 	},
18 	{
19 		.data_type      = QMI_UNSIGNED_1_BYTE,
20 		.elem_len       = 1,
21 		.elem_size      = sizeof(u8),
22 		.array_type       = NO_ARRAY,
23 		.tlv_type       = 0x02,
24 		.offset         = offsetof(struct
25 					   cnss_plat_ipc_qmi_init_setup_req_msg_v01,
26 					   qdss_hw_trace_override),
27 	},
28 	{
29 		.data_type      = QMI_UNSIGNED_4_BYTE,
30 		.elem_len       = 1,
31 		.elem_size      = sizeof(u32),
32 		.array_type       = NO_ARRAY,
33 		.tlv_type       = 0x03,
34 		.offset         = offsetof(struct
35 					   cnss_plat_ipc_qmi_init_setup_req_msg_v01,
36 					   cal_file_available_bitmask),
37 	},
38 	{
39 		.data_type      = QMI_EOTI,
40 		.array_type       = NO_ARRAY,
41 		.tlv_type       = QMI_COMMON_TLV_TYPE,
42 	},
43 };
44 EXPORT_SYMBOL(cnss_plat_ipc_qmi_init_setup_req_msg_v01_ei);
45 
46 struct qmi_elem_info cnss_plat_ipc_qmi_init_setup_resp_msg_v01_ei[] = {
47 	{
48 		.data_type      = QMI_STRUCT,
49 		.elem_len       = 1,
50 		.elem_size      = sizeof(struct qmi_response_type_v01),
51 		.array_type       = NO_ARRAY,
52 		.tlv_type       = 0x02,
53 		.offset         = offsetof(struct
54 					   cnss_plat_ipc_qmi_init_setup_resp_msg_v01,
55 					   resp),
56 		.ei_array      = qmi_response_type_v01_ei,
57 	},
58 	{
59 		.data_type      = QMI_UNSIGNED_8_BYTE,
60 		.elem_len       = 1,
61 		.elem_size      = sizeof(u64),
62 		.array_type       = NO_ARRAY,
63 		.tlv_type       = 0x03,
64 		.offset         = offsetof(struct
65 					   cnss_plat_ipc_qmi_init_setup_resp_msg_v01,
66 					   drv_status),
67 	},
68 	{
69 		.data_type      = QMI_EOTI,
70 		.array_type       = NO_ARRAY,
71 		.tlv_type       = QMI_COMMON_TLV_TYPE,
72 	},
73 };
74 EXPORT_SYMBOL(cnss_plat_ipc_qmi_init_setup_resp_msg_v01_ei);
75 
76 struct qmi_elem_info cnss_plat_ipc_qmi_file_download_ind_msg_v01_ei[] = {
77 	{
78 		.data_type      = QMI_STRING,
79 		.elem_len       = CNSS_PLAT_IPC_QMI_MAX_FILE_NAME_LEN_V01 + 1,
80 		.elem_size      = sizeof(char),
81 		.array_type       = NO_ARRAY,
82 		.tlv_type       = 0x01,
83 		.offset         = offsetof(struct
84 					   cnss_plat_ipc_qmi_file_download_ind_msg_v01,
85 					   file_name),
86 	},
87 	{
88 		.data_type      = QMI_UNSIGNED_4_BYTE,
89 		.elem_len       = 1,
90 		.elem_size      = sizeof(u32),
91 		.array_type       = NO_ARRAY,
92 		.tlv_type       = 0x02,
93 		.offset         = offsetof(struct
94 					   cnss_plat_ipc_qmi_file_download_ind_msg_v01,
95 					   file_id),
96 	},
97 	{
98 		.data_type      = QMI_EOTI,
99 		.array_type       = NO_ARRAY,
100 		.tlv_type       = QMI_COMMON_TLV_TYPE,
101 	},
102 };
103 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_download_ind_msg_v01_ei);
104 
105 struct qmi_elem_info cnss_plat_ipc_qmi_file_download_req_msg_v01_ei[] = {
106 	{
107 		.data_type      = QMI_UNSIGNED_4_BYTE,
108 		.elem_len       = 1,
109 		.elem_size      = sizeof(u32),
110 		.array_type       = NO_ARRAY,
111 		.tlv_type       = 0x01,
112 		.offset         = offsetof(struct
113 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
114 					   file_id),
115 	},
116 	{
117 		.data_type      = QMI_UNSIGNED_4_BYTE,
118 		.elem_len       = 1,
119 		.elem_size      = sizeof(u32),
120 		.array_type       = NO_ARRAY,
121 		.tlv_type       = 0x02,
122 		.offset         = offsetof(struct
123 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
124 					   file_size),
125 	},
126 	{
127 		.data_type      = QMI_UNSIGNED_1_BYTE,
128 		.elem_len       = 1,
129 		.elem_size      = sizeof(u8),
130 		.array_type       = NO_ARRAY,
131 		.tlv_type       = 0x03,
132 		.offset         = offsetof(struct
133 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
134 					   end),
135 	},
136 	{
137 		.data_type      = QMI_UNSIGNED_4_BYTE,
138 		.elem_len       = 1,
139 		.elem_size      = sizeof(u32),
140 		.array_type       = NO_ARRAY,
141 		.tlv_type       = 0x04,
142 		.offset         = offsetof(struct
143 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
144 					   seg_index),
145 	},
146 	{
147 		.data_type      = QMI_DATA_LEN,
148 		.elem_len       = 1,
149 		.elem_size      = sizeof(u16),
150 		.array_type       = NO_ARRAY,
151 		.tlv_type       = 0x05,
152 		.offset         = offsetof(struct
153 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
154 					   seg_buf_len),
155 	},
156 	{
157 		.data_type      = QMI_UNSIGNED_1_BYTE,
158 		.elem_len       = CNSS_PLAT_IPC_QMI_MAX_DATA_SIZE_V01,
159 		.elem_size      = sizeof(u8),
160 		.array_type       = VAR_LEN_ARRAY,
161 		.tlv_type       = 0x05,
162 		.offset         = offsetof(struct
163 					   cnss_plat_ipc_qmi_file_download_req_msg_v01,
164 					   seg_buf),
165 	},
166 	{
167 		.data_type      = QMI_EOTI,
168 		.array_type       = NO_ARRAY,
169 		.tlv_type       = QMI_COMMON_TLV_TYPE,
170 	},
171 };
172 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_download_req_msg_v01_ei);
173 
174 struct qmi_elem_info cnss_plat_ipc_qmi_file_download_resp_msg_v01_ei[] = {
175 	{
176 		.data_type      = QMI_STRUCT,
177 		.elem_len       = 1,
178 		.elem_size      = sizeof(struct qmi_response_type_v01),
179 		.array_type       = NO_ARRAY,
180 		.tlv_type       = 0x02,
181 		.offset         = offsetof(struct
182 					   cnss_plat_ipc_qmi_file_download_resp_msg_v01,
183 					   resp),
184 		.ei_array      = qmi_response_type_v01_ei,
185 	},
186 	{
187 		.data_type      = QMI_UNSIGNED_4_BYTE,
188 		.elem_len       = 1,
189 		.elem_size      = sizeof(u32),
190 		.array_type       = NO_ARRAY,
191 		.tlv_type       = 0x03,
192 		.offset         = offsetof(struct
193 					   cnss_plat_ipc_qmi_file_download_resp_msg_v01,
194 					   file_id),
195 	},
196 	{
197 		.data_type      = QMI_UNSIGNED_4_BYTE,
198 		.elem_len       = 1,
199 		.elem_size      = sizeof(u32),
200 		.array_type       = NO_ARRAY,
201 		.tlv_type       = 0x04,
202 		.offset         = offsetof(struct
203 					   cnss_plat_ipc_qmi_file_download_resp_msg_v01,
204 					   seg_index),
205 	},
206 	{
207 		.data_type      = QMI_EOTI,
208 		.array_type       = NO_ARRAY,
209 		.tlv_type       = QMI_COMMON_TLV_TYPE,
210 	},
211 };
212 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_download_resp_msg_v01_ei);
213 
214 struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_ind_msg_v01_ei[] = {
215 	{
216 		.data_type      = QMI_STRING,
217 		.elem_len       = CNSS_PLAT_IPC_QMI_MAX_FILE_NAME_LEN_V01 + 1,
218 		.elem_size      = sizeof(char),
219 		.array_type       = NO_ARRAY,
220 		.tlv_type       = 0x01,
221 		.offset         = offsetof(struct
222 					   cnss_plat_ipc_qmi_file_upload_ind_msg_v01,
223 					   file_name),
224 	},
225 	{
226 		.data_type      = QMI_UNSIGNED_4_BYTE,
227 		.elem_len       = 1,
228 		.elem_size      = sizeof(u32),
229 		.array_type       = NO_ARRAY,
230 		.tlv_type       = 0x02,
231 		.offset         = offsetof(struct
232 					   cnss_plat_ipc_qmi_file_upload_ind_msg_v01,
233 					   file_id),
234 	},
235 	{
236 		.data_type      = QMI_UNSIGNED_4_BYTE,
237 		.elem_len       = 1,
238 		.elem_size      = sizeof(u32),
239 		.array_type       = NO_ARRAY,
240 		.tlv_type       = 0x03,
241 		.offset         = offsetof(struct
242 					   cnss_plat_ipc_qmi_file_upload_ind_msg_v01,
243 					   file_size),
244 	},
245 	{
246 		.data_type      = QMI_EOTI,
247 		.array_type       = NO_ARRAY,
248 		.tlv_type       = QMI_COMMON_TLV_TYPE,
249 	},
250 };
251 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_upload_ind_msg_v01_ei);
252 
253 struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_req_msg_v01_ei[] = {
254 	{
255 		.data_type      = QMI_UNSIGNED_4_BYTE,
256 		.elem_len       = 1,
257 		.elem_size      = sizeof(u32),
258 		.array_type       = NO_ARRAY,
259 		.tlv_type       = 0x01,
260 		.offset         = offsetof(struct
261 					   cnss_plat_ipc_qmi_file_upload_req_msg_v01,
262 					   file_id),
263 	},
264 	{
265 		.data_type      = QMI_UNSIGNED_4_BYTE,
266 		.elem_len       = 1,
267 		.elem_size      = sizeof(u32),
268 		.array_type       = NO_ARRAY,
269 		.tlv_type       = 0x02,
270 		.offset         = offsetof(struct
271 					   cnss_plat_ipc_qmi_file_upload_req_msg_v01,
272 					   seg_index),
273 	},
274 	{
275 		.data_type      = QMI_EOTI,
276 		.array_type       = NO_ARRAY,
277 		.tlv_type       = QMI_COMMON_TLV_TYPE,
278 	},
279 };
280 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_upload_req_msg_v01_ei);
281 
282 struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_resp_msg_v01_ei[] = {
283 	{
284 		.data_type      = QMI_STRUCT,
285 		.elem_len       = 1,
286 		.elem_size      = sizeof(struct qmi_response_type_v01),
287 		.array_type       = NO_ARRAY,
288 		.tlv_type       = 0x02,
289 		.offset         = offsetof(struct
290 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
291 					   resp),
292 		.ei_array      = qmi_response_type_v01_ei,
293 	},
294 	{
295 		.data_type      = QMI_UNSIGNED_4_BYTE,
296 		.elem_len       = 1,
297 		.elem_size      = sizeof(u32),
298 		.array_type       = NO_ARRAY,
299 		.tlv_type       = 0x03,
300 		.offset         = offsetof(struct
301 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
302 					   file_id),
303 	},
304 	{
305 		.data_type      = QMI_UNSIGNED_1_BYTE,
306 		.elem_len       = 1,
307 		.elem_size      = sizeof(u8),
308 		.array_type       = NO_ARRAY,
309 		.tlv_type       = 0x04,
310 		.offset         = offsetof(struct
311 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
312 					   end),
313 	},
314 	{
315 		.data_type      = QMI_UNSIGNED_4_BYTE,
316 		.elem_len       = 1,
317 		.elem_size      = sizeof(u32),
318 		.array_type       = NO_ARRAY,
319 		.tlv_type       = 0x05,
320 		.offset         = offsetof(struct
321 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
322 					   seg_index),
323 	},
324 	{
325 		.data_type      = QMI_DATA_LEN,
326 		.elem_len       = 1,
327 		.elem_size      = sizeof(u16),
328 		.array_type       = NO_ARRAY,
329 		.tlv_type       = 0x06,
330 		.offset         = offsetof(struct
331 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
332 					   seg_buf_len),
333 	},
334 	{
335 		.data_type      = QMI_UNSIGNED_1_BYTE,
336 		.elem_len       = CNSS_PLAT_IPC_QMI_MAX_DATA_SIZE_V01,
337 		.elem_size      = sizeof(u8),
338 		.array_type       = VAR_LEN_ARRAY,
339 		.tlv_type       = 0x06,
340 		.offset         = offsetof(struct
341 					   cnss_plat_ipc_qmi_file_upload_resp_msg_v01,
342 					   seg_buf),
343 	},
344 	{
345 		.data_type      = QMI_EOTI,
346 		.array_type       = NO_ARRAY,
347 		.tlv_type       = QMI_COMMON_TLV_TYPE,
348 	},
349 };
350 EXPORT_SYMBOL(cnss_plat_ipc_qmi_file_upload_resp_msg_v01_ei);
351 
352 struct qmi_elem_info cnss_plat_ipc_qmi_reg_client_req_msg_v01_ei[] = {
353 	{
354 		.data_type      = QMI_OPT_FLAG,
355 		.elem_len       = 1,
356 		.elem_size      = sizeof(u8),
357 		.array_type       = NO_ARRAY,
358 		.tlv_type       = 0x10,
359 		.offset         = offsetof(struct
360 					   cnss_plat_ipc_qmi_reg_client_req_msg_v01,
361 					   client_id_valid),
362 	},
363 	{
364 		.data_type      = QMI_SIGNED_4_BYTE_ENUM,
365 		.elem_len       = 1,
366 		.elem_size      = sizeof(enum cnss_plat_ipc_qmi_client_id_v01),
367 		.array_type       = NO_ARRAY,
368 		.tlv_type       = 0x10,
369 		.offset         = offsetof(struct
370 					   cnss_plat_ipc_qmi_reg_client_req_msg_v01,
371 					   client_id),
372 	},
373 	{
374 		.data_type      = QMI_EOTI,
375 		.array_type       = NO_ARRAY,
376 		.tlv_type       = QMI_COMMON_TLV_TYPE,
377 	},
378 };
379 EXPORT_SYMBOL(cnss_plat_ipc_qmi_reg_client_req_msg_v01_ei);
380 
381 struct qmi_elem_info cnss_plat_ipc_qmi_reg_client_resp_msg_v01_ei[] = {
382 	{
383 		.data_type      = QMI_STRUCT,
384 		.elem_len       = 1,
385 		.elem_size      = sizeof(struct qmi_response_type_v01),
386 		.array_type       = NO_ARRAY,
387 		.tlv_type       = 0x02,
388 		.offset         = offsetof(struct
389 					   cnss_plat_ipc_qmi_reg_client_resp_msg_v01,
390 					   resp),
391 		.ei_array      = qmi_response_type_v01_ei,
392 	},
393 	{
394 		.data_type      = QMI_EOTI,
395 		.array_type       = NO_ARRAY,
396 		.tlv_type       = QMI_COMMON_TLV_TYPE,
397 	},
398 };
399 EXPORT_SYMBOL(cnss_plat_ipc_qmi_reg_client_resp_msg_v01_ei);
400 
401 MODULE_LICENSE("GPL v2");
402 MODULE_DESCRIPTION("WLAN FW QMI service");
403