xref: /freebsd/sys/contrib/dev/athk/ath12k/qmi.c (revision 5c1def83a4cc2eb3f828600dfd786f8c5788fb7d)
1*5c1def83SBjoern A. Zeeb // SPDX-License-Identifier: BSD-3-Clause-Clear
2*5c1def83SBjoern A. Zeeb /*
3*5c1def83SBjoern A. Zeeb  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4*5c1def83SBjoern A. Zeeb  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
5*5c1def83SBjoern A. Zeeb  */
6*5c1def83SBjoern A. Zeeb 
7*5c1def83SBjoern A. Zeeb #include <linux/elf.h>
8*5c1def83SBjoern A. Zeeb #if defined(__FreeBSD__)
9*5c1def83SBjoern A. Zeeb #include <linux/of.h>
10*5c1def83SBjoern A. Zeeb #include <linux/firmware.h>
11*5c1def83SBjoern A. Zeeb #include <linux/socket.h>
12*5c1def83SBjoern A. Zeeb #include <linux/workqueue.h>
13*5c1def83SBjoern A. Zeeb #endif
14*5c1def83SBjoern A. Zeeb 
15*5c1def83SBjoern A. Zeeb #include "qmi.h"
16*5c1def83SBjoern A. Zeeb #include "core.h"
17*5c1def83SBjoern A. Zeeb #include "debug.h"
18*5c1def83SBjoern A. Zeeb #if defined(__linux__)
19*5c1def83SBjoern A. Zeeb #include <linux/of.h>
20*5c1def83SBjoern A. Zeeb #include <linux/firmware.h>
21*5c1def83SBjoern A. Zeeb #endif
22*5c1def83SBjoern A. Zeeb 
23*5c1def83SBjoern A. Zeeb #define SLEEP_CLOCK_SELECT_INTERNAL_BIT	0x02
24*5c1def83SBjoern A. Zeeb #define HOST_CSTATE_BIT			0x04
25*5c1def83SBjoern A. Zeeb #define PLATFORM_CAP_PCIE_GLOBAL_RESET	0x08
26*5c1def83SBjoern A. Zeeb #define ATH12K_QMI_MAX_CHUNK_SIZE	2097152
27*5c1def83SBjoern A. Zeeb 
28*5c1def83SBjoern A. Zeeb static struct qmi_elem_info wlfw_host_mlo_chip_info_s_v01_ei[] = {
29*5c1def83SBjoern A. Zeeb 	{
30*5c1def83SBjoern A. Zeeb 		.data_type      = QMI_UNSIGNED_1_BYTE,
31*5c1def83SBjoern A. Zeeb 		.elem_len       = 1,
32*5c1def83SBjoern A. Zeeb 		.elem_size      = sizeof(u8),
33*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
34*5c1def83SBjoern A. Zeeb 		.tlv_type       = 0,
35*5c1def83SBjoern A. Zeeb 		.offset         = offsetof(struct wlfw_host_mlo_chip_info_s_v01,
36*5c1def83SBjoern A. Zeeb 					   chip_id),
37*5c1def83SBjoern A. Zeeb 	},
38*5c1def83SBjoern A. Zeeb 	{
39*5c1def83SBjoern A. Zeeb 		.data_type      = QMI_UNSIGNED_1_BYTE,
40*5c1def83SBjoern A. Zeeb 		.elem_len       = 1,
41*5c1def83SBjoern A. Zeeb 		.elem_size      = sizeof(u8),
42*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
43*5c1def83SBjoern A. Zeeb 		.tlv_type       = 0,
44*5c1def83SBjoern A. Zeeb 		.offset         = offsetof(struct wlfw_host_mlo_chip_info_s_v01,
45*5c1def83SBjoern A. Zeeb 					   num_local_links),
46*5c1def83SBjoern A. Zeeb 	},
47*5c1def83SBjoern A. Zeeb 	{
48*5c1def83SBjoern A. Zeeb 		.data_type      = QMI_UNSIGNED_1_BYTE,
49*5c1def83SBjoern A. Zeeb 		.elem_len       = QMI_WLFW_MAX_NUM_MLO_LINKS_PER_CHIP_V01,
50*5c1def83SBjoern A. Zeeb 		.elem_size      = sizeof(u8),
51*5c1def83SBjoern A. Zeeb 		.array_type     = STATIC_ARRAY,
52*5c1def83SBjoern A. Zeeb 		.tlv_type       = 0,
53*5c1def83SBjoern A. Zeeb 		.offset         = offsetof(struct wlfw_host_mlo_chip_info_s_v01,
54*5c1def83SBjoern A. Zeeb 					   hw_link_id),
55*5c1def83SBjoern A. Zeeb 	},
56*5c1def83SBjoern A. Zeeb 	{
57*5c1def83SBjoern A. Zeeb 		.data_type      = QMI_UNSIGNED_1_BYTE,
58*5c1def83SBjoern A. Zeeb 		.elem_len       = QMI_WLFW_MAX_NUM_MLO_LINKS_PER_CHIP_V01,
59*5c1def83SBjoern A. Zeeb 		.elem_size      = sizeof(u8),
60*5c1def83SBjoern A. Zeeb 		.array_type     = STATIC_ARRAY,
61*5c1def83SBjoern A. Zeeb 		.tlv_type       = 0,
62*5c1def83SBjoern A. Zeeb 		.offset         = offsetof(struct wlfw_host_mlo_chip_info_s_v01,
63*5c1def83SBjoern A. Zeeb 					   valid_mlo_link_id),
64*5c1def83SBjoern A. Zeeb 	},
65*5c1def83SBjoern A. Zeeb 	{
66*5c1def83SBjoern A. Zeeb 		.data_type      = QMI_EOTI,
67*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
68*5c1def83SBjoern A. Zeeb 		.tlv_type       = QMI_COMMON_TLV_TYPE,
69*5c1def83SBjoern A. Zeeb 	},
70*5c1def83SBjoern A. Zeeb };
71*5c1def83SBjoern A. Zeeb 
72*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = {
73*5c1def83SBjoern A. Zeeb 	{
74*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
75*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
76*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
77*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
78*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
79*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
80*5c1def83SBjoern A. Zeeb 					   num_clients_valid),
81*5c1def83SBjoern A. Zeeb 	},
82*5c1def83SBjoern A. Zeeb 	{
83*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
84*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
85*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
86*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
87*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
88*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
89*5c1def83SBjoern A. Zeeb 					   num_clients),
90*5c1def83SBjoern A. Zeeb 	},
91*5c1def83SBjoern A. Zeeb 	{
92*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
93*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
94*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
95*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
96*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
97*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
98*5c1def83SBjoern A. Zeeb 					   wake_msi_valid),
99*5c1def83SBjoern A. Zeeb 	},
100*5c1def83SBjoern A. Zeeb 	{
101*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
102*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
103*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
104*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
105*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
106*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
107*5c1def83SBjoern A. Zeeb 					   wake_msi),
108*5c1def83SBjoern A. Zeeb 	},
109*5c1def83SBjoern A. Zeeb 	{
110*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
111*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
112*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
113*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
114*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
115*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
116*5c1def83SBjoern A. Zeeb 					   gpios_valid),
117*5c1def83SBjoern A. Zeeb 	},
118*5c1def83SBjoern A. Zeeb 	{
119*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
120*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
121*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
122*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
123*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
124*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
125*5c1def83SBjoern A. Zeeb 					   gpios_len),
126*5c1def83SBjoern A. Zeeb 	},
127*5c1def83SBjoern A. Zeeb 	{
128*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
129*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLFW_MAX_NUM_GPIO_V01,
130*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
131*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
132*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
133*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
134*5c1def83SBjoern A. Zeeb 					   gpios),
135*5c1def83SBjoern A. Zeeb 	},
136*5c1def83SBjoern A. Zeeb 	{
137*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
138*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
139*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
140*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
141*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
142*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
143*5c1def83SBjoern A. Zeeb 					   nm_modem_valid),
144*5c1def83SBjoern A. Zeeb 	},
145*5c1def83SBjoern A. Zeeb 	{
146*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
147*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
148*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
149*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
150*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
151*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
152*5c1def83SBjoern A. Zeeb 					   nm_modem),
153*5c1def83SBjoern A. Zeeb 	},
154*5c1def83SBjoern A. Zeeb 	{
155*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
156*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
157*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
158*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
159*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
160*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
161*5c1def83SBjoern A. Zeeb 					   bdf_support_valid),
162*5c1def83SBjoern A. Zeeb 	},
163*5c1def83SBjoern A. Zeeb 	{
164*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
165*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
166*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
167*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
168*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
169*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
170*5c1def83SBjoern A. Zeeb 					   bdf_support),
171*5c1def83SBjoern A. Zeeb 	},
172*5c1def83SBjoern A. Zeeb 	{
173*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
174*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
175*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
176*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
177*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
178*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
179*5c1def83SBjoern A. Zeeb 					   bdf_cache_support_valid),
180*5c1def83SBjoern A. Zeeb 	},
181*5c1def83SBjoern A. Zeeb 	{
182*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
183*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
184*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
185*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
186*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
187*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
188*5c1def83SBjoern A. Zeeb 					   bdf_cache_support),
189*5c1def83SBjoern A. Zeeb 	},
190*5c1def83SBjoern A. Zeeb 	{
191*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
192*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
193*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
194*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
195*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
196*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
197*5c1def83SBjoern A. Zeeb 					   m3_support_valid),
198*5c1def83SBjoern A. Zeeb 	},
199*5c1def83SBjoern A. Zeeb 	{
200*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
201*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
202*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
203*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
204*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
205*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
206*5c1def83SBjoern A. Zeeb 					   m3_support),
207*5c1def83SBjoern A. Zeeb 	},
208*5c1def83SBjoern A. Zeeb 	{
209*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
210*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
211*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
212*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
213*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
214*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
215*5c1def83SBjoern A. Zeeb 					   m3_cache_support_valid),
216*5c1def83SBjoern A. Zeeb 	},
217*5c1def83SBjoern A. Zeeb 	{
218*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
219*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
220*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
221*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
222*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
223*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
224*5c1def83SBjoern A. Zeeb 					   m3_cache_support),
225*5c1def83SBjoern A. Zeeb 	},
226*5c1def83SBjoern A. Zeeb 	{
227*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
228*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
229*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
230*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
231*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
232*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
233*5c1def83SBjoern A. Zeeb 					   cal_filesys_support_valid),
234*5c1def83SBjoern A. Zeeb 	},
235*5c1def83SBjoern A. Zeeb 	{
236*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
237*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
238*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
239*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
240*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
241*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
242*5c1def83SBjoern A. Zeeb 					   cal_filesys_support),
243*5c1def83SBjoern A. Zeeb 	},
244*5c1def83SBjoern A. Zeeb 	{
245*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
246*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
247*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
248*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
249*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
250*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
251*5c1def83SBjoern A. Zeeb 					   cal_cache_support_valid),
252*5c1def83SBjoern A. Zeeb 	},
253*5c1def83SBjoern A. Zeeb 	{
254*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
255*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
256*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
257*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
258*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
259*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
260*5c1def83SBjoern A. Zeeb 					   cal_cache_support),
261*5c1def83SBjoern A. Zeeb 	},
262*5c1def83SBjoern A. Zeeb 	{
263*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
264*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
265*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
266*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
267*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
268*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
269*5c1def83SBjoern A. Zeeb 					   cal_done_valid),
270*5c1def83SBjoern A. Zeeb 	},
271*5c1def83SBjoern A. Zeeb 	{
272*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
273*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
274*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
275*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
276*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
277*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
278*5c1def83SBjoern A. Zeeb 					   cal_done),
279*5c1def83SBjoern A. Zeeb 	},
280*5c1def83SBjoern A. Zeeb 	{
281*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
282*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
283*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
284*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
285*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
286*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
287*5c1def83SBjoern A. Zeeb 					   mem_bucket_valid),
288*5c1def83SBjoern A. Zeeb 	},
289*5c1def83SBjoern A. Zeeb 	{
290*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
291*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
292*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
293*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
294*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
295*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
296*5c1def83SBjoern A. Zeeb 					   mem_bucket),
297*5c1def83SBjoern A. Zeeb 	},
298*5c1def83SBjoern A. Zeeb 	{
299*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
300*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
301*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
302*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
303*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1C,
304*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
305*5c1def83SBjoern A. Zeeb 					   mem_cfg_mode_valid),
306*5c1def83SBjoern A. Zeeb 	},
307*5c1def83SBjoern A. Zeeb 	{
308*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
309*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
310*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
311*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
312*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1C,
313*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
314*5c1def83SBjoern A. Zeeb 					   mem_cfg_mode),
315*5c1def83SBjoern A. Zeeb 	},
316*5c1def83SBjoern A. Zeeb 	{
317*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
318*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
319*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
320*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
321*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1D,
322*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
323*5c1def83SBjoern A. Zeeb 					   cal_duration_valid),
324*5c1def83SBjoern A. Zeeb 	},
325*5c1def83SBjoern A. Zeeb 	{
326*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_2_BYTE,
327*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
328*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
329*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
330*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1D,
331*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
332*5c1def83SBjoern A. Zeeb 					   cal_duraiton),
333*5c1def83SBjoern A. Zeeb 	},
334*5c1def83SBjoern A. Zeeb 	{
335*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
336*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
337*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
338*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
339*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1E,
340*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
341*5c1def83SBjoern A. Zeeb 					   platform_name_valid),
342*5c1def83SBjoern A. Zeeb 	},
343*5c1def83SBjoern A. Zeeb 	{
344*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRING,
345*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_PLATFORM_NAME_LEN_V01 + 1,
346*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(char),
347*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
348*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1E,
349*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
350*5c1def83SBjoern A. Zeeb 					   platform_name),
351*5c1def83SBjoern A. Zeeb 	},
352*5c1def83SBjoern A. Zeeb 	{
353*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
354*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
355*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
356*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
357*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1F,
358*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
359*5c1def83SBjoern A. Zeeb 					   ddr_range_valid),
360*5c1def83SBjoern A. Zeeb 	},
361*5c1def83SBjoern A. Zeeb 	{
362*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
363*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_HOST_DDR_RANGE_SIZE_V01,
364*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_host_ddr_range),
365*5c1def83SBjoern A. Zeeb 		.array_type	= STATIC_ARRAY,
366*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1F,
367*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
368*5c1def83SBjoern A. Zeeb 					   ddr_range),
369*5c1def83SBjoern A. Zeeb 	},
370*5c1def83SBjoern A. Zeeb 	{
371*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
372*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
373*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
374*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
375*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x20,
376*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
377*5c1def83SBjoern A. Zeeb 					   host_build_type_valid),
378*5c1def83SBjoern A. Zeeb 	},
379*5c1def83SBjoern A. Zeeb 	{
380*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
381*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
382*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_host_build_type),
383*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
384*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x20,
385*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
386*5c1def83SBjoern A. Zeeb 					   host_build_type),
387*5c1def83SBjoern A. Zeeb 	},
388*5c1def83SBjoern A. Zeeb 	{
389*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
390*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
391*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
392*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
393*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x21,
394*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
395*5c1def83SBjoern A. Zeeb 					   mlo_capable_valid),
396*5c1def83SBjoern A. Zeeb 	},
397*5c1def83SBjoern A. Zeeb 	{
398*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
399*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
400*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
401*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
402*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x21,
403*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
404*5c1def83SBjoern A. Zeeb 					   mlo_capable),
405*5c1def83SBjoern A. Zeeb 	},
406*5c1def83SBjoern A. Zeeb 	{
407*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
408*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
409*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
410*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
411*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x22,
412*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
413*5c1def83SBjoern A. Zeeb 					   mlo_chip_id_valid),
414*5c1def83SBjoern A. Zeeb 	},
415*5c1def83SBjoern A. Zeeb 	{
416*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_2_BYTE,
417*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
418*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
419*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
420*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x22,
421*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
422*5c1def83SBjoern A. Zeeb 					   mlo_chip_id),
423*5c1def83SBjoern A. Zeeb 	},
424*5c1def83SBjoern A. Zeeb 	{
425*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
426*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
427*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
428*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
429*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x23,
430*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
431*5c1def83SBjoern A. Zeeb 					   mlo_group_id_valid),
432*5c1def83SBjoern A. Zeeb 	},
433*5c1def83SBjoern A. Zeeb 	{
434*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
435*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
436*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
437*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
438*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x23,
439*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
440*5c1def83SBjoern A. Zeeb 					   mlo_group_id),
441*5c1def83SBjoern A. Zeeb 	},
442*5c1def83SBjoern A. Zeeb 	{
443*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
444*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
445*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
446*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
447*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x24,
448*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
449*5c1def83SBjoern A. Zeeb 					   max_mlo_peer_valid),
450*5c1def83SBjoern A. Zeeb 	},
451*5c1def83SBjoern A. Zeeb 	{
452*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_2_BYTE,
453*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
454*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
455*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
456*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x24,
457*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
458*5c1def83SBjoern A. Zeeb 					   max_mlo_peer),
459*5c1def83SBjoern A. Zeeb 	},
460*5c1def83SBjoern A. Zeeb 	{
461*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
462*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
463*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
464*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
465*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x25,
466*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
467*5c1def83SBjoern A. Zeeb 					   mlo_num_chips_valid),
468*5c1def83SBjoern A. Zeeb 	},
469*5c1def83SBjoern A. Zeeb 	{
470*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
471*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
472*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
473*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
474*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x25,
475*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
476*5c1def83SBjoern A. Zeeb 					   mlo_num_chips),
477*5c1def83SBjoern A. Zeeb 	},
478*5c1def83SBjoern A. Zeeb 	{
479*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
480*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
481*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
482*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
483*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x26,
484*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
485*5c1def83SBjoern A. Zeeb 					   mlo_chip_info_valid),
486*5c1def83SBjoern A. Zeeb 	},
487*5c1def83SBjoern A. Zeeb 	{
488*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
489*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLFW_MAX_NUM_MLO_CHIPS_V01,
490*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct wlfw_host_mlo_chip_info_s_v01),
491*5c1def83SBjoern A. Zeeb 		.array_type	= STATIC_ARRAY,
492*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x26,
493*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
494*5c1def83SBjoern A. Zeeb 					   mlo_chip_info),
495*5c1def83SBjoern A. Zeeb 		.ei_array	= wlfw_host_mlo_chip_info_s_v01_ei,
496*5c1def83SBjoern A. Zeeb 	},
497*5c1def83SBjoern A. Zeeb 	{
498*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
499*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
500*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
501*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
502*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x27,
503*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
504*5c1def83SBjoern A. Zeeb 					   feature_list_valid),
505*5c1def83SBjoern A. Zeeb 	},
506*5c1def83SBjoern A. Zeeb 	{
507*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
508*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
509*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
510*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
511*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x27,
512*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_req_msg_v01,
513*5c1def83SBjoern A. Zeeb 					   feature_list),
514*5c1def83SBjoern A. Zeeb 	},
515*5c1def83SBjoern A. Zeeb 	{
516*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
517*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
518*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
519*5c1def83SBjoern A. Zeeb 	},
520*5c1def83SBjoern A. Zeeb };
521*5c1def83SBjoern A. Zeeb 
522*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_host_cap_resp_msg_v01_ei[] = {
523*5c1def83SBjoern A. Zeeb 	{
524*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
525*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
526*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
527*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
528*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
529*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_host_cap_resp_msg_v01, resp),
530*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
531*5c1def83SBjoern A. Zeeb 	},
532*5c1def83SBjoern A. Zeeb 	{
533*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
534*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
535*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
536*5c1def83SBjoern A. Zeeb 	},
537*5c1def83SBjoern A. Zeeb };
538*5c1def83SBjoern A. Zeeb 
539*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_ind_register_req_msg_v01_ei[] = {
540*5c1def83SBjoern A. Zeeb 	{
541*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
542*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
543*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
544*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
545*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
546*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
547*5c1def83SBjoern A. Zeeb 					   fw_ready_enable_valid),
548*5c1def83SBjoern A. Zeeb 	},
549*5c1def83SBjoern A. Zeeb 	{
550*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
551*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
552*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
553*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
554*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
555*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
556*5c1def83SBjoern A. Zeeb 					   fw_ready_enable),
557*5c1def83SBjoern A. Zeeb 	},
558*5c1def83SBjoern A. Zeeb 	{
559*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
560*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
561*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
562*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
563*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
564*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
565*5c1def83SBjoern A. Zeeb 					   initiate_cal_download_enable_valid),
566*5c1def83SBjoern A. Zeeb 	},
567*5c1def83SBjoern A. Zeeb 	{
568*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
569*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
570*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
571*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
572*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
573*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
574*5c1def83SBjoern A. Zeeb 					   initiate_cal_download_enable),
575*5c1def83SBjoern A. Zeeb 	},
576*5c1def83SBjoern A. Zeeb 	{
577*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
578*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
579*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
580*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
581*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
582*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
583*5c1def83SBjoern A. Zeeb 					   initiate_cal_update_enable_valid),
584*5c1def83SBjoern A. Zeeb 	},
585*5c1def83SBjoern A. Zeeb 	{
586*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
587*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
588*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
589*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
590*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
591*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
592*5c1def83SBjoern A. Zeeb 					   initiate_cal_update_enable),
593*5c1def83SBjoern A. Zeeb 	},
594*5c1def83SBjoern A. Zeeb 	{
595*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
596*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
597*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
598*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
599*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
600*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
601*5c1def83SBjoern A. Zeeb 					   msa_ready_enable_valid),
602*5c1def83SBjoern A. Zeeb 	},
603*5c1def83SBjoern A. Zeeb 	{
604*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
605*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
606*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
607*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
608*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
609*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
610*5c1def83SBjoern A. Zeeb 					   msa_ready_enable),
611*5c1def83SBjoern A. Zeeb 	},
612*5c1def83SBjoern A. Zeeb 	{
613*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
614*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
615*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
616*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
617*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
618*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
619*5c1def83SBjoern A. Zeeb 					   pin_connect_result_enable_valid),
620*5c1def83SBjoern A. Zeeb 	},
621*5c1def83SBjoern A. Zeeb 	{
622*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
623*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
624*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
625*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
626*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
627*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
628*5c1def83SBjoern A. Zeeb 					   pin_connect_result_enable),
629*5c1def83SBjoern A. Zeeb 	},
630*5c1def83SBjoern A. Zeeb 	{
631*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
632*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
633*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
634*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
635*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
636*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
637*5c1def83SBjoern A. Zeeb 					   client_id_valid),
638*5c1def83SBjoern A. Zeeb 	},
639*5c1def83SBjoern A. Zeeb 	{
640*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
641*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
642*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
643*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
644*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
645*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
646*5c1def83SBjoern A. Zeeb 					   client_id),
647*5c1def83SBjoern A. Zeeb 	},
648*5c1def83SBjoern A. Zeeb 	{
649*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
650*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
651*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
652*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
653*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
654*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
655*5c1def83SBjoern A. Zeeb 					   request_mem_enable_valid),
656*5c1def83SBjoern A. Zeeb 	},
657*5c1def83SBjoern A. Zeeb 	{
658*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
659*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
660*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
661*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
662*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
663*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
664*5c1def83SBjoern A. Zeeb 					   request_mem_enable),
665*5c1def83SBjoern A. Zeeb 	},
666*5c1def83SBjoern A. Zeeb 	{
667*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
668*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
669*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
670*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
671*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
672*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
673*5c1def83SBjoern A. Zeeb 					   fw_mem_ready_enable_valid),
674*5c1def83SBjoern A. Zeeb 	},
675*5c1def83SBjoern A. Zeeb 	{
676*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
677*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
678*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
679*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
680*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
681*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
682*5c1def83SBjoern A. Zeeb 					   fw_mem_ready_enable),
683*5c1def83SBjoern A. Zeeb 	},
684*5c1def83SBjoern A. Zeeb 	{
685*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
686*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
687*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
688*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
689*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
690*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
691*5c1def83SBjoern A. Zeeb 					   fw_init_done_enable_valid),
692*5c1def83SBjoern A. Zeeb 	},
693*5c1def83SBjoern A. Zeeb 	{
694*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
695*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
696*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
697*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
698*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
699*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
700*5c1def83SBjoern A. Zeeb 					   fw_init_done_enable),
701*5c1def83SBjoern A. Zeeb 	},
702*5c1def83SBjoern A. Zeeb 
703*5c1def83SBjoern A. Zeeb 	{
704*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
705*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
706*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
707*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
708*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
709*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
710*5c1def83SBjoern A. Zeeb 					   rejuvenate_enable_valid),
711*5c1def83SBjoern A. Zeeb 	},
712*5c1def83SBjoern A. Zeeb 	{
713*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
714*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
715*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
716*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
717*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
718*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
719*5c1def83SBjoern A. Zeeb 					   rejuvenate_enable),
720*5c1def83SBjoern A. Zeeb 	},
721*5c1def83SBjoern A. Zeeb 	{
722*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
723*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
724*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
725*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
726*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
727*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
728*5c1def83SBjoern A. Zeeb 					   xo_cal_enable_valid),
729*5c1def83SBjoern A. Zeeb 	},
730*5c1def83SBjoern A. Zeeb 	{
731*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
732*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
733*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
734*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
735*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
736*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
737*5c1def83SBjoern A. Zeeb 					   xo_cal_enable),
738*5c1def83SBjoern A. Zeeb 	},
739*5c1def83SBjoern A. Zeeb 	{
740*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
741*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
742*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
743*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
744*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
745*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
746*5c1def83SBjoern A. Zeeb 					   cal_done_enable_valid),
747*5c1def83SBjoern A. Zeeb 	},
748*5c1def83SBjoern A. Zeeb 	{
749*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
750*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
751*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
752*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
753*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
754*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_req_msg_v01,
755*5c1def83SBjoern A. Zeeb 					   cal_done_enable),
756*5c1def83SBjoern A. Zeeb 	},
757*5c1def83SBjoern A. Zeeb 	{
758*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
759*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
760*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
761*5c1def83SBjoern A. Zeeb 	},
762*5c1def83SBjoern A. Zeeb };
763*5c1def83SBjoern A. Zeeb 
764*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_ind_register_resp_msg_v01_ei[] = {
765*5c1def83SBjoern A. Zeeb 	{
766*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
767*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
768*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
769*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
770*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
771*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_resp_msg_v01,
772*5c1def83SBjoern A. Zeeb 					   resp),
773*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
774*5c1def83SBjoern A. Zeeb 	},
775*5c1def83SBjoern A. Zeeb 	{
776*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
777*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
778*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
779*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
780*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
781*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_resp_msg_v01,
782*5c1def83SBjoern A. Zeeb 					   fw_status_valid),
783*5c1def83SBjoern A. Zeeb 	},
784*5c1def83SBjoern A. Zeeb 	{
785*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
786*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
787*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
788*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
789*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
790*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ind_register_resp_msg_v01,
791*5c1def83SBjoern A. Zeeb 					   fw_status),
792*5c1def83SBjoern A. Zeeb 	},
793*5c1def83SBjoern A. Zeeb 	{
794*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
795*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
796*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
797*5c1def83SBjoern A. Zeeb 	},
798*5c1def83SBjoern A. Zeeb };
799*5c1def83SBjoern A. Zeeb 
800*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_mem_cfg_s_v01_ei[] = {
801*5c1def83SBjoern A. Zeeb 	{
802*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
803*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
804*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
805*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
806*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
807*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_cfg_s_v01, offset),
808*5c1def83SBjoern A. Zeeb 	},
809*5c1def83SBjoern A. Zeeb 	{
810*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
811*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
812*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
813*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
814*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
815*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_cfg_s_v01, size),
816*5c1def83SBjoern A. Zeeb 	},
817*5c1def83SBjoern A. Zeeb 	{
818*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
819*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
820*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
821*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
822*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
823*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_cfg_s_v01, secure_flag),
824*5c1def83SBjoern A. Zeeb 	},
825*5c1def83SBjoern A. Zeeb 	{
826*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
827*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
828*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
829*5c1def83SBjoern A. Zeeb 	},
830*5c1def83SBjoern A. Zeeb };
831*5c1def83SBjoern A. Zeeb 
832*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_mem_seg_s_v01_ei[] = {
833*5c1def83SBjoern A. Zeeb 	{
834*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
835*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
836*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
837*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
838*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
839*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_s_v01,
840*5c1def83SBjoern A. Zeeb 				  size),
841*5c1def83SBjoern A. Zeeb 	},
842*5c1def83SBjoern A. Zeeb 	{
843*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
844*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
845*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_mem_type_enum_v01),
846*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
847*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
848*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_s_v01, type),
849*5c1def83SBjoern A. Zeeb 	},
850*5c1def83SBjoern A. Zeeb 	{
851*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
852*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
853*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
854*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
855*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
856*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_s_v01, mem_cfg_len),
857*5c1def83SBjoern A. Zeeb 	},
858*5c1def83SBjoern A. Zeeb 	{
859*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
860*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_NUM_MEM_CFG_V01,
861*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_mem_cfg_s_v01),
862*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
863*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
864*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_s_v01, mem_cfg),
865*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_mem_cfg_s_v01_ei,
866*5c1def83SBjoern A. Zeeb 	},
867*5c1def83SBjoern A. Zeeb 	{
868*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
869*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
870*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
871*5c1def83SBjoern A. Zeeb 	},
872*5c1def83SBjoern A. Zeeb };
873*5c1def83SBjoern A. Zeeb 
874*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_request_mem_ind_msg_v01_ei[] = {
875*5c1def83SBjoern A. Zeeb 	{
876*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
877*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
878*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
879*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
880*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
881*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_request_mem_ind_msg_v01,
882*5c1def83SBjoern A. Zeeb 					   mem_seg_len),
883*5c1def83SBjoern A. Zeeb 	},
884*5c1def83SBjoern A. Zeeb 	{
885*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
886*5c1def83SBjoern A. Zeeb 		.elem_len	= ATH12K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01,
887*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_mem_seg_s_v01),
888*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
889*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
890*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_request_mem_ind_msg_v01,
891*5c1def83SBjoern A. Zeeb 					   mem_seg),
892*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_mem_seg_s_v01_ei,
893*5c1def83SBjoern A. Zeeb 	},
894*5c1def83SBjoern A. Zeeb 	{
895*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
896*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
897*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
898*5c1def83SBjoern A. Zeeb 	},
899*5c1def83SBjoern A. Zeeb };
900*5c1def83SBjoern A. Zeeb 
901*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_mem_seg_resp_s_v01_ei[] = {
902*5c1def83SBjoern A. Zeeb 	{
903*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
904*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
905*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
906*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
907*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
908*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_resp_s_v01, addr),
909*5c1def83SBjoern A. Zeeb 	},
910*5c1def83SBjoern A. Zeeb 	{
911*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
912*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
913*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
914*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
915*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
916*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_resp_s_v01, size),
917*5c1def83SBjoern A. Zeeb 	},
918*5c1def83SBjoern A. Zeeb 	{
919*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
920*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
921*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_mem_type_enum_v01),
922*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
923*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
924*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_resp_s_v01, type),
925*5c1def83SBjoern A. Zeeb 	},
926*5c1def83SBjoern A. Zeeb 	{
927*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
928*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
929*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
930*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
931*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
932*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_mem_seg_resp_s_v01, restore),
933*5c1def83SBjoern A. Zeeb 	},
934*5c1def83SBjoern A. Zeeb 	{
935*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
936*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
937*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
938*5c1def83SBjoern A. Zeeb 	},
939*5c1def83SBjoern A. Zeeb };
940*5c1def83SBjoern A. Zeeb 
941*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_respond_mem_req_msg_v01_ei[] = {
942*5c1def83SBjoern A. Zeeb 	{
943*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
944*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
945*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
946*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
947*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
948*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_respond_mem_req_msg_v01,
949*5c1def83SBjoern A. Zeeb 					   mem_seg_len),
950*5c1def83SBjoern A. Zeeb 	},
951*5c1def83SBjoern A. Zeeb 	{
952*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
953*5c1def83SBjoern A. Zeeb 		.elem_len	= ATH12K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01,
954*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_mem_seg_resp_s_v01),
955*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
956*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
957*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_respond_mem_req_msg_v01,
958*5c1def83SBjoern A. Zeeb 					   mem_seg),
959*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_mem_seg_resp_s_v01_ei,
960*5c1def83SBjoern A. Zeeb 	},
961*5c1def83SBjoern A. Zeeb 	{
962*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
963*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
964*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
965*5c1def83SBjoern A. Zeeb 	},
966*5c1def83SBjoern A. Zeeb };
967*5c1def83SBjoern A. Zeeb 
968*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_respond_mem_resp_msg_v01_ei[] = {
969*5c1def83SBjoern A. Zeeb 	{
970*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
971*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
972*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
973*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
974*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
975*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_respond_mem_resp_msg_v01,
976*5c1def83SBjoern A. Zeeb 					   resp),
977*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
978*5c1def83SBjoern A. Zeeb 	},
979*5c1def83SBjoern A. Zeeb 	{
980*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
981*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
982*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
983*5c1def83SBjoern A. Zeeb 	},
984*5c1def83SBjoern A. Zeeb };
985*5c1def83SBjoern A. Zeeb 
986*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_cap_req_msg_v01_ei[] = {
987*5c1def83SBjoern A. Zeeb 	{
988*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
989*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
990*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
991*5c1def83SBjoern A. Zeeb 	},
992*5c1def83SBjoern A. Zeeb };
993*5c1def83SBjoern A. Zeeb 
994*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_rf_chip_info_s_v01_ei[] = {
995*5c1def83SBjoern A. Zeeb 	{
996*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
997*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
998*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
999*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1000*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1001*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_rf_chip_info_s_v01,
1002*5c1def83SBjoern A. Zeeb 					   chip_id),
1003*5c1def83SBjoern A. Zeeb 	},
1004*5c1def83SBjoern A. Zeeb 	{
1005*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1006*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1007*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1008*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1009*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1010*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_rf_chip_info_s_v01,
1011*5c1def83SBjoern A. Zeeb 					   chip_family),
1012*5c1def83SBjoern A. Zeeb 	},
1013*5c1def83SBjoern A. Zeeb 	{
1014*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1015*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1016*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1017*5c1def83SBjoern A. Zeeb 	},
1018*5c1def83SBjoern A. Zeeb };
1019*5c1def83SBjoern A. Zeeb 
1020*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_rf_board_info_s_v01_ei[] = {
1021*5c1def83SBjoern A. Zeeb 	{
1022*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1023*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1024*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1025*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1026*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1027*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_rf_board_info_s_v01,
1028*5c1def83SBjoern A. Zeeb 					   board_id),
1029*5c1def83SBjoern A. Zeeb 	},
1030*5c1def83SBjoern A. Zeeb 	{
1031*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1032*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1033*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1034*5c1def83SBjoern A. Zeeb 	},
1035*5c1def83SBjoern A. Zeeb };
1036*5c1def83SBjoern A. Zeeb 
1037*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_soc_info_s_v01_ei[] = {
1038*5c1def83SBjoern A. Zeeb 	{
1039*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1040*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1041*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1042*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1043*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1044*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_soc_info_s_v01, soc_id),
1045*5c1def83SBjoern A. Zeeb 	},
1046*5c1def83SBjoern A. Zeeb 	{
1047*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1048*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1049*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1050*5c1def83SBjoern A. Zeeb 	},
1051*5c1def83SBjoern A. Zeeb };
1052*5c1def83SBjoern A. Zeeb 
1053*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_dev_mem_info_s_v01_ei[] = {
1054*5c1def83SBjoern A. Zeeb 	{
1055*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
1056*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1057*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
1058*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1059*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1060*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_dev_mem_info_s_v01,
1061*5c1def83SBjoern A. Zeeb 					   start),
1062*5c1def83SBjoern A. Zeeb 	},
1063*5c1def83SBjoern A. Zeeb 	{
1064*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
1065*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1066*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
1067*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1068*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1069*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_dev_mem_info_s_v01,
1070*5c1def83SBjoern A. Zeeb 					   size),
1071*5c1def83SBjoern A. Zeeb 	},
1072*5c1def83SBjoern A. Zeeb 	{
1073*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1074*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1075*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1076*5c1def83SBjoern A. Zeeb 	},
1077*5c1def83SBjoern A. Zeeb };
1078*5c1def83SBjoern A. Zeeb 
1079*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_fw_version_info_s_v01_ei[] = {
1080*5c1def83SBjoern A. Zeeb 	{
1081*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1082*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1083*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1084*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1085*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1086*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_fw_version_info_s_v01,
1087*5c1def83SBjoern A. Zeeb 					   fw_version),
1088*5c1def83SBjoern A. Zeeb 	},
1089*5c1def83SBjoern A. Zeeb 	{
1090*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRING,
1091*5c1def83SBjoern A. Zeeb 		.elem_len	= ATH12K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 + 1,
1092*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(char),
1093*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1094*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1095*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_fw_version_info_s_v01,
1096*5c1def83SBjoern A. Zeeb 					   fw_build_timestamp),
1097*5c1def83SBjoern A. Zeeb 	},
1098*5c1def83SBjoern A. Zeeb 	{
1099*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1100*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1101*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1102*5c1def83SBjoern A. Zeeb 	},
1103*5c1def83SBjoern A. Zeeb };
1104*5c1def83SBjoern A. Zeeb 
1105*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_cap_resp_msg_v01_ei[] = {
1106*5c1def83SBjoern A. Zeeb 	{
1107*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1108*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1109*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
1110*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1111*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1112*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01, resp),
1113*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
1114*5c1def83SBjoern A. Zeeb 	},
1115*5c1def83SBjoern A. Zeeb 	{
1116*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1117*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1118*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1119*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1120*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1121*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1122*5c1def83SBjoern A. Zeeb 					   chip_info_valid),
1123*5c1def83SBjoern A. Zeeb 	},
1124*5c1def83SBjoern A. Zeeb 	{
1125*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1126*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1127*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_rf_chip_info_s_v01),
1128*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1129*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1130*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1131*5c1def83SBjoern A. Zeeb 					   chip_info),
1132*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_rf_chip_info_s_v01_ei,
1133*5c1def83SBjoern A. Zeeb 	},
1134*5c1def83SBjoern A. Zeeb 	{
1135*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1136*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1137*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1138*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1139*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1140*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1141*5c1def83SBjoern A. Zeeb 					   board_info_valid),
1142*5c1def83SBjoern A. Zeeb 	},
1143*5c1def83SBjoern A. Zeeb 	{
1144*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1145*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1146*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_rf_board_info_s_v01),
1147*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1148*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1149*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1150*5c1def83SBjoern A. Zeeb 					   board_info),
1151*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_rf_board_info_s_v01_ei,
1152*5c1def83SBjoern A. Zeeb 	},
1153*5c1def83SBjoern A. Zeeb 	{
1154*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1155*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1156*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1157*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1158*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1159*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1160*5c1def83SBjoern A. Zeeb 					   soc_info_valid),
1161*5c1def83SBjoern A. Zeeb 	},
1162*5c1def83SBjoern A. Zeeb 	{
1163*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1164*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1165*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_soc_info_s_v01),
1166*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1167*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1168*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1169*5c1def83SBjoern A. Zeeb 					   soc_info),
1170*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_soc_info_s_v01_ei,
1171*5c1def83SBjoern A. Zeeb 	},
1172*5c1def83SBjoern A. Zeeb 	{
1173*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1174*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1175*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1176*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1177*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1178*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1179*5c1def83SBjoern A. Zeeb 					   fw_version_info_valid),
1180*5c1def83SBjoern A. Zeeb 	},
1181*5c1def83SBjoern A. Zeeb 	{
1182*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1183*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1184*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_fw_version_info_s_v01),
1185*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1186*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1187*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1188*5c1def83SBjoern A. Zeeb 					   fw_version_info),
1189*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_fw_version_info_s_v01_ei,
1190*5c1def83SBjoern A. Zeeb 	},
1191*5c1def83SBjoern A. Zeeb 	{
1192*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1193*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1194*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1195*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1196*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
1197*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1198*5c1def83SBjoern A. Zeeb 					   fw_build_id_valid),
1199*5c1def83SBjoern A. Zeeb 	},
1200*5c1def83SBjoern A. Zeeb 	{
1201*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRING,
1202*5c1def83SBjoern A. Zeeb 		.elem_len	= ATH12K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 + 1,
1203*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(char),
1204*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1205*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
1206*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1207*5c1def83SBjoern A. Zeeb 					   fw_build_id),
1208*5c1def83SBjoern A. Zeeb 	},
1209*5c1def83SBjoern A. Zeeb 	{
1210*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1211*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1212*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1213*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1214*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
1215*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1216*5c1def83SBjoern A. Zeeb 					   num_macs_valid),
1217*5c1def83SBjoern A. Zeeb 	},
1218*5c1def83SBjoern A. Zeeb 	{
1219*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1220*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1221*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1222*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1223*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
1224*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1225*5c1def83SBjoern A. Zeeb 					   num_macs),
1226*5c1def83SBjoern A. Zeeb 	},
1227*5c1def83SBjoern A. Zeeb 	{
1228*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1229*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1230*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1231*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1232*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
1233*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1234*5c1def83SBjoern A. Zeeb 					   voltage_mv_valid),
1235*5c1def83SBjoern A. Zeeb 	},
1236*5c1def83SBjoern A. Zeeb 	{
1237*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1238*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1239*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1240*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1241*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x16,
1242*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1243*5c1def83SBjoern A. Zeeb 					   voltage_mv),
1244*5c1def83SBjoern A. Zeeb 	},
1245*5c1def83SBjoern A. Zeeb 	{
1246*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1247*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1248*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1249*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1250*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
1251*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1252*5c1def83SBjoern A. Zeeb 					   time_freq_hz_valid),
1253*5c1def83SBjoern A. Zeeb 	},
1254*5c1def83SBjoern A. Zeeb 	{
1255*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1256*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1257*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1258*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1259*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
1260*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1261*5c1def83SBjoern A. Zeeb 					   time_freq_hz),
1262*5c1def83SBjoern A. Zeeb 	},
1263*5c1def83SBjoern A. Zeeb 	{
1264*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1265*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1266*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1267*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1268*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
1269*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1270*5c1def83SBjoern A. Zeeb 					   otp_version_valid),
1271*5c1def83SBjoern A. Zeeb 	},
1272*5c1def83SBjoern A. Zeeb 	{
1273*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1274*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1275*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1276*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1277*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x18,
1278*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1279*5c1def83SBjoern A. Zeeb 					   otp_version),
1280*5c1def83SBjoern A. Zeeb 	},
1281*5c1def83SBjoern A. Zeeb 	{
1282*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1283*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1284*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1285*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1286*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
1287*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1288*5c1def83SBjoern A. Zeeb 					   eeprom_caldata_read_timeout_valid),
1289*5c1def83SBjoern A. Zeeb 	},
1290*5c1def83SBjoern A. Zeeb 	{
1291*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1292*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1293*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1294*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1295*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x19,
1296*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1297*5c1def83SBjoern A. Zeeb 					   eeprom_caldata_read_timeout),
1298*5c1def83SBjoern A. Zeeb 	},
1299*5c1def83SBjoern A. Zeeb 	{
1300*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1301*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1302*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1303*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1304*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
1305*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1306*5c1def83SBjoern A. Zeeb 					   fw_caps_valid),
1307*5c1def83SBjoern A. Zeeb 	},
1308*5c1def83SBjoern A. Zeeb 	{
1309*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
1310*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1311*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
1312*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1313*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1A,
1314*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01, fw_caps),
1315*5c1def83SBjoern A. Zeeb 	},
1316*5c1def83SBjoern A. Zeeb 	{
1317*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1318*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1319*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1320*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1321*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
1322*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1323*5c1def83SBjoern A. Zeeb 					   rd_card_chain_cap_valid),
1324*5c1def83SBjoern A. Zeeb 	},
1325*5c1def83SBjoern A. Zeeb 	{
1326*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1327*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1328*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1329*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1330*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1B,
1331*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1332*5c1def83SBjoern A. Zeeb 					   rd_card_chain_cap),
1333*5c1def83SBjoern A. Zeeb 	},
1334*5c1def83SBjoern A. Zeeb 	{
1335*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1336*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1337*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1338*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1339*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1C,
1340*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01,
1341*5c1def83SBjoern A. Zeeb 					   dev_mem_info_valid),
1342*5c1def83SBjoern A. Zeeb 	},
1343*5c1def83SBjoern A. Zeeb 	{
1344*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1345*5c1def83SBjoern A. Zeeb 		.elem_len	= ATH12K_QMI_WLFW_MAX_DEV_MEM_NUM_V01,
1346*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_dev_mem_info_s_v01),
1347*5c1def83SBjoern A. Zeeb 		.array_type	= STATIC_ARRAY,
1348*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x1C,
1349*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_cap_resp_msg_v01, dev_mem),
1350*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_dev_mem_info_s_v01_ei,
1351*5c1def83SBjoern A. Zeeb 	},
1352*5c1def83SBjoern A. Zeeb 	{
1353*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1354*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1355*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1356*5c1def83SBjoern A. Zeeb 	},
1357*5c1def83SBjoern A. Zeeb };
1358*5c1def83SBjoern A. Zeeb 
1359*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_bdf_download_req_msg_v01_ei[] = {
1360*5c1def83SBjoern A. Zeeb 	{
1361*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1362*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1363*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1364*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1365*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
1366*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1367*5c1def83SBjoern A. Zeeb 					   valid),
1368*5c1def83SBjoern A. Zeeb 	},
1369*5c1def83SBjoern A. Zeeb 	{
1370*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1371*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1372*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1373*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1374*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1375*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1376*5c1def83SBjoern A. Zeeb 					   file_id_valid),
1377*5c1def83SBjoern A. Zeeb 	},
1378*5c1def83SBjoern A. Zeeb 	{
1379*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
1380*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1381*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_cal_temp_id_enum_v01),
1382*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1383*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1384*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1385*5c1def83SBjoern A. Zeeb 					   file_id),
1386*5c1def83SBjoern A. Zeeb 	},
1387*5c1def83SBjoern A. Zeeb 	{
1388*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1389*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1390*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1391*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1392*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1393*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1394*5c1def83SBjoern A. Zeeb 					   total_size_valid),
1395*5c1def83SBjoern A. Zeeb 	},
1396*5c1def83SBjoern A. Zeeb 	{
1397*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1398*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1399*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1400*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1401*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1402*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1403*5c1def83SBjoern A. Zeeb 					   total_size),
1404*5c1def83SBjoern A. Zeeb 	},
1405*5c1def83SBjoern A. Zeeb 	{
1406*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1407*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1408*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1409*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1410*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1411*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1412*5c1def83SBjoern A. Zeeb 					   seg_id_valid),
1413*5c1def83SBjoern A. Zeeb 	},
1414*5c1def83SBjoern A. Zeeb 	{
1415*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1416*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1417*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1418*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1419*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1420*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1421*5c1def83SBjoern A. Zeeb 					   seg_id),
1422*5c1def83SBjoern A. Zeeb 	},
1423*5c1def83SBjoern A. Zeeb 	{
1424*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1425*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1426*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1427*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1428*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1429*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1430*5c1def83SBjoern A. Zeeb 					   data_valid),
1431*5c1def83SBjoern A. Zeeb 	},
1432*5c1def83SBjoern A. Zeeb 	{
1433*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
1434*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1435*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
1436*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1437*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1438*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1439*5c1def83SBjoern A. Zeeb 					   data_len),
1440*5c1def83SBjoern A. Zeeb 	},
1441*5c1def83SBjoern A. Zeeb 	{
1442*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1443*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_DATA_SIZE_V01,
1444*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1445*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
1446*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1447*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1448*5c1def83SBjoern A. Zeeb 					   data),
1449*5c1def83SBjoern A. Zeeb 	},
1450*5c1def83SBjoern A. Zeeb 	{
1451*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1452*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1453*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1454*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1455*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
1456*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1457*5c1def83SBjoern A. Zeeb 					   end_valid),
1458*5c1def83SBjoern A. Zeeb 	},
1459*5c1def83SBjoern A. Zeeb 	{
1460*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1461*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1462*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1463*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1464*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x14,
1465*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1466*5c1def83SBjoern A. Zeeb 					   end),
1467*5c1def83SBjoern A. Zeeb 	},
1468*5c1def83SBjoern A. Zeeb 	{
1469*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1470*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1471*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1472*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1473*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
1474*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1475*5c1def83SBjoern A. Zeeb 					   bdf_type_valid),
1476*5c1def83SBjoern A. Zeeb 	},
1477*5c1def83SBjoern A. Zeeb 	{
1478*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1479*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1480*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1481*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1482*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x15,
1483*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_req_msg_v01,
1484*5c1def83SBjoern A. Zeeb 					   bdf_type),
1485*5c1def83SBjoern A. Zeeb 	},
1486*5c1def83SBjoern A. Zeeb 
1487*5c1def83SBjoern A. Zeeb 	{
1488*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1489*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1490*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1491*5c1def83SBjoern A. Zeeb 	},
1492*5c1def83SBjoern A. Zeeb };
1493*5c1def83SBjoern A. Zeeb 
1494*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_bdf_download_resp_msg_v01_ei[] = {
1495*5c1def83SBjoern A. Zeeb 	{
1496*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1497*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1498*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
1499*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1500*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1501*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_bdf_download_resp_msg_v01,
1502*5c1def83SBjoern A. Zeeb 					   resp),
1503*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
1504*5c1def83SBjoern A. Zeeb 	},
1505*5c1def83SBjoern A. Zeeb 	{
1506*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1507*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1508*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1509*5c1def83SBjoern A. Zeeb 	},
1510*5c1def83SBjoern A. Zeeb };
1511*5c1def83SBjoern A. Zeeb 
1512*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_m3_info_req_msg_v01_ei[] = {
1513*5c1def83SBjoern A. Zeeb 	{
1514*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_8_BYTE,
1515*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1516*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u64),
1517*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1518*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
1519*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_m3_info_req_msg_v01, addr),
1520*5c1def83SBjoern A. Zeeb 	},
1521*5c1def83SBjoern A. Zeeb 	{
1522*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1523*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1524*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1525*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1526*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1527*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_m3_info_req_msg_v01, size),
1528*5c1def83SBjoern A. Zeeb 	},
1529*5c1def83SBjoern A. Zeeb 	{
1530*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1531*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1532*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1533*5c1def83SBjoern A. Zeeb 	},
1534*5c1def83SBjoern A. Zeeb };
1535*5c1def83SBjoern A. Zeeb 
1536*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_m3_info_resp_msg_v01_ei[] = {
1537*5c1def83SBjoern A. Zeeb 	{
1538*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1539*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1540*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
1541*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1542*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1543*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_m3_info_resp_msg_v01, resp),
1544*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
1545*5c1def83SBjoern A. Zeeb 	},
1546*5c1def83SBjoern A. Zeeb 	{
1547*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1548*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1549*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1550*5c1def83SBjoern A. Zeeb 	},
1551*5c1def83SBjoern A. Zeeb };
1552*5c1def83SBjoern A. Zeeb 
1553*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_ce_tgt_pipe_cfg_s_v01_ei[] = {
1554*5c1def83SBjoern A. Zeeb 	{
1555*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1556*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1557*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1558*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1559*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1560*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01,
1561*5c1def83SBjoern A. Zeeb 					   pipe_num),
1562*5c1def83SBjoern A. Zeeb 	},
1563*5c1def83SBjoern A. Zeeb 	{
1564*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
1565*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1566*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_pipedir_enum_v01),
1567*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1568*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1569*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01,
1570*5c1def83SBjoern A. Zeeb 					   pipe_dir),
1571*5c1def83SBjoern A. Zeeb 	},
1572*5c1def83SBjoern A. Zeeb 	{
1573*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1574*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1575*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1576*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1577*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1578*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01,
1579*5c1def83SBjoern A. Zeeb 					   nentries),
1580*5c1def83SBjoern A. Zeeb 	},
1581*5c1def83SBjoern A. Zeeb 	{
1582*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1583*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1584*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1585*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1586*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1587*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01,
1588*5c1def83SBjoern A. Zeeb 					   nbytes_max),
1589*5c1def83SBjoern A. Zeeb 	},
1590*5c1def83SBjoern A. Zeeb 	{
1591*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1592*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1593*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1594*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1595*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1596*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01,
1597*5c1def83SBjoern A. Zeeb 					   flags),
1598*5c1def83SBjoern A. Zeeb 	},
1599*5c1def83SBjoern A. Zeeb 	{
1600*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1601*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1602*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1603*5c1def83SBjoern A. Zeeb 	},
1604*5c1def83SBjoern A. Zeeb };
1605*5c1def83SBjoern A. Zeeb 
1606*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_ce_svc_pipe_cfg_s_v01_ei[] = {
1607*5c1def83SBjoern A. Zeeb 	{
1608*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1609*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1610*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1611*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1612*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1613*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_svc_pipe_cfg_s_v01,
1614*5c1def83SBjoern A. Zeeb 					   service_id),
1615*5c1def83SBjoern A. Zeeb 	},
1616*5c1def83SBjoern A. Zeeb 	{
1617*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_SIGNED_4_BYTE_ENUM,
1618*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1619*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(enum qmi_wlanfw_pipedir_enum_v01),
1620*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1621*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1622*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_svc_pipe_cfg_s_v01,
1623*5c1def83SBjoern A. Zeeb 					   pipe_dir),
1624*5c1def83SBjoern A. Zeeb 	},
1625*5c1def83SBjoern A. Zeeb 	{
1626*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1627*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1628*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1629*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1630*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1631*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_ce_svc_pipe_cfg_s_v01,
1632*5c1def83SBjoern A. Zeeb 					   pipe_num),
1633*5c1def83SBjoern A. Zeeb 	},
1634*5c1def83SBjoern A. Zeeb 	{
1635*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1636*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1637*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1638*5c1def83SBjoern A. Zeeb 	},
1639*5c1def83SBjoern A. Zeeb };
1640*5c1def83SBjoern A. Zeeb 
1641*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_shadow_reg_cfg_s_v01_ei[] = {
1642*5c1def83SBjoern A. Zeeb 	{
1643*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_2_BYTE,
1644*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1645*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
1646*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1647*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1648*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_shadow_reg_cfg_s_v01, id),
1649*5c1def83SBjoern A. Zeeb 	},
1650*5c1def83SBjoern A. Zeeb 	{
1651*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_2_BYTE,
1652*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1653*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u16),
1654*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1655*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1656*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_shadow_reg_cfg_s_v01,
1657*5c1def83SBjoern A. Zeeb 					   offset),
1658*5c1def83SBjoern A. Zeeb 	},
1659*5c1def83SBjoern A. Zeeb 	{
1660*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1661*5c1def83SBjoern A. Zeeb 		.array_type	= QMI_COMMON_TLV_TYPE,
1662*5c1def83SBjoern A. Zeeb 	},
1663*5c1def83SBjoern A. Zeeb };
1664*5c1def83SBjoern A. Zeeb 
1665*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_shadow_reg_v3_cfg_s_v01_ei[] = {
1666*5c1def83SBjoern A. Zeeb 	{
1667*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1668*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1669*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1670*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1671*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0,
1672*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_shadow_reg_v3_cfg_s_v01,
1673*5c1def83SBjoern A. Zeeb 					   addr),
1674*5c1def83SBjoern A. Zeeb 	},
1675*5c1def83SBjoern A. Zeeb 	{
1676*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1677*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1678*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1679*5c1def83SBjoern A. Zeeb 	},
1680*5c1def83SBjoern A. Zeeb };
1681*5c1def83SBjoern A. Zeeb 
1682*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_wlan_mode_req_msg_v01_ei[] = {
1683*5c1def83SBjoern A. Zeeb 	{
1684*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_4_BYTE,
1685*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1686*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u32),
1687*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1688*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x01,
1689*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_mode_req_msg_v01,
1690*5c1def83SBjoern A. Zeeb 					   mode),
1691*5c1def83SBjoern A. Zeeb 	},
1692*5c1def83SBjoern A. Zeeb 	{
1693*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1694*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1695*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1696*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1697*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1698*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_mode_req_msg_v01,
1699*5c1def83SBjoern A. Zeeb 					   hw_debug_valid),
1700*5c1def83SBjoern A. Zeeb 	},
1701*5c1def83SBjoern A. Zeeb 	{
1702*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_UNSIGNED_1_BYTE,
1703*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1704*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1705*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1706*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1707*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_mode_req_msg_v01,
1708*5c1def83SBjoern A. Zeeb 					   hw_debug),
1709*5c1def83SBjoern A. Zeeb 	},
1710*5c1def83SBjoern A. Zeeb 	{
1711*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1712*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1713*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1714*5c1def83SBjoern A. Zeeb 	},
1715*5c1def83SBjoern A. Zeeb };
1716*5c1def83SBjoern A. Zeeb 
1717*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_wlan_mode_resp_msg_v01_ei[] = {
1718*5c1def83SBjoern A. Zeeb 	{
1719*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1720*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1721*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
1722*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1723*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1724*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_mode_resp_msg_v01,
1725*5c1def83SBjoern A. Zeeb 					   resp),
1726*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
1727*5c1def83SBjoern A. Zeeb 	},
1728*5c1def83SBjoern A. Zeeb 	{
1729*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1730*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1731*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1732*5c1def83SBjoern A. Zeeb 	},
1733*5c1def83SBjoern A. Zeeb };
1734*5c1def83SBjoern A. Zeeb 
1735*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_wlan_cfg_req_msg_v01_ei[] = {
1736*5c1def83SBjoern A. Zeeb 	{
1737*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1738*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1739*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1740*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1741*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1742*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1743*5c1def83SBjoern A. Zeeb 					   host_version_valid),
1744*5c1def83SBjoern A. Zeeb 	},
1745*5c1def83SBjoern A. Zeeb 	{
1746*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRING,
1747*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_STR_LEN_V01 + 1,
1748*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(char),
1749*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1750*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x10,
1751*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1752*5c1def83SBjoern A. Zeeb 					   host_version),
1753*5c1def83SBjoern A. Zeeb 	},
1754*5c1def83SBjoern A. Zeeb 	{
1755*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1756*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1757*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1758*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1759*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1760*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1761*5c1def83SBjoern A. Zeeb 					   tgt_cfg_valid),
1762*5c1def83SBjoern A. Zeeb 	},
1763*5c1def83SBjoern A. Zeeb 	{
1764*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
1765*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1766*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1767*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1768*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1769*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1770*5c1def83SBjoern A. Zeeb 					   tgt_cfg_len),
1771*5c1def83SBjoern A. Zeeb 	},
1772*5c1def83SBjoern A. Zeeb 	{
1773*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1774*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_NUM_CE_V01,
1775*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_ce_tgt_pipe_cfg_s_v01),
1776*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
1777*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x11,
1778*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1779*5c1def83SBjoern A. Zeeb 					   tgt_cfg),
1780*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_ce_tgt_pipe_cfg_s_v01_ei,
1781*5c1def83SBjoern A. Zeeb 	},
1782*5c1def83SBjoern A. Zeeb 	{
1783*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1784*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1785*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1786*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1787*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1788*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1789*5c1def83SBjoern A. Zeeb 					   svc_cfg_valid),
1790*5c1def83SBjoern A. Zeeb 	},
1791*5c1def83SBjoern A. Zeeb 	{
1792*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
1793*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1794*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1795*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1796*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1797*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1798*5c1def83SBjoern A. Zeeb 					   svc_cfg_len),
1799*5c1def83SBjoern A. Zeeb 	},
1800*5c1def83SBjoern A. Zeeb 	{
1801*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1802*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_NUM_SVC_V01,
1803*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_ce_svc_pipe_cfg_s_v01),
1804*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
1805*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x12,
1806*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1807*5c1def83SBjoern A. Zeeb 					   svc_cfg),
1808*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_ce_svc_pipe_cfg_s_v01_ei,
1809*5c1def83SBjoern A. Zeeb 	},
1810*5c1def83SBjoern A. Zeeb 	{
1811*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1812*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1813*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1814*5c1def83SBjoern A. Zeeb 		.array_type = NO_ARRAY,
1815*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1816*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1817*5c1def83SBjoern A. Zeeb 					   shadow_reg_valid),
1818*5c1def83SBjoern A. Zeeb 	},
1819*5c1def83SBjoern A. Zeeb 	{
1820*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
1821*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1822*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1823*5c1def83SBjoern A. Zeeb 		.array_type = NO_ARRAY,
1824*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1825*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1826*5c1def83SBjoern A. Zeeb 					   shadow_reg_len),
1827*5c1def83SBjoern A. Zeeb 	},
1828*5c1def83SBjoern A. Zeeb 	{
1829*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1830*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_NUM_SHADOW_REG_V01,
1831*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_shadow_reg_cfg_s_v01),
1832*5c1def83SBjoern A. Zeeb 		.array_type = VAR_LEN_ARRAY,
1833*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x13,
1834*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1835*5c1def83SBjoern A. Zeeb 					   shadow_reg),
1836*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_shadow_reg_cfg_s_v01_ei,
1837*5c1def83SBjoern A. Zeeb 	},
1838*5c1def83SBjoern A. Zeeb 	{
1839*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_OPT_FLAG,
1840*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1841*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1842*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1843*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
1844*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1845*5c1def83SBjoern A. Zeeb 					   shadow_reg_v3_valid),
1846*5c1def83SBjoern A. Zeeb 	},
1847*5c1def83SBjoern A. Zeeb 	{
1848*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_DATA_LEN,
1849*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1850*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(u8),
1851*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1852*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
1853*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1854*5c1def83SBjoern A. Zeeb 					   shadow_reg_v3_len),
1855*5c1def83SBjoern A. Zeeb 	},
1856*5c1def83SBjoern A. Zeeb 	{
1857*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1858*5c1def83SBjoern A. Zeeb 		.elem_len	= QMI_WLANFW_MAX_NUM_SHADOW_REG_V3_V01,
1859*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_wlanfw_shadow_reg_v3_cfg_s_v01),
1860*5c1def83SBjoern A. Zeeb 		.array_type	= VAR_LEN_ARRAY,
1861*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x17,
1862*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_req_msg_v01,
1863*5c1def83SBjoern A. Zeeb 					   shadow_reg_v3),
1864*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_wlanfw_shadow_reg_v3_cfg_s_v01_ei,
1865*5c1def83SBjoern A. Zeeb 	},
1866*5c1def83SBjoern A. Zeeb 	{
1867*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1868*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1869*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1870*5c1def83SBjoern A. Zeeb 	},
1871*5c1def83SBjoern A. Zeeb };
1872*5c1def83SBjoern A. Zeeb 
1873*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_wlan_cfg_resp_msg_v01_ei[] = {
1874*5c1def83SBjoern A. Zeeb 	{
1875*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_STRUCT,
1876*5c1def83SBjoern A. Zeeb 		.elem_len	= 1,
1877*5c1def83SBjoern A. Zeeb 		.elem_size	= sizeof(struct qmi_response_type_v01),
1878*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1879*5c1def83SBjoern A. Zeeb 		.tlv_type	= 0x02,
1880*5c1def83SBjoern A. Zeeb 		.offset		= offsetof(struct qmi_wlanfw_wlan_cfg_resp_msg_v01, resp),
1881*5c1def83SBjoern A. Zeeb 		.ei_array	= qmi_response_type_v01_ei,
1882*5c1def83SBjoern A. Zeeb 	},
1883*5c1def83SBjoern A. Zeeb 	{
1884*5c1def83SBjoern A. Zeeb 		.data_type	= QMI_EOTI,
1885*5c1def83SBjoern A. Zeeb 		.array_type	= NO_ARRAY,
1886*5c1def83SBjoern A. Zeeb 		.tlv_type	= QMI_COMMON_TLV_TYPE,
1887*5c1def83SBjoern A. Zeeb 	},
1888*5c1def83SBjoern A. Zeeb };
1889*5c1def83SBjoern A. Zeeb 
1890*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_mem_ready_ind_msg_v01_ei[] = {
1891*5c1def83SBjoern A. Zeeb 	{
1892*5c1def83SBjoern A. Zeeb 		.data_type = QMI_EOTI,
1893*5c1def83SBjoern A. Zeeb 		.array_type = NO_ARRAY,
1894*5c1def83SBjoern A. Zeeb 	},
1895*5c1def83SBjoern A. Zeeb };
1896*5c1def83SBjoern A. Zeeb 
1897*5c1def83SBjoern A. Zeeb static struct qmi_elem_info qmi_wlanfw_fw_ready_ind_msg_v01_ei[] = {
1898*5c1def83SBjoern A. Zeeb 	{
1899*5c1def83SBjoern A. Zeeb 		.data_type = QMI_EOTI,
1900*5c1def83SBjoern A. Zeeb 		.array_type = NO_ARRAY,
1901*5c1def83SBjoern A. Zeeb 	},
1902*5c1def83SBjoern A. Zeeb };
1903*5c1def83SBjoern A. Zeeb 
ath12k_host_cap_parse_mlo(struct qmi_wlanfw_host_cap_req_msg_v01 * req)1904*5c1def83SBjoern A. Zeeb static void ath12k_host_cap_parse_mlo(struct qmi_wlanfw_host_cap_req_msg_v01 *req)
1905*5c1def83SBjoern A. Zeeb {
1906*5c1def83SBjoern A. Zeeb 	req->mlo_capable_valid = 1;
1907*5c1def83SBjoern A. Zeeb 	req->mlo_capable = 1;
1908*5c1def83SBjoern A. Zeeb 	req->mlo_chip_id_valid = 1;
1909*5c1def83SBjoern A. Zeeb 	req->mlo_chip_id = 0;
1910*5c1def83SBjoern A. Zeeb 	req->mlo_group_id_valid = 1;
1911*5c1def83SBjoern A. Zeeb 	req->mlo_group_id = 0;
1912*5c1def83SBjoern A. Zeeb 	req->max_mlo_peer_valid = 1;
1913*5c1def83SBjoern A. Zeeb 	/* Max peer number generally won't change for the same device
1914*5c1def83SBjoern A. Zeeb 	 * but needs to be synced with host driver.
1915*5c1def83SBjoern A. Zeeb 	 */
1916*5c1def83SBjoern A. Zeeb 	req->max_mlo_peer = 32;
1917*5c1def83SBjoern A. Zeeb 	req->mlo_num_chips_valid = 1;
1918*5c1def83SBjoern A. Zeeb 	req->mlo_num_chips = 1;
1919*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info_valid = 1;
1920*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].chip_id = 0;
1921*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].num_local_links = 2;
1922*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].hw_link_id[0] = 0;
1923*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].hw_link_id[1] = 1;
1924*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].valid_mlo_link_id[0] = 1;
1925*5c1def83SBjoern A. Zeeb 	req->mlo_chip_info[0].valid_mlo_link_id[1] = 1;
1926*5c1def83SBjoern A. Zeeb }
1927*5c1def83SBjoern A. Zeeb 
ath12k_qmi_host_cap_send(struct ath12k_base * ab)1928*5c1def83SBjoern A. Zeeb static int ath12k_qmi_host_cap_send(struct ath12k_base *ab)
1929*5c1def83SBjoern A. Zeeb {
1930*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_host_cap_req_msg_v01 req;
1931*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_host_cap_resp_msg_v01 resp;
1932*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
1933*5c1def83SBjoern A. Zeeb 	int ret = 0;
1934*5c1def83SBjoern A. Zeeb 
1935*5c1def83SBjoern A. Zeeb 	memset(&req, 0, sizeof(req));
1936*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
1937*5c1def83SBjoern A. Zeeb 
1938*5c1def83SBjoern A. Zeeb 	req.num_clients_valid = 1;
1939*5c1def83SBjoern A. Zeeb 	req.num_clients = 1;
1940*5c1def83SBjoern A. Zeeb 	req.mem_cfg_mode = ab->qmi.target_mem_mode;
1941*5c1def83SBjoern A. Zeeb 	req.mem_cfg_mode_valid = 1;
1942*5c1def83SBjoern A. Zeeb 	req.bdf_support_valid = 1;
1943*5c1def83SBjoern A. Zeeb 	req.bdf_support = 1;
1944*5c1def83SBjoern A. Zeeb 
1945*5c1def83SBjoern A. Zeeb 	req.m3_support_valid = 1;
1946*5c1def83SBjoern A. Zeeb 	req.m3_support = 1;
1947*5c1def83SBjoern A. Zeeb 	req.m3_cache_support_valid = 1;
1948*5c1def83SBjoern A. Zeeb 	req.m3_cache_support = 1;
1949*5c1def83SBjoern A. Zeeb 
1950*5c1def83SBjoern A. Zeeb 	req.cal_done_valid = 1;
1951*5c1def83SBjoern A. Zeeb 	req.cal_done = ab->qmi.cal_done;
1952*5c1def83SBjoern A. Zeeb 
1953*5c1def83SBjoern A. Zeeb 	if (ab->hw_params->qmi_cnss_feature_bitmap) {
1954*5c1def83SBjoern A. Zeeb 		req.feature_list_valid = 1;
1955*5c1def83SBjoern A. Zeeb 		req.feature_list = ab->hw_params->qmi_cnss_feature_bitmap;
1956*5c1def83SBjoern A. Zeeb 	}
1957*5c1def83SBjoern A. Zeeb 
1958*5c1def83SBjoern A. Zeeb 	/* BRINGUP: here we are piggybacking a lot of stuff using
1959*5c1def83SBjoern A. Zeeb 	 * internal_sleep_clock, should it be split?
1960*5c1def83SBjoern A. Zeeb 	 */
1961*5c1def83SBjoern A. Zeeb 	if (ab->hw_params->internal_sleep_clock) {
1962*5c1def83SBjoern A. Zeeb 		req.nm_modem_valid = 1;
1963*5c1def83SBjoern A. Zeeb 
1964*5c1def83SBjoern A. Zeeb 		/* Notify firmware that this is non-qualcomm platform. */
1965*5c1def83SBjoern A. Zeeb 		req.nm_modem |= HOST_CSTATE_BIT;
1966*5c1def83SBjoern A. Zeeb 
1967*5c1def83SBjoern A. Zeeb 		/* Notify firmware about the sleep clock selection,
1968*5c1def83SBjoern A. Zeeb 		 * nm_modem_bit[1] is used for this purpose. Host driver on
1969*5c1def83SBjoern A. Zeeb 		 * non-qualcomm platforms should select internal sleep
1970*5c1def83SBjoern A. Zeeb 		 * clock.
1971*5c1def83SBjoern A. Zeeb 		 */
1972*5c1def83SBjoern A. Zeeb 		req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT;
1973*5c1def83SBjoern A. Zeeb 		req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
1974*5c1def83SBjoern A. Zeeb 
1975*5c1def83SBjoern A. Zeeb 		ath12k_host_cap_parse_mlo(&req);
1976*5c1def83SBjoern A. Zeeb 	}
1977*5c1def83SBjoern A. Zeeb 
1978*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
1979*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp);
1980*5c1def83SBjoern A. Zeeb 	if (ret < 0)
1981*5c1def83SBjoern A. Zeeb 		goto out;
1982*5c1def83SBjoern A. Zeeb 
1983*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
1984*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_HOST_CAP_REQ_V01,
1985*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN,
1986*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_host_cap_req_msg_v01_ei, &req);
1987*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
1988*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Failed to send host capability request,err = %d\n", ret);
1989*5c1def83SBjoern A. Zeeb 		goto out;
1990*5c1def83SBjoern A. Zeeb 	}
1991*5c1def83SBjoern A. Zeeb 
1992*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
1993*5c1def83SBjoern A. Zeeb 	if (ret < 0)
1994*5c1def83SBjoern A. Zeeb 		goto out;
1995*5c1def83SBjoern A. Zeeb 
1996*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
1997*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Host capability request failed, result: %d, err: %d\n",
1998*5c1def83SBjoern A. Zeeb 			    resp.resp.result, resp.resp.error);
1999*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2000*5c1def83SBjoern A. Zeeb 		goto out;
2001*5c1def83SBjoern A. Zeeb 	}
2002*5c1def83SBjoern A. Zeeb 
2003*5c1def83SBjoern A. Zeeb out:
2004*5c1def83SBjoern A. Zeeb 	return ret;
2005*5c1def83SBjoern A. Zeeb }
2006*5c1def83SBjoern A. Zeeb 
ath12k_qmi_fw_ind_register_send(struct ath12k_base * ab)2007*5c1def83SBjoern A. Zeeb static int ath12k_qmi_fw_ind_register_send(struct ath12k_base *ab)
2008*5c1def83SBjoern A. Zeeb {
2009*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_ind_register_req_msg_v01 *req;
2010*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_ind_register_resp_msg_v01 *resp;
2011*5c1def83SBjoern A. Zeeb 	struct qmi_handle *handle = &ab->qmi.handle;
2012*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn;
2013*5c1def83SBjoern A. Zeeb 	int ret;
2014*5c1def83SBjoern A. Zeeb 
2015*5c1def83SBjoern A. Zeeb 	req = kzalloc(sizeof(*req), GFP_KERNEL);
2016*5c1def83SBjoern A. Zeeb 	if (!req)
2017*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2018*5c1def83SBjoern A. Zeeb 
2019*5c1def83SBjoern A. Zeeb 	resp = kzalloc(sizeof(*resp), GFP_KERNEL);
2020*5c1def83SBjoern A. Zeeb 	if (!resp) {
2021*5c1def83SBjoern A. Zeeb 		ret = -ENOMEM;
2022*5c1def83SBjoern A. Zeeb 		goto resp_out;
2023*5c1def83SBjoern A. Zeeb 	}
2024*5c1def83SBjoern A. Zeeb 
2025*5c1def83SBjoern A. Zeeb 	req->client_id_valid = 1;
2026*5c1def83SBjoern A. Zeeb 	req->client_id = QMI_WLANFW_CLIENT_ID;
2027*5c1def83SBjoern A. Zeeb 	req->fw_ready_enable_valid = 1;
2028*5c1def83SBjoern A. Zeeb 	req->fw_ready_enable = 1;
2029*5c1def83SBjoern A. Zeeb 	req->request_mem_enable_valid = 1;
2030*5c1def83SBjoern A. Zeeb 	req->request_mem_enable = 1;
2031*5c1def83SBjoern A. Zeeb 	req->fw_mem_ready_enable_valid = 1;
2032*5c1def83SBjoern A. Zeeb 	req->fw_mem_ready_enable = 1;
2033*5c1def83SBjoern A. Zeeb 	req->cal_done_enable_valid = 1;
2034*5c1def83SBjoern A. Zeeb 	req->cal_done_enable = 1;
2035*5c1def83SBjoern A. Zeeb 	req->fw_init_done_enable_valid = 1;
2036*5c1def83SBjoern A. Zeeb 	req->fw_init_done_enable = 1;
2037*5c1def83SBjoern A. Zeeb 
2038*5c1def83SBjoern A. Zeeb 	req->pin_connect_result_enable_valid = 0;
2039*5c1def83SBjoern A. Zeeb 	req->pin_connect_result_enable = 0;
2040*5c1def83SBjoern A. Zeeb 
2041*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(handle, &txn,
2042*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_ind_register_resp_msg_v01_ei, resp);
2043*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2044*5c1def83SBjoern A. Zeeb 		goto out;
2045*5c1def83SBjoern A. Zeeb 
2046*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2047*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_IND_REGISTER_REQ_V01,
2048*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_IND_REGISTER_REQ_MSG_V01_MAX_LEN,
2049*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_ind_register_req_msg_v01_ei, req);
2050*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2051*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Failed to send indication register request, err = %d\n",
2052*5c1def83SBjoern A. Zeeb 			    ret);
2053*5c1def83SBjoern A. Zeeb 		goto out;
2054*5c1def83SBjoern A. Zeeb 	}
2055*5c1def83SBjoern A. Zeeb 
2056*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2057*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2058*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "failed to register fw indication %d\n", ret);
2059*5c1def83SBjoern A. Zeeb 		goto out;
2060*5c1def83SBjoern A. Zeeb 	}
2061*5c1def83SBjoern A. Zeeb 
2062*5c1def83SBjoern A. Zeeb 	if (resp->resp.result != QMI_RESULT_SUCCESS_V01) {
2063*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "FW Ind register request failed, result: %d, err: %d\n",
2064*5c1def83SBjoern A. Zeeb 			    resp->resp.result, resp->resp.error);
2065*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2066*5c1def83SBjoern A. Zeeb 		goto out;
2067*5c1def83SBjoern A. Zeeb 	}
2068*5c1def83SBjoern A. Zeeb 
2069*5c1def83SBjoern A. Zeeb out:
2070*5c1def83SBjoern A. Zeeb 	kfree(resp);
2071*5c1def83SBjoern A. Zeeb resp_out:
2072*5c1def83SBjoern A. Zeeb 	kfree(req);
2073*5c1def83SBjoern A. Zeeb 	return ret;
2074*5c1def83SBjoern A. Zeeb }
2075*5c1def83SBjoern A. Zeeb 
ath12k_qmi_respond_fw_mem_request(struct ath12k_base * ab)2076*5c1def83SBjoern A. Zeeb static int ath12k_qmi_respond_fw_mem_request(struct ath12k_base *ab)
2077*5c1def83SBjoern A. Zeeb {
2078*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_respond_mem_req_msg_v01 *req;
2079*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_respond_mem_resp_msg_v01 resp;
2080*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2081*5c1def83SBjoern A. Zeeb 	int ret = 0, i;
2082*5c1def83SBjoern A. Zeeb 	bool delayed;
2083*5c1def83SBjoern A. Zeeb 
2084*5c1def83SBjoern A. Zeeb 	req = kzalloc(sizeof(*req), GFP_KERNEL);
2085*5c1def83SBjoern A. Zeeb 	if (!req)
2086*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2087*5c1def83SBjoern A. Zeeb 
2088*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2089*5c1def83SBjoern A. Zeeb 
2090*5c1def83SBjoern A. Zeeb 	/* Some targets by default request a block of big contiguous
2091*5c1def83SBjoern A. Zeeb 	 * DMA memory, it's hard to allocate from kernel. So host returns
2092*5c1def83SBjoern A. Zeeb 	 * failure to firmware and firmware then request multiple blocks of
2093*5c1def83SBjoern A. Zeeb 	 * small chunk size memory.
2094*5c1def83SBjoern A. Zeeb 	 */
2095*5c1def83SBjoern A. Zeeb 	if (ab->qmi.target_mem_delayed) {
2096*5c1def83SBjoern A. Zeeb 		delayed = true;
2097*5c1def83SBjoern A. Zeeb 		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi delays mem_request %d\n",
2098*5c1def83SBjoern A. Zeeb 			   ab->qmi.mem_seg_count);
2099*5c1def83SBjoern A. Zeeb 		memset(req, 0, sizeof(*req));
2100*5c1def83SBjoern A. Zeeb 	} else {
2101*5c1def83SBjoern A. Zeeb 		delayed = false;
2102*5c1def83SBjoern A. Zeeb 		req->mem_seg_len = ab->qmi.mem_seg_count;
2103*5c1def83SBjoern A. Zeeb 		for (i = 0; i < req->mem_seg_len ; i++) {
2104*5c1def83SBjoern A. Zeeb 			req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr;
2105*5c1def83SBjoern A. Zeeb 			req->mem_seg[i].size = ab->qmi.target_mem[i].size;
2106*5c1def83SBjoern A. Zeeb 			req->mem_seg[i].type = ab->qmi.target_mem[i].type;
2107*5c1def83SBjoern A. Zeeb 			ath12k_dbg(ab, ATH12K_DBG_QMI,
2108*5c1def83SBjoern A. Zeeb 				   "qmi req mem_seg[%d] %pad %u %u\n", i,
2109*5c1def83SBjoern A. Zeeb 				   &ab->qmi.target_mem[i].paddr,
2110*5c1def83SBjoern A. Zeeb 				   ab->qmi.target_mem[i].size,
2111*5c1def83SBjoern A. Zeeb 				   ab->qmi.target_mem[i].type);
2112*5c1def83SBjoern A. Zeeb 		}
2113*5c1def83SBjoern A. Zeeb 	}
2114*5c1def83SBjoern A. Zeeb 
2115*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
2116*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_respond_mem_resp_msg_v01_ei, &resp);
2117*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2118*5c1def83SBjoern A. Zeeb 		goto out;
2119*5c1def83SBjoern A. Zeeb 
2120*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2121*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_RESPOND_MEM_REQ_V01,
2122*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN,
2123*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_respond_mem_req_msg_v01_ei, req);
2124*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2125*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to respond memory request, err = %d\n",
2126*5c1def83SBjoern A. Zeeb 			    ret);
2127*5c1def83SBjoern A. Zeeb 		goto out;
2128*5c1def83SBjoern A. Zeeb 	}
2129*5c1def83SBjoern A. Zeeb 
2130*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2131*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2132*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed memory request, err = %d\n", ret);
2133*5c1def83SBjoern A. Zeeb 		goto out;
2134*5c1def83SBjoern A. Zeeb 	}
2135*5c1def83SBjoern A. Zeeb 
2136*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2137*5c1def83SBjoern A. Zeeb 		/* the error response is expected when
2138*5c1def83SBjoern A. Zeeb 		 * target_mem_delayed is true.
2139*5c1def83SBjoern A. Zeeb 		 */
2140*5c1def83SBjoern A. Zeeb 		if (delayed && resp.resp.error == 0)
2141*5c1def83SBjoern A. Zeeb 			goto out;
2142*5c1def83SBjoern A. Zeeb 
2143*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Respond mem req failed, result: %d, err: %d\n",
2144*5c1def83SBjoern A. Zeeb 			    resp.resp.result, resp.resp.error);
2145*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2146*5c1def83SBjoern A. Zeeb 		goto out;
2147*5c1def83SBjoern A. Zeeb 	}
2148*5c1def83SBjoern A. Zeeb out:
2149*5c1def83SBjoern A. Zeeb 	kfree(req);
2150*5c1def83SBjoern A. Zeeb 	return ret;
2151*5c1def83SBjoern A. Zeeb }
2152*5c1def83SBjoern A. Zeeb 
ath12k_qmi_free_target_mem_chunk(struct ath12k_base * ab)2153*5c1def83SBjoern A. Zeeb static void ath12k_qmi_free_target_mem_chunk(struct ath12k_base *ab)
2154*5c1def83SBjoern A. Zeeb {
2155*5c1def83SBjoern A. Zeeb 	int i;
2156*5c1def83SBjoern A. Zeeb 
2157*5c1def83SBjoern A. Zeeb 	for (i = 0; i < ab->qmi.mem_seg_count; i++) {
2158*5c1def83SBjoern A. Zeeb 		if (!ab->qmi.target_mem[i].v.addr)
2159*5c1def83SBjoern A. Zeeb 			continue;
2160*5c1def83SBjoern A. Zeeb 		dma_free_coherent(ab->dev,
2161*5c1def83SBjoern A. Zeeb 				  ab->qmi.target_mem[i].size,
2162*5c1def83SBjoern A. Zeeb 				  ab->qmi.target_mem[i].v.addr,
2163*5c1def83SBjoern A. Zeeb 				  ab->qmi.target_mem[i].paddr);
2164*5c1def83SBjoern A. Zeeb 		ab->qmi.target_mem[i].v.addr = NULL;
2165*5c1def83SBjoern A. Zeeb 	}
2166*5c1def83SBjoern A. Zeeb }
2167*5c1def83SBjoern A. Zeeb 
ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base * ab)2168*5c1def83SBjoern A. Zeeb static int ath12k_qmi_alloc_target_mem_chunk(struct ath12k_base *ab)
2169*5c1def83SBjoern A. Zeeb {
2170*5c1def83SBjoern A. Zeeb 	int i;
2171*5c1def83SBjoern A. Zeeb 	struct target_mem_chunk *chunk;
2172*5c1def83SBjoern A. Zeeb 
2173*5c1def83SBjoern A. Zeeb 	ab->qmi.target_mem_delayed = false;
2174*5c1def83SBjoern A. Zeeb 
2175*5c1def83SBjoern A. Zeeb 	for (i = 0; i < ab->qmi.mem_seg_count; i++) {
2176*5c1def83SBjoern A. Zeeb 		chunk = &ab->qmi.target_mem[i];
2177*5c1def83SBjoern A. Zeeb 
2178*5c1def83SBjoern A. Zeeb 		/* Allocate memory for the region and the functionality supported
2179*5c1def83SBjoern A. Zeeb 		 * on the host. For the non-supported memory region, host does not
2180*5c1def83SBjoern A. Zeeb 		 * allocate memory, assigns NULL and FW will handle this without crashing.
2181*5c1def83SBjoern A. Zeeb 		 */
2182*5c1def83SBjoern A. Zeeb 		switch (chunk->type) {
2183*5c1def83SBjoern A. Zeeb 		case HOST_DDR_REGION_TYPE:
2184*5c1def83SBjoern A. Zeeb 		case M3_DUMP_REGION_TYPE:
2185*5c1def83SBjoern A. Zeeb 		case PAGEABLE_MEM_REGION_TYPE:
2186*5c1def83SBjoern A. Zeeb 		case CALDB_MEM_REGION_TYPE:
2187*5c1def83SBjoern A. Zeeb 			chunk->v.addr = dma_alloc_coherent(ab->dev,
2188*5c1def83SBjoern A. Zeeb 							   chunk->size,
2189*5c1def83SBjoern A. Zeeb 							   &chunk->paddr,
2190*5c1def83SBjoern A. Zeeb 							   GFP_KERNEL | __GFP_NOWARN);
2191*5c1def83SBjoern A. Zeeb 			if (!chunk->v.addr) {
2192*5c1def83SBjoern A. Zeeb 				if (chunk->size > ATH12K_QMI_MAX_CHUNK_SIZE) {
2193*5c1def83SBjoern A. Zeeb 					ab->qmi.target_mem_delayed = true;
2194*5c1def83SBjoern A. Zeeb 					ath12k_warn(ab,
2195*5c1def83SBjoern A. Zeeb 						    "qmi dma allocation failed (%d B type %u), will try later with small size\n",
2196*5c1def83SBjoern A. Zeeb 						    chunk->size,
2197*5c1def83SBjoern A. Zeeb 						    chunk->type);
2198*5c1def83SBjoern A. Zeeb 					ath12k_qmi_free_target_mem_chunk(ab);
2199*5c1def83SBjoern A. Zeeb 					return 0;
2200*5c1def83SBjoern A. Zeeb 				}
2201*5c1def83SBjoern A. Zeeb 				ath12k_warn(ab, "memory allocation failure for %u size: %d\n",
2202*5c1def83SBjoern A. Zeeb 					    chunk->type, chunk->size);
2203*5c1def83SBjoern A. Zeeb 				return -ENOMEM;
2204*5c1def83SBjoern A. Zeeb 			}
2205*5c1def83SBjoern A. Zeeb 			break;
2206*5c1def83SBjoern A. Zeeb 		default:
2207*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "memory type %u not supported\n",
2208*5c1def83SBjoern A. Zeeb 				    chunk->type);
2209*5c1def83SBjoern A. Zeeb 			chunk->paddr = 0;
2210*5c1def83SBjoern A. Zeeb 			chunk->v.addr = NULL;
2211*5c1def83SBjoern A. Zeeb 			break;
2212*5c1def83SBjoern A. Zeeb 		}
2213*5c1def83SBjoern A. Zeeb 	}
2214*5c1def83SBjoern A. Zeeb 	return 0;
2215*5c1def83SBjoern A. Zeeb }
2216*5c1def83SBjoern A. Zeeb 
ath12k_qmi_request_target_cap(struct ath12k_base * ab)2217*5c1def83SBjoern A. Zeeb static int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
2218*5c1def83SBjoern A. Zeeb {
2219*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_cap_req_msg_v01 req;
2220*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_cap_resp_msg_v01 resp;
2221*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2222*5c1def83SBjoern A. Zeeb 	unsigned int board_id = ATH12K_BOARD_ID_DEFAULT;
2223*5c1def83SBjoern A. Zeeb 	int ret = 0;
2224*5c1def83SBjoern A. Zeeb 	int i;
2225*5c1def83SBjoern A. Zeeb 
2226*5c1def83SBjoern A. Zeeb 	memset(&req, 0, sizeof(req));
2227*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2228*5c1def83SBjoern A. Zeeb 
2229*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
2230*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_cap_resp_msg_v01_ei, &resp);
2231*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2232*5c1def83SBjoern A. Zeeb 		goto out;
2233*5c1def83SBjoern A. Zeeb 
2234*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2235*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_CAP_REQ_V01,
2236*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN,
2237*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_cap_req_msg_v01_ei, &req);
2238*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2239*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send target cap request, err = %d\n",
2240*5c1def83SBjoern A. Zeeb 			    ret);
2241*5c1def83SBjoern A. Zeeb 		goto out;
2242*5c1def83SBjoern A. Zeeb 	}
2243*5c1def83SBjoern A. Zeeb 
2244*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2245*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2246*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed target cap request %d\n", ret);
2247*5c1def83SBjoern A. Zeeb 		goto out;
2248*5c1def83SBjoern A. Zeeb 	}
2249*5c1def83SBjoern A. Zeeb 
2250*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2251*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi targetcap req failed, result: %d, err: %d\n",
2252*5c1def83SBjoern A. Zeeb 			    resp.resp.result, resp.resp.error);
2253*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2254*5c1def83SBjoern A. Zeeb 		goto out;
2255*5c1def83SBjoern A. Zeeb 	}
2256*5c1def83SBjoern A. Zeeb 
2257*5c1def83SBjoern A. Zeeb 	if (resp.chip_info_valid) {
2258*5c1def83SBjoern A. Zeeb 		ab->qmi.target.chip_id = resp.chip_info.chip_id;
2259*5c1def83SBjoern A. Zeeb 		ab->qmi.target.chip_family = resp.chip_info.chip_family;
2260*5c1def83SBjoern A. Zeeb 	}
2261*5c1def83SBjoern A. Zeeb 
2262*5c1def83SBjoern A. Zeeb 	if (resp.board_info_valid)
2263*5c1def83SBjoern A. Zeeb 		ab->qmi.target.board_id = resp.board_info.board_id;
2264*5c1def83SBjoern A. Zeeb 	else
2265*5c1def83SBjoern A. Zeeb 		ab->qmi.target.board_id = board_id;
2266*5c1def83SBjoern A. Zeeb 
2267*5c1def83SBjoern A. Zeeb 	if (resp.soc_info_valid)
2268*5c1def83SBjoern A. Zeeb 		ab->qmi.target.soc_id = resp.soc_info.soc_id;
2269*5c1def83SBjoern A. Zeeb 
2270*5c1def83SBjoern A. Zeeb 	if (resp.fw_version_info_valid) {
2271*5c1def83SBjoern A. Zeeb 		ab->qmi.target.fw_version = resp.fw_version_info.fw_version;
2272*5c1def83SBjoern A. Zeeb 		strscpy(ab->qmi.target.fw_build_timestamp,
2273*5c1def83SBjoern A. Zeeb 			resp.fw_version_info.fw_build_timestamp,
2274*5c1def83SBjoern A. Zeeb 			sizeof(ab->qmi.target.fw_build_timestamp));
2275*5c1def83SBjoern A. Zeeb 	}
2276*5c1def83SBjoern A. Zeeb 
2277*5c1def83SBjoern A. Zeeb 	if (resp.fw_build_id_valid)
2278*5c1def83SBjoern A. Zeeb 		strscpy(ab->qmi.target.fw_build_id, resp.fw_build_id,
2279*5c1def83SBjoern A. Zeeb 			sizeof(ab->qmi.target.fw_build_id));
2280*5c1def83SBjoern A. Zeeb 
2281*5c1def83SBjoern A. Zeeb 	if (resp.dev_mem_info_valid) {
2282*5c1def83SBjoern A. Zeeb 		for (i = 0; i < ATH12K_QMI_WLFW_MAX_DEV_MEM_NUM_V01; i++) {
2283*5c1def83SBjoern A. Zeeb 			ab->qmi.dev_mem[i].start =
2284*5c1def83SBjoern A. Zeeb 				resp.dev_mem[i].start;
2285*5c1def83SBjoern A. Zeeb 			ab->qmi.dev_mem[i].size =
2286*5c1def83SBjoern A. Zeeb 				resp.dev_mem[i].size;
2287*5c1def83SBjoern A. Zeeb 			ath12k_dbg(ab, ATH12K_DBG_QMI,
2288*5c1def83SBjoern A. Zeeb #if defined(__linux__)
2289*5c1def83SBjoern A. Zeeb 				   "devmem [%d] start ox%llx size %llu\n", i,
2290*5c1def83SBjoern A. Zeeb 				   ab->qmi.dev_mem[i].start,
2291*5c1def83SBjoern A. Zeeb 				   ab->qmi.dev_mem[i].size);
2292*5c1def83SBjoern A. Zeeb #elif defined(__FreeBSD__)
2293*5c1def83SBjoern A. Zeeb 				   "devmem [%d] start ox%jx size %ju\n", i,
2294*5c1def83SBjoern A. Zeeb 				   (uintmax_t)ab->qmi.dev_mem[i].start,
2295*5c1def83SBjoern A. Zeeb 				   (uintmax_t)ab->qmi.dev_mem[i].size);
2296*5c1def83SBjoern A. Zeeb #endif
2297*5c1def83SBjoern A. Zeeb 		}
2298*5c1def83SBjoern A. Zeeb 	}
2299*5c1def83SBjoern A. Zeeb 
2300*5c1def83SBjoern A. Zeeb 	if (resp.eeprom_caldata_read_timeout_valid) {
2301*5c1def83SBjoern A. Zeeb 		ab->qmi.target.eeprom_caldata = resp.eeprom_caldata_read_timeout;
2302*5c1def83SBjoern A. Zeeb 		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi cal data supported from eeprom\n");
2303*5c1def83SBjoern A. Zeeb 	}
2304*5c1def83SBjoern A. Zeeb 
2305*5c1def83SBjoern A. Zeeb 	ath12k_info(ab, "chip_id 0x%x chip_family 0x%x board_id 0x%x soc_id 0x%x\n",
2306*5c1def83SBjoern A. Zeeb 		    ab->qmi.target.chip_id, ab->qmi.target.chip_family,
2307*5c1def83SBjoern A. Zeeb 		    ab->qmi.target.board_id, ab->qmi.target.soc_id);
2308*5c1def83SBjoern A. Zeeb 
2309*5c1def83SBjoern A. Zeeb 	ath12k_info(ab, "fw_version 0x%x fw_build_timestamp %s fw_build_id %s",
2310*5c1def83SBjoern A. Zeeb 		    ab->qmi.target.fw_version,
2311*5c1def83SBjoern A. Zeeb 		    ab->qmi.target.fw_build_timestamp,
2312*5c1def83SBjoern A. Zeeb 		    ab->qmi.target.fw_build_id);
2313*5c1def83SBjoern A. Zeeb 
2314*5c1def83SBjoern A. Zeeb out:
2315*5c1def83SBjoern A. Zeeb 	return ret;
2316*5c1def83SBjoern A. Zeeb }
2317*5c1def83SBjoern A. Zeeb 
ath12k_qmi_load_file_target_mem(struct ath12k_base * ab,const u8 * data,u32 len,u8 type)2318*5c1def83SBjoern A. Zeeb static int ath12k_qmi_load_file_target_mem(struct ath12k_base *ab,
2319*5c1def83SBjoern A. Zeeb 					   const u8 *data, u32 len, u8 type)
2320*5c1def83SBjoern A. Zeeb {
2321*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_bdf_download_req_msg_v01 *req;
2322*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
2323*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2324*5c1def83SBjoern A. Zeeb 	const u8 *temp = data;
2325*5c1def83SBjoern A. Zeeb 	int ret;
2326*5c1def83SBjoern A. Zeeb 	u32 remaining = len;
2327*5c1def83SBjoern A. Zeeb 
2328*5c1def83SBjoern A. Zeeb 	req = kzalloc(sizeof(*req), GFP_KERNEL);
2329*5c1def83SBjoern A. Zeeb 	if (!req)
2330*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2331*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2332*5c1def83SBjoern A. Zeeb 
2333*5c1def83SBjoern A. Zeeb 	while (remaining) {
2334*5c1def83SBjoern A. Zeeb 		req->valid = 1;
2335*5c1def83SBjoern A. Zeeb 		req->file_id_valid = 1;
2336*5c1def83SBjoern A. Zeeb 		req->file_id = ab->qmi.target.board_id;
2337*5c1def83SBjoern A. Zeeb 		req->total_size_valid = 1;
2338*5c1def83SBjoern A. Zeeb 		req->total_size = remaining;
2339*5c1def83SBjoern A. Zeeb 		req->seg_id_valid = 1;
2340*5c1def83SBjoern A. Zeeb 		req->data_valid = 1;
2341*5c1def83SBjoern A. Zeeb 		req->bdf_type = type;
2342*5c1def83SBjoern A. Zeeb 		req->bdf_type_valid = 1;
2343*5c1def83SBjoern A. Zeeb 		req->end_valid = 1;
2344*5c1def83SBjoern A. Zeeb 		req->end = 0;
2345*5c1def83SBjoern A. Zeeb 
2346*5c1def83SBjoern A. Zeeb 		if (remaining > QMI_WLANFW_MAX_DATA_SIZE_V01) {
2347*5c1def83SBjoern A. Zeeb 			req->data_len = QMI_WLANFW_MAX_DATA_SIZE_V01;
2348*5c1def83SBjoern A. Zeeb 		} else {
2349*5c1def83SBjoern A. Zeeb 			req->data_len = remaining;
2350*5c1def83SBjoern A. Zeeb 			req->end = 1;
2351*5c1def83SBjoern A. Zeeb 		}
2352*5c1def83SBjoern A. Zeeb 
2353*5c1def83SBjoern A. Zeeb 		if (type == ATH12K_QMI_FILE_TYPE_EEPROM) {
2354*5c1def83SBjoern A. Zeeb 			req->data_valid = 0;
2355*5c1def83SBjoern A. Zeeb 			req->end = 1;
2356*5c1def83SBjoern A. Zeeb 			req->data_len = ATH12K_QMI_MAX_BDF_FILE_NAME_SIZE;
2357*5c1def83SBjoern A. Zeeb 		} else {
2358*5c1def83SBjoern A. Zeeb 			memcpy(req->data, temp, req->data_len);
2359*5c1def83SBjoern A. Zeeb 		}
2360*5c1def83SBjoern A. Zeeb 
2361*5c1def83SBjoern A. Zeeb 		ret = qmi_txn_init(&ab->qmi.handle, &txn,
2362*5c1def83SBjoern A. Zeeb 				   qmi_wlanfw_bdf_download_resp_msg_v01_ei,
2363*5c1def83SBjoern A. Zeeb 				   &resp);
2364*5c1def83SBjoern A. Zeeb 		if (ret < 0)
2365*5c1def83SBjoern A. Zeeb 			goto out;
2366*5c1def83SBjoern A. Zeeb 
2367*5c1def83SBjoern A. Zeeb 		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi bdf download req fixed addr type %d\n",
2368*5c1def83SBjoern A. Zeeb 			   type);
2369*5c1def83SBjoern A. Zeeb 
2370*5c1def83SBjoern A. Zeeb 		ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2371*5c1def83SBjoern A. Zeeb 				       QMI_WLANFW_BDF_DOWNLOAD_REQ_V01,
2372*5c1def83SBjoern A. Zeeb 				       QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN,
2373*5c1def83SBjoern A. Zeeb 				       qmi_wlanfw_bdf_download_req_msg_v01_ei, req);
2374*5c1def83SBjoern A. Zeeb 		if (ret < 0) {
2375*5c1def83SBjoern A. Zeeb 			qmi_txn_cancel(&txn);
2376*5c1def83SBjoern A. Zeeb 			goto out;
2377*5c1def83SBjoern A. Zeeb 		}
2378*5c1def83SBjoern A. Zeeb 
2379*5c1def83SBjoern A. Zeeb 		ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2380*5c1def83SBjoern A. Zeeb 		if (ret < 0)
2381*5c1def83SBjoern A. Zeeb 			goto out;
2382*5c1def83SBjoern A. Zeeb 
2383*5c1def83SBjoern A. Zeeb 		if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2384*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n",
2385*5c1def83SBjoern A. Zeeb 				    resp.resp.result, resp.resp.error);
2386*5c1def83SBjoern A. Zeeb 			ret = -EINVAL;
2387*5c1def83SBjoern A. Zeeb 			goto out;
2388*5c1def83SBjoern A. Zeeb 		}
2389*5c1def83SBjoern A. Zeeb 
2390*5c1def83SBjoern A. Zeeb 		if (type == ATH12K_QMI_FILE_TYPE_EEPROM) {
2391*5c1def83SBjoern A. Zeeb 			remaining = 0;
2392*5c1def83SBjoern A. Zeeb 		} else {
2393*5c1def83SBjoern A. Zeeb 			remaining -= req->data_len;
2394*5c1def83SBjoern A. Zeeb 			temp += req->data_len;
2395*5c1def83SBjoern A. Zeeb 			req->seg_id++;
2396*5c1def83SBjoern A. Zeeb 			ath12k_dbg(ab, ATH12K_DBG_QMI,
2397*5c1def83SBjoern A. Zeeb 				   "qmi bdf download request remaining %i\n",
2398*5c1def83SBjoern A. Zeeb 				   remaining);
2399*5c1def83SBjoern A. Zeeb 		}
2400*5c1def83SBjoern A. Zeeb 	}
2401*5c1def83SBjoern A. Zeeb 
2402*5c1def83SBjoern A. Zeeb out:
2403*5c1def83SBjoern A. Zeeb 	kfree(req);
2404*5c1def83SBjoern A. Zeeb 	return ret;
2405*5c1def83SBjoern A. Zeeb }
2406*5c1def83SBjoern A. Zeeb 
ath12k_qmi_load_bdf_qmi(struct ath12k_base * ab,enum ath12k_qmi_bdf_type type)2407*5c1def83SBjoern A. Zeeb static int ath12k_qmi_load_bdf_qmi(struct ath12k_base *ab,
2408*5c1def83SBjoern A. Zeeb 				   enum ath12k_qmi_bdf_type type)
2409*5c1def83SBjoern A. Zeeb {
2410*5c1def83SBjoern A. Zeeb 	struct device *dev = ab->dev;
2411*5c1def83SBjoern A. Zeeb 	char filename[ATH12K_QMI_MAX_BDF_FILE_NAME_SIZE];
2412*5c1def83SBjoern A. Zeeb 	const struct firmware *fw_entry;
2413*5c1def83SBjoern A. Zeeb 	struct ath12k_board_data bd;
2414*5c1def83SBjoern A. Zeeb 	u32 fw_size, file_type;
2415*5c1def83SBjoern A. Zeeb 	int ret = 0;
2416*5c1def83SBjoern A. Zeeb 	const u8 *tmp;
2417*5c1def83SBjoern A. Zeeb 
2418*5c1def83SBjoern A. Zeeb 	memset(&bd, 0, sizeof(bd));
2419*5c1def83SBjoern A. Zeeb 
2420*5c1def83SBjoern A. Zeeb 	switch (type) {
2421*5c1def83SBjoern A. Zeeb 	case ATH12K_QMI_BDF_TYPE_ELF:
2422*5c1def83SBjoern A. Zeeb 		ret = ath12k_core_fetch_bdf(ab, &bd);
2423*5c1def83SBjoern A. Zeeb 		if (ret) {
2424*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "qmi failed to load bdf:\n");
2425*5c1def83SBjoern A. Zeeb 			goto out;
2426*5c1def83SBjoern A. Zeeb 		}
2427*5c1def83SBjoern A. Zeeb 
2428*5c1def83SBjoern A. Zeeb 		if (bd.len >= SELFMAG && memcmp(bd.data, ELFMAG, SELFMAG) == 0)
2429*5c1def83SBjoern A. Zeeb 			type = ATH12K_QMI_BDF_TYPE_ELF;
2430*5c1def83SBjoern A. Zeeb 		else
2431*5c1def83SBjoern A. Zeeb 			type = ATH12K_QMI_BDF_TYPE_BIN;
2432*5c1def83SBjoern A. Zeeb 
2433*5c1def83SBjoern A. Zeeb 		break;
2434*5c1def83SBjoern A. Zeeb 	case ATH12K_QMI_BDF_TYPE_REGDB:
2435*5c1def83SBjoern A. Zeeb 		ret = ath12k_core_fetch_board_data_api_1(ab, &bd,
2436*5c1def83SBjoern A. Zeeb 							 ATH12K_REGDB_FILE_NAME);
2437*5c1def83SBjoern A. Zeeb 		if (ret) {
2438*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "qmi failed to load regdb bin:\n");
2439*5c1def83SBjoern A. Zeeb 			goto out;
2440*5c1def83SBjoern A. Zeeb 		}
2441*5c1def83SBjoern A. Zeeb 		break;
2442*5c1def83SBjoern A. Zeeb 	case ATH12K_QMI_BDF_TYPE_CALIBRATION:
2443*5c1def83SBjoern A. Zeeb 
2444*5c1def83SBjoern A. Zeeb 		if (ab->qmi.target.eeprom_caldata) {
2445*5c1def83SBjoern A. Zeeb 			file_type = ATH12K_QMI_FILE_TYPE_EEPROM;
2446*5c1def83SBjoern A. Zeeb 			tmp = filename;
2447*5c1def83SBjoern A. Zeeb 			fw_size = ATH12K_QMI_MAX_BDF_FILE_NAME_SIZE;
2448*5c1def83SBjoern A. Zeeb 		} else {
2449*5c1def83SBjoern A. Zeeb 			file_type = ATH12K_QMI_FILE_TYPE_CALDATA;
2450*5c1def83SBjoern A. Zeeb 
2451*5c1def83SBjoern A. Zeeb 			/* cal-<bus>-<id>.bin */
2452*5c1def83SBjoern A. Zeeb 			snprintf(filename, sizeof(filename), "cal-%s-%s.bin",
2453*5c1def83SBjoern A. Zeeb 				 ath12k_bus_str(ab->hif.bus), dev_name(dev));
2454*5c1def83SBjoern A. Zeeb 			fw_entry = ath12k_core_firmware_request(ab, filename);
2455*5c1def83SBjoern A. Zeeb 			if (!IS_ERR(fw_entry))
2456*5c1def83SBjoern A. Zeeb 				goto success;
2457*5c1def83SBjoern A. Zeeb 
2458*5c1def83SBjoern A. Zeeb 			fw_entry = ath12k_core_firmware_request(ab,
2459*5c1def83SBjoern A. Zeeb 								ATH12K_DEFAULT_CAL_FILE);
2460*5c1def83SBjoern A. Zeeb 			if (IS_ERR(fw_entry)) {
2461*5c1def83SBjoern A. Zeeb 				ret = PTR_ERR(fw_entry);
2462*5c1def83SBjoern A. Zeeb 				ath12k_warn(ab,
2463*5c1def83SBjoern A. Zeeb 					    "qmi failed to load CAL data file:%s\n",
2464*5c1def83SBjoern A. Zeeb 					    filename);
2465*5c1def83SBjoern A. Zeeb 				goto out;
2466*5c1def83SBjoern A. Zeeb 			}
2467*5c1def83SBjoern A. Zeeb 
2468*5c1def83SBjoern A. Zeeb success:
2469*5c1def83SBjoern A. Zeeb 			fw_size = min_t(u32, ab->hw_params->fw.board_size,
2470*5c1def83SBjoern A. Zeeb 					fw_entry->size);
2471*5c1def83SBjoern A. Zeeb 			tmp = fw_entry->data;
2472*5c1def83SBjoern A. Zeeb 		}
2473*5c1def83SBjoern A. Zeeb 		ret = ath12k_qmi_load_file_target_mem(ab, tmp, fw_size, file_type);
2474*5c1def83SBjoern A. Zeeb 		if (ret < 0) {
2475*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "qmi failed to load caldata\n");
2476*5c1def83SBjoern A. Zeeb 			goto out_qmi_cal;
2477*5c1def83SBjoern A. Zeeb 		}
2478*5c1def83SBjoern A. Zeeb 
2479*5c1def83SBjoern A. Zeeb 		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi caldata downloaded: type: %u\n",
2480*5c1def83SBjoern A. Zeeb 			   file_type);
2481*5c1def83SBjoern A. Zeeb 
2482*5c1def83SBjoern A. Zeeb out_qmi_cal:
2483*5c1def83SBjoern A. Zeeb 		if (!ab->qmi.target.eeprom_caldata)
2484*5c1def83SBjoern A. Zeeb 			release_firmware(fw_entry);
2485*5c1def83SBjoern A. Zeeb 		return ret;
2486*5c1def83SBjoern A. Zeeb 	default:
2487*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "unknown file type for load %d", type);
2488*5c1def83SBjoern A. Zeeb 		goto out;
2489*5c1def83SBjoern A. Zeeb 	}
2490*5c1def83SBjoern A. Zeeb 
2491*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi bdf_type %d\n", type);
2492*5c1def83SBjoern A. Zeeb 
2493*5c1def83SBjoern A. Zeeb 	fw_size = min_t(u32, ab->hw_params->fw.board_size, bd.len);
2494*5c1def83SBjoern A. Zeeb 
2495*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_load_file_target_mem(ab, bd.data, fw_size, type);
2496*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2497*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to load bdf file\n");
2498*5c1def83SBjoern A. Zeeb 
2499*5c1def83SBjoern A. Zeeb out:
2500*5c1def83SBjoern A. Zeeb 	ath12k_core_free_bdf(ab, &bd);
2501*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi BDF download sequence completed\n");
2502*5c1def83SBjoern A. Zeeb 
2503*5c1def83SBjoern A. Zeeb 	return ret;
2504*5c1def83SBjoern A. Zeeb }
2505*5c1def83SBjoern A. Zeeb 
ath12k_qmi_m3_load(struct ath12k_base * ab)2506*5c1def83SBjoern A. Zeeb static int ath12k_qmi_m3_load(struct ath12k_base *ab)
2507*5c1def83SBjoern A. Zeeb {
2508*5c1def83SBjoern A. Zeeb 	struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
2509*5c1def83SBjoern A. Zeeb 	const struct firmware *fw;
2510*5c1def83SBjoern A. Zeeb 	char path[100];
2511*5c1def83SBjoern A. Zeeb 	int ret;
2512*5c1def83SBjoern A. Zeeb 
2513*5c1def83SBjoern A. Zeeb 	if (m3_mem->vaddr || m3_mem->size)
2514*5c1def83SBjoern A. Zeeb 		return 0;
2515*5c1def83SBjoern A. Zeeb 
2516*5c1def83SBjoern A. Zeeb 	fw = ath12k_core_firmware_request(ab, ATH12K_M3_FILE);
2517*5c1def83SBjoern A. Zeeb 	if (IS_ERR(fw)) {
2518*5c1def83SBjoern A. Zeeb 		ret = PTR_ERR(fw);
2519*5c1def83SBjoern A. Zeeb 		ath12k_core_create_firmware_path(ab, ATH12K_M3_FILE,
2520*5c1def83SBjoern A. Zeeb 						 path, sizeof(path));
2521*5c1def83SBjoern A. Zeeb 		ath12k_err(ab, "failed to load %s: %d\n", path, ret);
2522*5c1def83SBjoern A. Zeeb 		return ret;
2523*5c1def83SBjoern A. Zeeb 	}
2524*5c1def83SBjoern A. Zeeb 
2525*5c1def83SBjoern A. Zeeb 	m3_mem->vaddr = dma_alloc_coherent(ab->dev,
2526*5c1def83SBjoern A. Zeeb 					   fw->size, &m3_mem->paddr,
2527*5c1def83SBjoern A. Zeeb 					   GFP_KERNEL);
2528*5c1def83SBjoern A. Zeeb 	if (!m3_mem->vaddr) {
2529*5c1def83SBjoern A. Zeeb 		ath12k_err(ab, "failed to allocate memory for M3 with size %zu\n",
2530*5c1def83SBjoern A. Zeeb 			   fw->size);
2531*5c1def83SBjoern A. Zeeb 		release_firmware(fw);
2532*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2533*5c1def83SBjoern A. Zeeb 	}
2534*5c1def83SBjoern A. Zeeb 
2535*5c1def83SBjoern A. Zeeb 	memcpy(m3_mem->vaddr, fw->data, fw->size);
2536*5c1def83SBjoern A. Zeeb 	m3_mem->size = fw->size;
2537*5c1def83SBjoern A. Zeeb 	release_firmware(fw);
2538*5c1def83SBjoern A. Zeeb 
2539*5c1def83SBjoern A. Zeeb 	return 0;
2540*5c1def83SBjoern A. Zeeb }
2541*5c1def83SBjoern A. Zeeb 
ath12k_qmi_m3_free(struct ath12k_base * ab)2542*5c1def83SBjoern A. Zeeb static void ath12k_qmi_m3_free(struct ath12k_base *ab)
2543*5c1def83SBjoern A. Zeeb {
2544*5c1def83SBjoern A. Zeeb 	struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
2545*5c1def83SBjoern A. Zeeb 
2546*5c1def83SBjoern A. Zeeb 	if (!m3_mem->vaddr)
2547*5c1def83SBjoern A. Zeeb 		return;
2548*5c1def83SBjoern A. Zeeb 
2549*5c1def83SBjoern A. Zeeb 	dma_free_coherent(ab->dev, m3_mem->size,
2550*5c1def83SBjoern A. Zeeb 			  m3_mem->vaddr, m3_mem->paddr);
2551*5c1def83SBjoern A. Zeeb 	m3_mem->vaddr = NULL;
2552*5c1def83SBjoern A. Zeeb }
2553*5c1def83SBjoern A. Zeeb 
ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base * ab)2554*5c1def83SBjoern A. Zeeb static int ath12k_qmi_wlanfw_m3_info_send(struct ath12k_base *ab)
2555*5c1def83SBjoern A. Zeeb {
2556*5c1def83SBjoern A. Zeeb 	struct m3_mem_region *m3_mem = &ab->qmi.m3_mem;
2557*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_m3_info_req_msg_v01 req;
2558*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_m3_info_resp_msg_v01 resp;
2559*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2560*5c1def83SBjoern A. Zeeb 	int ret = 0;
2561*5c1def83SBjoern A. Zeeb 
2562*5c1def83SBjoern A. Zeeb 	memset(&req, 0, sizeof(req));
2563*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2564*5c1def83SBjoern A. Zeeb 
2565*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_m3_load(ab);
2566*5c1def83SBjoern A. Zeeb 	if (ret) {
2567*5c1def83SBjoern A. Zeeb 		ath12k_err(ab, "failed to load m3 firmware: %d", ret);
2568*5c1def83SBjoern A. Zeeb 		return ret;
2569*5c1def83SBjoern A. Zeeb 	}
2570*5c1def83SBjoern A. Zeeb 
2571*5c1def83SBjoern A. Zeeb 	req.addr = m3_mem->paddr;
2572*5c1def83SBjoern A. Zeeb 	req.size = m3_mem->size;
2573*5c1def83SBjoern A. Zeeb 
2574*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
2575*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_m3_info_resp_msg_v01_ei, &resp);
2576*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2577*5c1def83SBjoern A. Zeeb 		goto out;
2578*5c1def83SBjoern A. Zeeb 
2579*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2580*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_M3_INFO_REQ_V01,
2581*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_M3_INFO_REQ_MSG_V01_MAX_MSG_LEN,
2582*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_m3_info_req_msg_v01_ei, &req);
2583*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2584*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send M3 information request, err = %d\n",
2585*5c1def83SBjoern A. Zeeb 			    ret);
2586*5c1def83SBjoern A. Zeeb 		goto out;
2587*5c1def83SBjoern A. Zeeb 	}
2588*5c1def83SBjoern A. Zeeb 
2589*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2590*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2591*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed M3 information request %d\n", ret);
2592*5c1def83SBjoern A. Zeeb 		goto out;
2593*5c1def83SBjoern A. Zeeb 	}
2594*5c1def83SBjoern A. Zeeb 
2595*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2596*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi M3 info request failed, result: %d, err: %d\n",
2597*5c1def83SBjoern A. Zeeb 			    resp.resp.result, resp.resp.error);
2598*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2599*5c1def83SBjoern A. Zeeb 		goto out;
2600*5c1def83SBjoern A. Zeeb 	}
2601*5c1def83SBjoern A. Zeeb out:
2602*5c1def83SBjoern A. Zeeb 	return ret;
2603*5c1def83SBjoern A. Zeeb }
2604*5c1def83SBjoern A. Zeeb 
ath12k_qmi_wlanfw_mode_send(struct ath12k_base * ab,u32 mode)2605*5c1def83SBjoern A. Zeeb static int ath12k_qmi_wlanfw_mode_send(struct ath12k_base *ab,
2606*5c1def83SBjoern A. Zeeb 				       u32 mode)
2607*5c1def83SBjoern A. Zeeb {
2608*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_wlan_mode_req_msg_v01 req;
2609*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_wlan_mode_resp_msg_v01 resp;
2610*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2611*5c1def83SBjoern A. Zeeb 	int ret = 0;
2612*5c1def83SBjoern A. Zeeb 
2613*5c1def83SBjoern A. Zeeb 	memset(&req, 0, sizeof(req));
2614*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2615*5c1def83SBjoern A. Zeeb 
2616*5c1def83SBjoern A. Zeeb 	req.mode = mode;
2617*5c1def83SBjoern A. Zeeb 	req.hw_debug_valid = 1;
2618*5c1def83SBjoern A. Zeeb 	req.hw_debug = 0;
2619*5c1def83SBjoern A. Zeeb 
2620*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
2621*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_wlan_mode_resp_msg_v01_ei, &resp);
2622*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2623*5c1def83SBjoern A. Zeeb 		goto out;
2624*5c1def83SBjoern A. Zeeb 
2625*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2626*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_WLAN_MODE_REQ_V01,
2627*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_WLAN_MODE_REQ_MSG_V01_MAX_LEN,
2628*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req);
2629*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2630*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send mode request, mode: %d, err = %d\n",
2631*5c1def83SBjoern A. Zeeb 			    mode, ret);
2632*5c1def83SBjoern A. Zeeb 		goto out;
2633*5c1def83SBjoern A. Zeeb 	}
2634*5c1def83SBjoern A. Zeeb 
2635*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2636*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2637*5c1def83SBjoern A. Zeeb 		if (mode == ATH12K_FIRMWARE_MODE_OFF && ret == -ENETRESET) {
2638*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "WLFW service is dis-connected\n");
2639*5c1def83SBjoern A. Zeeb 			return 0;
2640*5c1def83SBjoern A. Zeeb 		}
2641*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed set mode request, mode: %d, err = %d\n",
2642*5c1def83SBjoern A. Zeeb 			    mode, ret);
2643*5c1def83SBjoern A. Zeeb 		goto out;
2644*5c1def83SBjoern A. Zeeb 	}
2645*5c1def83SBjoern A. Zeeb 
2646*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2647*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Mode request failed, mode: %d, result: %d err: %d\n",
2648*5c1def83SBjoern A. Zeeb 			    mode, resp.resp.result, resp.resp.error);
2649*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2650*5c1def83SBjoern A. Zeeb 		goto out;
2651*5c1def83SBjoern A. Zeeb 	}
2652*5c1def83SBjoern A. Zeeb 
2653*5c1def83SBjoern A. Zeeb out:
2654*5c1def83SBjoern A. Zeeb 	return ret;
2655*5c1def83SBjoern A. Zeeb }
2656*5c1def83SBjoern A. Zeeb 
ath12k_qmi_wlanfw_wlan_cfg_send(struct ath12k_base * ab)2657*5c1def83SBjoern A. Zeeb static int ath12k_qmi_wlanfw_wlan_cfg_send(struct ath12k_base *ab)
2658*5c1def83SBjoern A. Zeeb {
2659*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_wlan_cfg_req_msg_v01 *req;
2660*5c1def83SBjoern A. Zeeb 	struct qmi_wlanfw_wlan_cfg_resp_msg_v01 resp;
2661*5c1def83SBjoern A. Zeeb #if defined(__linux__)
2662*5c1def83SBjoern A. Zeeb 	struct ce_pipe_config *ce_cfg;
2663*5c1def83SBjoern A. Zeeb 	struct service_to_pipe *svc_cfg;
2664*5c1def83SBjoern A. Zeeb #elif defined(__FreeBSD__)
2665*5c1def83SBjoern A. Zeeb 	const struct ce_pipe_config *ce_cfg;
2666*5c1def83SBjoern A. Zeeb 	const struct service_to_pipe *svc_cfg;
2667*5c1def83SBjoern A. Zeeb #endif
2668*5c1def83SBjoern A. Zeeb 	struct qmi_txn txn = {};
2669*5c1def83SBjoern A. Zeeb 	int ret = 0, pipe_num;
2670*5c1def83SBjoern A. Zeeb 
2671*5c1def83SBjoern A. Zeeb #if defined(__linux__)
2672*5c1def83SBjoern A. Zeeb 	ce_cfg	= (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce;
2673*5c1def83SBjoern A. Zeeb 	svc_cfg	= (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map;
2674*5c1def83SBjoern A. Zeeb #elif defined(__FreeBSD__)
2675*5c1def83SBjoern A. Zeeb 	ce_cfg	= ab->qmi.ce_cfg.tgt_ce;
2676*5c1def83SBjoern A. Zeeb 	svc_cfg	= ab->qmi.ce_cfg.svc_to_ce_map;
2677*5c1def83SBjoern A. Zeeb #endif
2678*5c1def83SBjoern A. Zeeb 
2679*5c1def83SBjoern A. Zeeb 	req = kzalloc(sizeof(*req), GFP_KERNEL);
2680*5c1def83SBjoern A. Zeeb 	if (!req)
2681*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2682*5c1def83SBjoern A. Zeeb 
2683*5c1def83SBjoern A. Zeeb 	memset(&resp, 0, sizeof(resp));
2684*5c1def83SBjoern A. Zeeb 
2685*5c1def83SBjoern A. Zeeb 	req->host_version_valid = 1;
2686*5c1def83SBjoern A. Zeeb 	strscpy(req->host_version, ATH12K_HOST_VERSION_STRING,
2687*5c1def83SBjoern A. Zeeb 		sizeof(req->host_version));
2688*5c1def83SBjoern A. Zeeb 
2689*5c1def83SBjoern A. Zeeb 	req->tgt_cfg_valid = 1;
2690*5c1def83SBjoern A. Zeeb 	/* This is number of CE configs */
2691*5c1def83SBjoern A. Zeeb 	req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len;
2692*5c1def83SBjoern A. Zeeb 	for (pipe_num = 0; pipe_num < req->tgt_cfg_len ; pipe_num++) {
2693*5c1def83SBjoern A. Zeeb 		req->tgt_cfg[pipe_num].pipe_num = ce_cfg[pipe_num].pipenum;
2694*5c1def83SBjoern A. Zeeb 		req->tgt_cfg[pipe_num].pipe_dir = ce_cfg[pipe_num].pipedir;
2695*5c1def83SBjoern A. Zeeb 		req->tgt_cfg[pipe_num].nentries = ce_cfg[pipe_num].nentries;
2696*5c1def83SBjoern A. Zeeb 		req->tgt_cfg[pipe_num].nbytes_max = ce_cfg[pipe_num].nbytes_max;
2697*5c1def83SBjoern A. Zeeb 		req->tgt_cfg[pipe_num].flags = ce_cfg[pipe_num].flags;
2698*5c1def83SBjoern A. Zeeb 	}
2699*5c1def83SBjoern A. Zeeb 
2700*5c1def83SBjoern A. Zeeb 	req->svc_cfg_valid = 1;
2701*5c1def83SBjoern A. Zeeb 	/* This is number of Service/CE configs */
2702*5c1def83SBjoern A. Zeeb 	req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len;
2703*5c1def83SBjoern A. Zeeb 	for (pipe_num = 0; pipe_num < req->svc_cfg_len; pipe_num++) {
2704*5c1def83SBjoern A. Zeeb 		req->svc_cfg[pipe_num].service_id = svc_cfg[pipe_num].service_id;
2705*5c1def83SBjoern A. Zeeb 		req->svc_cfg[pipe_num].pipe_dir = svc_cfg[pipe_num].pipedir;
2706*5c1def83SBjoern A. Zeeb 		req->svc_cfg[pipe_num].pipe_num = svc_cfg[pipe_num].pipenum;
2707*5c1def83SBjoern A. Zeeb 	}
2708*5c1def83SBjoern A. Zeeb 
2709*5c1def83SBjoern A. Zeeb 	/* set shadow v3 configuration */
2710*5c1def83SBjoern A. Zeeb 	if (ab->hw_params->supports_shadow_regs) {
2711*5c1def83SBjoern A. Zeeb 		req->shadow_reg_v3_valid = 1;
2712*5c1def83SBjoern A. Zeeb 		req->shadow_reg_v3_len = min_t(u32,
2713*5c1def83SBjoern A. Zeeb 					       ab->qmi.ce_cfg.shadow_reg_v3_len,
2714*5c1def83SBjoern A. Zeeb 					       QMI_WLANFW_MAX_NUM_SHADOW_REG_V3_V01);
2715*5c1def83SBjoern A. Zeeb 		memcpy(&req->shadow_reg_v3, ab->qmi.ce_cfg.shadow_reg_v3,
2716*5c1def83SBjoern A. Zeeb 		       sizeof(u32) * req->shadow_reg_v3_len);
2717*5c1def83SBjoern A. Zeeb 	} else {
2718*5c1def83SBjoern A. Zeeb 		req->shadow_reg_v3_valid = 0;
2719*5c1def83SBjoern A. Zeeb 	}
2720*5c1def83SBjoern A. Zeeb 
2721*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
2722*5c1def83SBjoern A. Zeeb 			   qmi_wlanfw_wlan_cfg_resp_msg_v01_ei, &resp);
2723*5c1def83SBjoern A. Zeeb 	if (ret < 0)
2724*5c1def83SBjoern A. Zeeb 		goto out;
2725*5c1def83SBjoern A. Zeeb 
2726*5c1def83SBjoern A. Zeeb 	ret = qmi_send_request(&ab->qmi.handle, NULL, &txn,
2727*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_WLAN_CFG_REQ_V01,
2728*5c1def83SBjoern A. Zeeb 			       QMI_WLANFW_WLAN_CFG_REQ_MSG_V01_MAX_LEN,
2729*5c1def83SBjoern A. Zeeb 			       qmi_wlanfw_wlan_cfg_req_msg_v01_ei, req);
2730*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2731*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send wlan config request, err = %d\n",
2732*5c1def83SBjoern A. Zeeb 			    ret);
2733*5c1def83SBjoern A. Zeeb 		goto out;
2734*5c1def83SBjoern A. Zeeb 	}
2735*5c1def83SBjoern A. Zeeb 
2736*5c1def83SBjoern A. Zeeb 	ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH12K_QMI_WLANFW_TIMEOUT_MS));
2737*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2738*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed wlan config request, err = %d\n", ret);
2739*5c1def83SBjoern A. Zeeb 		goto out;
2740*5c1def83SBjoern A. Zeeb 	}
2741*5c1def83SBjoern A. Zeeb 
2742*5c1def83SBjoern A. Zeeb 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
2743*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi wlan config request failed, result: %d, err: %d\n",
2744*5c1def83SBjoern A. Zeeb 			    resp.resp.result, resp.resp.error);
2745*5c1def83SBjoern A. Zeeb 		ret = -EINVAL;
2746*5c1def83SBjoern A. Zeeb 		goto out;
2747*5c1def83SBjoern A. Zeeb 	}
2748*5c1def83SBjoern A. Zeeb 
2749*5c1def83SBjoern A. Zeeb out:
2750*5c1def83SBjoern A. Zeeb 	kfree(req);
2751*5c1def83SBjoern A. Zeeb 	return ret;
2752*5c1def83SBjoern A. Zeeb }
2753*5c1def83SBjoern A. Zeeb 
ath12k_qmi_firmware_stop(struct ath12k_base * ab)2754*5c1def83SBjoern A. Zeeb void ath12k_qmi_firmware_stop(struct ath12k_base *ab)
2755*5c1def83SBjoern A. Zeeb {
2756*5c1def83SBjoern A. Zeeb 	int ret;
2757*5c1def83SBjoern A. Zeeb 
2758*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_wlanfw_mode_send(ab, ATH12K_FIRMWARE_MODE_OFF);
2759*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2760*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send wlan mode off\n");
2761*5c1def83SBjoern A. Zeeb 		return;
2762*5c1def83SBjoern A. Zeeb 	}
2763*5c1def83SBjoern A. Zeeb }
2764*5c1def83SBjoern A. Zeeb 
ath12k_qmi_firmware_start(struct ath12k_base * ab,u32 mode)2765*5c1def83SBjoern A. Zeeb int ath12k_qmi_firmware_start(struct ath12k_base *ab,
2766*5c1def83SBjoern A. Zeeb 			      u32 mode)
2767*5c1def83SBjoern A. Zeeb {
2768*5c1def83SBjoern A. Zeeb 	int ret;
2769*5c1def83SBjoern A. Zeeb 
2770*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_wlanfw_wlan_cfg_send(ab);
2771*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2772*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send wlan cfg:%d\n", ret);
2773*5c1def83SBjoern A. Zeeb 		return ret;
2774*5c1def83SBjoern A. Zeeb 	}
2775*5c1def83SBjoern A. Zeeb 
2776*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_wlanfw_mode_send(ab, mode);
2777*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2778*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret);
2779*5c1def83SBjoern A. Zeeb 		return ret;
2780*5c1def83SBjoern A. Zeeb 	}
2781*5c1def83SBjoern A. Zeeb 
2782*5c1def83SBjoern A. Zeeb 	return 0;
2783*5c1def83SBjoern A. Zeeb }
2784*5c1def83SBjoern A. Zeeb 
2785*5c1def83SBjoern A. Zeeb static int
ath12k_qmi_driver_event_post(struct ath12k_qmi * qmi,enum ath12k_qmi_event_type type,void * data)2786*5c1def83SBjoern A. Zeeb ath12k_qmi_driver_event_post(struct ath12k_qmi *qmi,
2787*5c1def83SBjoern A. Zeeb 			     enum ath12k_qmi_event_type type,
2788*5c1def83SBjoern A. Zeeb 			     void *data)
2789*5c1def83SBjoern A. Zeeb {
2790*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi_driver_event *event;
2791*5c1def83SBjoern A. Zeeb 
2792*5c1def83SBjoern A. Zeeb 	event = kzalloc(sizeof(*event), GFP_ATOMIC);
2793*5c1def83SBjoern A. Zeeb 	if (!event)
2794*5c1def83SBjoern A. Zeeb 		return -ENOMEM;
2795*5c1def83SBjoern A. Zeeb 
2796*5c1def83SBjoern A. Zeeb 	event->type = type;
2797*5c1def83SBjoern A. Zeeb 	event->data = data;
2798*5c1def83SBjoern A. Zeeb 
2799*5c1def83SBjoern A. Zeeb 	spin_lock(&qmi->event_lock);
2800*5c1def83SBjoern A. Zeeb 	list_add_tail(&event->list, &qmi->event_list);
2801*5c1def83SBjoern A. Zeeb 	spin_unlock(&qmi->event_lock);
2802*5c1def83SBjoern A. Zeeb 
2803*5c1def83SBjoern A. Zeeb 	queue_work(qmi->event_wq, &qmi->event_work);
2804*5c1def83SBjoern A. Zeeb 
2805*5c1def83SBjoern A. Zeeb 	return 0;
2806*5c1def83SBjoern A. Zeeb }
2807*5c1def83SBjoern A. Zeeb 
ath12k_qmi_event_server_arrive(struct ath12k_qmi * qmi)2808*5c1def83SBjoern A. Zeeb static int ath12k_qmi_event_server_arrive(struct ath12k_qmi *qmi)
2809*5c1def83SBjoern A. Zeeb {
2810*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2811*5c1def83SBjoern A. Zeeb 	int ret;
2812*5c1def83SBjoern A. Zeeb 
2813*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_fw_ind_register_send(ab);
2814*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2815*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send FW indication QMI:%d\n", ret);
2816*5c1def83SBjoern A. Zeeb 		return ret;
2817*5c1def83SBjoern A. Zeeb 	}
2818*5c1def83SBjoern A. Zeeb 
2819*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_host_cap_send(ab);
2820*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2821*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send host cap QMI:%d\n", ret);
2822*5c1def83SBjoern A. Zeeb 		return ret;
2823*5c1def83SBjoern A. Zeeb 	}
2824*5c1def83SBjoern A. Zeeb 
2825*5c1def83SBjoern A. Zeeb 	return ret;
2826*5c1def83SBjoern A. Zeeb }
2827*5c1def83SBjoern A. Zeeb 
ath12k_qmi_event_mem_request(struct ath12k_qmi * qmi)2828*5c1def83SBjoern A. Zeeb static int ath12k_qmi_event_mem_request(struct ath12k_qmi *qmi)
2829*5c1def83SBjoern A. Zeeb {
2830*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2831*5c1def83SBjoern A. Zeeb 	int ret;
2832*5c1def83SBjoern A. Zeeb 
2833*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_respond_fw_mem_request(ab);
2834*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2835*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to respond fw mem req:%d\n", ret);
2836*5c1def83SBjoern A. Zeeb 		return ret;
2837*5c1def83SBjoern A. Zeeb 	}
2838*5c1def83SBjoern A. Zeeb 
2839*5c1def83SBjoern A. Zeeb 	return ret;
2840*5c1def83SBjoern A. Zeeb }
2841*5c1def83SBjoern A. Zeeb 
ath12k_qmi_event_load_bdf(struct ath12k_qmi * qmi)2842*5c1def83SBjoern A. Zeeb static int ath12k_qmi_event_load_bdf(struct ath12k_qmi *qmi)
2843*5c1def83SBjoern A. Zeeb {
2844*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2845*5c1def83SBjoern A. Zeeb 	int ret;
2846*5c1def83SBjoern A. Zeeb 
2847*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_request_target_cap(ab);
2848*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2849*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to req target capabilities:%d\n", ret);
2850*5c1def83SBjoern A. Zeeb 		return ret;
2851*5c1def83SBjoern A. Zeeb 	}
2852*5c1def83SBjoern A. Zeeb 
2853*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_load_bdf_qmi(ab, ATH12K_QMI_BDF_TYPE_REGDB);
2854*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2855*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to load regdb file:%d\n", ret);
2856*5c1def83SBjoern A. Zeeb 		return ret;
2857*5c1def83SBjoern A. Zeeb 	}
2858*5c1def83SBjoern A. Zeeb 
2859*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_load_bdf_qmi(ab, ATH12K_QMI_BDF_TYPE_ELF);
2860*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2861*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to load board data file:%d\n", ret);
2862*5c1def83SBjoern A. Zeeb 		return ret;
2863*5c1def83SBjoern A. Zeeb 	}
2864*5c1def83SBjoern A. Zeeb 
2865*5c1def83SBjoern A. Zeeb 	if (ab->hw_params->download_calib) {
2866*5c1def83SBjoern A. Zeeb 		ret = ath12k_qmi_load_bdf_qmi(ab, ATH12K_QMI_BDF_TYPE_CALIBRATION);
2867*5c1def83SBjoern A. Zeeb 		if (ret < 0)
2868*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "qmi failed to load calibrated data :%d\n", ret);
2869*5c1def83SBjoern A. Zeeb 	}
2870*5c1def83SBjoern A. Zeeb 
2871*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_wlanfw_m3_info_send(ab);
2872*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
2873*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to send m3 info req:%d\n", ret);
2874*5c1def83SBjoern A. Zeeb 		return ret;
2875*5c1def83SBjoern A. Zeeb 	}
2876*5c1def83SBjoern A. Zeeb 
2877*5c1def83SBjoern A. Zeeb 	return ret;
2878*5c1def83SBjoern A. Zeeb }
2879*5c1def83SBjoern A. Zeeb 
ath12k_qmi_msg_mem_request_cb(struct qmi_handle * qmi_hdl,struct sockaddr_qrtr * sq,struct qmi_txn * txn,const void * data)2880*5c1def83SBjoern A. Zeeb static void ath12k_qmi_msg_mem_request_cb(struct qmi_handle *qmi_hdl,
2881*5c1def83SBjoern A. Zeeb 					  struct sockaddr_qrtr *sq,
2882*5c1def83SBjoern A. Zeeb 					  struct qmi_txn *txn,
2883*5c1def83SBjoern A. Zeeb 					  const void *data)
2884*5c1def83SBjoern A. Zeeb {
2885*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle);
2886*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2887*5c1def83SBjoern A. Zeeb 	const struct qmi_wlanfw_request_mem_ind_msg_v01 *msg = data;
2888*5c1def83SBjoern A. Zeeb 	int i, ret;
2889*5c1def83SBjoern A. Zeeb 
2890*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware request memory request\n");
2891*5c1def83SBjoern A. Zeeb 
2892*5c1def83SBjoern A. Zeeb 	if (msg->mem_seg_len == 0 ||
2893*5c1def83SBjoern A. Zeeb 	    msg->mem_seg_len > ATH12K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01)
2894*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "Invalid memory segment length: %u\n",
2895*5c1def83SBjoern A. Zeeb 			    msg->mem_seg_len);
2896*5c1def83SBjoern A. Zeeb 
2897*5c1def83SBjoern A. Zeeb 	ab->qmi.mem_seg_count = msg->mem_seg_len;
2898*5c1def83SBjoern A. Zeeb 
2899*5c1def83SBjoern A. Zeeb 	for (i = 0; i < qmi->mem_seg_count ; i++) {
2900*5c1def83SBjoern A. Zeeb 		ab->qmi.target_mem[i].type = msg->mem_seg[i].type;
2901*5c1def83SBjoern A. Zeeb 		ab->qmi.target_mem[i].size = msg->mem_seg[i].size;
2902*5c1def83SBjoern A. Zeeb 		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi mem seg type %d size %d\n",
2903*5c1def83SBjoern A. Zeeb 			   msg->mem_seg[i].type, msg->mem_seg[i].size);
2904*5c1def83SBjoern A. Zeeb 	}
2905*5c1def83SBjoern A. Zeeb 
2906*5c1def83SBjoern A. Zeeb 	ret = ath12k_qmi_alloc_target_mem_chunk(ab);
2907*5c1def83SBjoern A. Zeeb 	if (ret) {
2908*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to alloc target memory: %d\n",
2909*5c1def83SBjoern A. Zeeb 			    ret);
2910*5c1def83SBjoern A. Zeeb 		return;
2911*5c1def83SBjoern A. Zeeb 	}
2912*5c1def83SBjoern A. Zeeb 
2913*5c1def83SBjoern A. Zeeb 	ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_REQUEST_MEM, NULL);
2914*5c1def83SBjoern A. Zeeb }
2915*5c1def83SBjoern A. Zeeb 
ath12k_qmi_msg_mem_ready_cb(struct qmi_handle * qmi_hdl,struct sockaddr_qrtr * sq,struct qmi_txn * txn,const void * decoded)2916*5c1def83SBjoern A. Zeeb static void ath12k_qmi_msg_mem_ready_cb(struct qmi_handle *qmi_hdl,
2917*5c1def83SBjoern A. Zeeb 					struct sockaddr_qrtr *sq,
2918*5c1def83SBjoern A. Zeeb 					struct qmi_txn *txn,
2919*5c1def83SBjoern A. Zeeb 					const void *decoded)
2920*5c1def83SBjoern A. Zeeb {
2921*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle);
2922*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2923*5c1def83SBjoern A. Zeeb 
2924*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware memory ready indication\n");
2925*5c1def83SBjoern A. Zeeb 	ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_FW_MEM_READY, NULL);
2926*5c1def83SBjoern A. Zeeb }
2927*5c1def83SBjoern A. Zeeb 
ath12k_qmi_msg_fw_ready_cb(struct qmi_handle * qmi_hdl,struct sockaddr_qrtr * sq,struct qmi_txn * txn,const void * decoded)2928*5c1def83SBjoern A. Zeeb static void ath12k_qmi_msg_fw_ready_cb(struct qmi_handle *qmi_hdl,
2929*5c1def83SBjoern A. Zeeb 				       struct sockaddr_qrtr *sq,
2930*5c1def83SBjoern A. Zeeb 				       struct qmi_txn *txn,
2931*5c1def83SBjoern A. Zeeb 				       const void *decoded)
2932*5c1def83SBjoern A. Zeeb {
2933*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle);
2934*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2935*5c1def83SBjoern A. Zeeb 
2936*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware ready\n");
2937*5c1def83SBjoern A. Zeeb 	ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_FW_READY, NULL);
2938*5c1def83SBjoern A. Zeeb }
2939*5c1def83SBjoern A. Zeeb 
2940*5c1def83SBjoern A. Zeeb static const struct qmi_msg_handler ath12k_qmi_msg_handlers[] = {
2941*5c1def83SBjoern A. Zeeb 	{
2942*5c1def83SBjoern A. Zeeb 		.type = QMI_INDICATION,
2943*5c1def83SBjoern A. Zeeb 		.msg_id = QMI_WLFW_REQUEST_MEM_IND_V01,
2944*5c1def83SBjoern A. Zeeb 		.ei = qmi_wlanfw_request_mem_ind_msg_v01_ei,
2945*5c1def83SBjoern A. Zeeb 		.decoded_size = sizeof(struct qmi_wlanfw_request_mem_ind_msg_v01),
2946*5c1def83SBjoern A. Zeeb 		.fn = ath12k_qmi_msg_mem_request_cb,
2947*5c1def83SBjoern A. Zeeb 	},
2948*5c1def83SBjoern A. Zeeb 	{
2949*5c1def83SBjoern A. Zeeb 		.type = QMI_INDICATION,
2950*5c1def83SBjoern A. Zeeb 		.msg_id = QMI_WLFW_FW_MEM_READY_IND_V01,
2951*5c1def83SBjoern A. Zeeb 		.ei = qmi_wlanfw_mem_ready_ind_msg_v01_ei,
2952*5c1def83SBjoern A. Zeeb 		.decoded_size = sizeof(struct qmi_wlanfw_fw_mem_ready_ind_msg_v01),
2953*5c1def83SBjoern A. Zeeb 		.fn = ath12k_qmi_msg_mem_ready_cb,
2954*5c1def83SBjoern A. Zeeb 	},
2955*5c1def83SBjoern A. Zeeb 	{
2956*5c1def83SBjoern A. Zeeb 		.type = QMI_INDICATION,
2957*5c1def83SBjoern A. Zeeb 		.msg_id = QMI_WLFW_FW_READY_IND_V01,
2958*5c1def83SBjoern A. Zeeb 		.ei = qmi_wlanfw_fw_ready_ind_msg_v01_ei,
2959*5c1def83SBjoern A. Zeeb 		.decoded_size = sizeof(struct qmi_wlanfw_fw_ready_ind_msg_v01),
2960*5c1def83SBjoern A. Zeeb 		.fn = ath12k_qmi_msg_fw_ready_cb,
2961*5c1def83SBjoern A. Zeeb 	},
2962*5c1def83SBjoern A. Zeeb };
2963*5c1def83SBjoern A. Zeeb 
ath12k_qmi_ops_new_server(struct qmi_handle * qmi_hdl,struct qmi_service * service)2964*5c1def83SBjoern A. Zeeb static int ath12k_qmi_ops_new_server(struct qmi_handle *qmi_hdl,
2965*5c1def83SBjoern A. Zeeb 				     struct qmi_service *service)
2966*5c1def83SBjoern A. Zeeb {
2967*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle);
2968*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2969*5c1def83SBjoern A. Zeeb 	struct sockaddr_qrtr *sq = &qmi->sq;
2970*5c1def83SBjoern A. Zeeb 	int ret;
2971*5c1def83SBjoern A. Zeeb 
2972*5c1def83SBjoern A. Zeeb 	sq->sq_family = AF_QIPCRTR;
2973*5c1def83SBjoern A. Zeeb 	sq->sq_node = service->node;
2974*5c1def83SBjoern A. Zeeb 	sq->sq_port = service->port;
2975*5c1def83SBjoern A. Zeeb 
2976*5c1def83SBjoern A. Zeeb 	ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)sq,
2977*5c1def83SBjoern A. Zeeb 			     sizeof(*sq), 0);
2978*5c1def83SBjoern A. Zeeb 	if (ret) {
2979*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "qmi failed to connect to remote service %d\n", ret);
2980*5c1def83SBjoern A. Zeeb 		return ret;
2981*5c1def83SBjoern A. Zeeb 	}
2982*5c1def83SBjoern A. Zeeb 
2983*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw qmi service connected\n");
2984*5c1def83SBjoern A. Zeeb 	ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_SERVER_ARRIVE, NULL);
2985*5c1def83SBjoern A. Zeeb 
2986*5c1def83SBjoern A. Zeeb 	return ret;
2987*5c1def83SBjoern A. Zeeb }
2988*5c1def83SBjoern A. Zeeb 
ath12k_qmi_ops_del_server(struct qmi_handle * qmi_hdl,struct qmi_service * service)2989*5c1def83SBjoern A. Zeeb static void ath12k_qmi_ops_del_server(struct qmi_handle *qmi_hdl,
2990*5c1def83SBjoern A. Zeeb 				      struct qmi_service *service)
2991*5c1def83SBjoern A. Zeeb {
2992*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle);
2993*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
2994*5c1def83SBjoern A. Zeeb 
2995*5c1def83SBjoern A. Zeeb 	ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw del server\n");
2996*5c1def83SBjoern A. Zeeb 	ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_SERVER_EXIT, NULL);
2997*5c1def83SBjoern A. Zeeb }
2998*5c1def83SBjoern A. Zeeb 
2999*5c1def83SBjoern A. Zeeb static const struct qmi_ops ath12k_qmi_ops = {
3000*5c1def83SBjoern A. Zeeb 	.new_server = ath12k_qmi_ops_new_server,
3001*5c1def83SBjoern A. Zeeb 	.del_server = ath12k_qmi_ops_del_server,
3002*5c1def83SBjoern A. Zeeb };
3003*5c1def83SBjoern A. Zeeb 
ath12k_qmi_driver_event_work(struct work_struct * work)3004*5c1def83SBjoern A. Zeeb static void ath12k_qmi_driver_event_work(struct work_struct *work)
3005*5c1def83SBjoern A. Zeeb {
3006*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi *qmi = container_of(work, struct ath12k_qmi,
3007*5c1def83SBjoern A. Zeeb 					      event_work);
3008*5c1def83SBjoern A. Zeeb 	struct ath12k_qmi_driver_event *event;
3009*5c1def83SBjoern A. Zeeb 	struct ath12k_base *ab = qmi->ab;
3010*5c1def83SBjoern A. Zeeb 	int ret;
3011*5c1def83SBjoern A. Zeeb 
3012*5c1def83SBjoern A. Zeeb 	spin_lock(&qmi->event_lock);
3013*5c1def83SBjoern A. Zeeb 	while (!list_empty(&qmi->event_list)) {
3014*5c1def83SBjoern A. Zeeb 		event = list_first_entry(&qmi->event_list,
3015*5c1def83SBjoern A. Zeeb 					 struct ath12k_qmi_driver_event, list);
3016*5c1def83SBjoern A. Zeeb 		list_del(&event->list);
3017*5c1def83SBjoern A. Zeeb 		spin_unlock(&qmi->event_lock);
3018*5c1def83SBjoern A. Zeeb 
3019*5c1def83SBjoern A. Zeeb 		if (test_bit(ATH12K_FLAG_UNREGISTERING, &ab->dev_flags))
3020*5c1def83SBjoern A. Zeeb 			goto skip;
3021*5c1def83SBjoern A. Zeeb 
3022*5c1def83SBjoern A. Zeeb 		switch (event->type) {
3023*5c1def83SBjoern A. Zeeb 		case ATH12K_QMI_EVENT_SERVER_ARRIVE:
3024*5c1def83SBjoern A. Zeeb 			ret = ath12k_qmi_event_server_arrive(qmi);
3025*5c1def83SBjoern A. Zeeb 			if (ret < 0)
3026*5c1def83SBjoern A. Zeeb 				set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags);
3027*5c1def83SBjoern A. Zeeb 			break;
3028*5c1def83SBjoern A. Zeeb 		case ATH12K_QMI_EVENT_SERVER_EXIT:
3029*5c1def83SBjoern A. Zeeb 			set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags);
3030*5c1def83SBjoern A. Zeeb 			set_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags);
3031*5c1def83SBjoern A. Zeeb 			break;
3032*5c1def83SBjoern A. Zeeb 		case ATH12K_QMI_EVENT_REQUEST_MEM:
3033*5c1def83SBjoern A. Zeeb 			ret = ath12k_qmi_event_mem_request(qmi);
3034*5c1def83SBjoern A. Zeeb 			if (ret < 0)
3035*5c1def83SBjoern A. Zeeb 				set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags);
3036*5c1def83SBjoern A. Zeeb 			break;
3037*5c1def83SBjoern A. Zeeb 		case ATH12K_QMI_EVENT_FW_MEM_READY:
3038*5c1def83SBjoern A. Zeeb 			ret = ath12k_qmi_event_load_bdf(qmi);
3039*5c1def83SBjoern A. Zeeb 			if (ret < 0)
3040*5c1def83SBjoern A. Zeeb 				set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags);
3041*5c1def83SBjoern A. Zeeb 			break;
3042*5c1def83SBjoern A. Zeeb 		case ATH12K_QMI_EVENT_FW_READY:
3043*5c1def83SBjoern A. Zeeb 			clear_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags);
3044*5c1def83SBjoern A. Zeeb 			if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) {
3045*5c1def83SBjoern A. Zeeb 				ath12k_hal_dump_srng_stats(ab);
3046*5c1def83SBjoern A. Zeeb 				queue_work(ab->workqueue, &ab->restart_work);
3047*5c1def83SBjoern A. Zeeb 				break;
3048*5c1def83SBjoern A. Zeeb 			}
3049*5c1def83SBjoern A. Zeeb 
3050*5c1def83SBjoern A. Zeeb 			clear_bit(ATH12K_FLAG_CRASH_FLUSH,
3051*5c1def83SBjoern A. Zeeb 				  &ab->dev_flags);
3052*5c1def83SBjoern A. Zeeb 			clear_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags);
3053*5c1def83SBjoern A. Zeeb 			ath12k_core_qmi_firmware_ready(ab);
3054*5c1def83SBjoern A. Zeeb 			set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);
3055*5c1def83SBjoern A. Zeeb 
3056*5c1def83SBjoern A. Zeeb 			break;
3057*5c1def83SBjoern A. Zeeb 		default:
3058*5c1def83SBjoern A. Zeeb 			ath12k_warn(ab, "invalid event type: %d", event->type);
3059*5c1def83SBjoern A. Zeeb 			break;
3060*5c1def83SBjoern A. Zeeb 		}
3061*5c1def83SBjoern A. Zeeb 
3062*5c1def83SBjoern A. Zeeb skip:
3063*5c1def83SBjoern A. Zeeb 		kfree(event);
3064*5c1def83SBjoern A. Zeeb 		spin_lock(&qmi->event_lock);
3065*5c1def83SBjoern A. Zeeb 	}
3066*5c1def83SBjoern A. Zeeb 	spin_unlock(&qmi->event_lock);
3067*5c1def83SBjoern A. Zeeb }
3068*5c1def83SBjoern A. Zeeb 
ath12k_qmi_init_service(struct ath12k_base * ab)3069*5c1def83SBjoern A. Zeeb int ath12k_qmi_init_service(struct ath12k_base *ab)
3070*5c1def83SBjoern A. Zeeb {
3071*5c1def83SBjoern A. Zeeb 	int ret;
3072*5c1def83SBjoern A. Zeeb 
3073*5c1def83SBjoern A. Zeeb 	memset(&ab->qmi.target, 0, sizeof(struct target_info));
3074*5c1def83SBjoern A. Zeeb 	memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk));
3075*5c1def83SBjoern A. Zeeb 	ab->qmi.ab = ab;
3076*5c1def83SBjoern A. Zeeb 
3077*5c1def83SBjoern A. Zeeb 	ab->qmi.target_mem_mode = ATH12K_QMI_TARGET_MEM_MODE_DEFAULT;
3078*5c1def83SBjoern A. Zeeb 	ret = qmi_handle_init(&ab->qmi.handle, ATH12K_QMI_RESP_LEN_MAX,
3079*5c1def83SBjoern A. Zeeb 			      &ath12k_qmi_ops, ath12k_qmi_msg_handlers);
3080*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
3081*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "failed to initialize qmi handle\n");
3082*5c1def83SBjoern A. Zeeb 		return ret;
3083*5c1def83SBjoern A. Zeeb 	}
3084*5c1def83SBjoern A. Zeeb 
3085*5c1def83SBjoern A. Zeeb 	ab->qmi.event_wq = alloc_ordered_workqueue("ath12k_qmi_driver_event", 0);
3086*5c1def83SBjoern A. Zeeb 	if (!ab->qmi.event_wq) {
3087*5c1def83SBjoern A. Zeeb 		ath12k_err(ab, "failed to allocate workqueue\n");
3088*5c1def83SBjoern A. Zeeb 		return -EFAULT;
3089*5c1def83SBjoern A. Zeeb 	}
3090*5c1def83SBjoern A. Zeeb 
3091*5c1def83SBjoern A. Zeeb 	INIT_LIST_HEAD(&ab->qmi.event_list);
3092*5c1def83SBjoern A. Zeeb 	spin_lock_init(&ab->qmi.event_lock);
3093*5c1def83SBjoern A. Zeeb 	INIT_WORK(&ab->qmi.event_work, ath12k_qmi_driver_event_work);
3094*5c1def83SBjoern A. Zeeb 
3095*5c1def83SBjoern A. Zeeb 	ret = qmi_add_lookup(&ab->qmi.handle, ATH12K_QMI_WLFW_SERVICE_ID_V01,
3096*5c1def83SBjoern A. Zeeb 			     ATH12K_QMI_WLFW_SERVICE_VERS_V01,
3097*5c1def83SBjoern A. Zeeb 			     ab->qmi.service_ins_id);
3098*5c1def83SBjoern A. Zeeb 	if (ret < 0) {
3099*5c1def83SBjoern A. Zeeb 		ath12k_warn(ab, "failed to add qmi lookup\n");
3100*5c1def83SBjoern A. Zeeb 		destroy_workqueue(ab->qmi.event_wq);
3101*5c1def83SBjoern A. Zeeb 		return ret;
3102*5c1def83SBjoern A. Zeeb 	}
3103*5c1def83SBjoern A. Zeeb 
3104*5c1def83SBjoern A. Zeeb 	return ret;
3105*5c1def83SBjoern A. Zeeb }
3106*5c1def83SBjoern A. Zeeb 
ath12k_qmi_deinit_service(struct ath12k_base * ab)3107*5c1def83SBjoern A. Zeeb void ath12k_qmi_deinit_service(struct ath12k_base *ab)
3108*5c1def83SBjoern A. Zeeb {
3109*5c1def83SBjoern A. Zeeb 	qmi_handle_release(&ab->qmi.handle);
3110*5c1def83SBjoern A. Zeeb 	cancel_work_sync(&ab->qmi.event_work);
3111*5c1def83SBjoern A. Zeeb 	destroy_workqueue(ab->qmi.event_wq);
3112*5c1def83SBjoern A. Zeeb 	ath12k_qmi_m3_free(ab);
3113*5c1def83SBjoern A. Zeeb 	ath12k_qmi_free_target_mem_chunk(ab);
3114*5c1def83SBjoern A. Zeeb }
3115