blob: fa5e5781c7c1c3bb7a8a0dfaf7aab72574c240cb [file] [log] [blame]
Channagoud Kadabi4d480b02016-12-20 11:57:51 -08001/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef SERVICE_REGISTRY_NOTIFIER_H
14#define SERVICE_REGISTRY_NOTIFIER_H
15
16#include <linux/qmi_encdec.h>
17
18#include <soc/qcom/msm_qmi_interface.h>
19
20#define SERVREG_NOTIF_SERVICE_ID_V01 0x42
21#define SERVREG_NOTIF_SERVICE_VERS_V01 0x01
22
23#define QMI_SERVREG_NOTIF_REGISTER_LISTENER_REQ_V01 0x0020
24#define QMI_SERVREG_NOTIF_REGISTER_LISTENER_RESP_V01 0x0020
25#define QMI_SERVREG_NOTIF_QUERY_STATE_REQ_V01 0x0021
26#define QMI_SERVREG_NOTIF_QUERY_STATE_RESP_V01 0x0021
27#define QMI_SERVREG_NOTIF_STATE_UPDATED_IND_V01 0x0022
28#define QMI_SERVREG_NOTIF_STATE_UPDATED_IND_ACK_REQ_V01 0x0023
29#define QMI_SERVREG_NOTIF_STATE_UPDATED_IND_ACK_RESP_V01 0x0023
30#define QMI_SERVREG_NOTIF_RESTART_PD_REQ_V01 0x0024
31#define QMI_SERVREG_NOTIF_RESTART_PD_RESP_V01 0x0024
32
33#define QMI_SERVREG_NOTIF_NAME_LENGTH_V01 64
34
35struct qmi_servreg_notif_register_listener_req_msg_v01 {
36 uint8_t enable;
37 char service_name[QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1];
38};
39#define QMI_SERVREG_NOTIF_REGISTER_LISTENER_REQ_MSG_V01_MAX_MSG_LEN 71
40struct elem_info qmi_servreg_notif_register_listener_req_msg_v01_ei[];
41
42struct qmi_servreg_notif_register_listener_resp_msg_v01 {
43 struct qmi_response_type_v01 resp;
44 uint8_t curr_state_valid;
45 enum qmi_servreg_notif_service_state_enum_type_v01 curr_state;
46};
47#define QMI_SERVREG_NOTIF_REGISTER_LISTENER_RESP_MSG_V01_MAX_MSG_LEN 14
48struct elem_info qmi_servreg_notif_register_listener_resp_msg_v01_ei[];
49
50struct qmi_servreg_notif_query_state_req_msg_v01 {
51 char service_name[QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1];
52};
53#define QMI_SERVREG_NOTIF_QUERY_STATE_REQ_MSG_V01_MAX_MSG_LEN 67
54struct elem_info qmi_servreg_notif_query_state_req_msg_v01_ei[];
55
56struct qmi_servreg_notif_query_state_resp_msg_v01 {
57 struct qmi_response_type_v01 resp;
58 uint8_t curr_state_valid;
59 enum qmi_servreg_notif_service_state_enum_type_v01 curr_state;
60};
61#define QMI_SERVREG_NOTIF_QUERY_STATE_RESP_MSG_V01_MAX_MSG_LEN 14
62struct elem_info qmi_servreg_notif_query_state_resp_msg_v01_ei[];
63
64struct qmi_servreg_notif_state_updated_ind_msg_v01 {
65 enum qmi_servreg_notif_service_state_enum_type_v01 curr_state;
66 char service_name[QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1];
67 uint16_t transaction_id;
68};
69#define QMI_SERVREG_NOTIF_STATE_UPDATED_IND_MSG_V01_MAX_MSG_LEN 79
70struct elem_info qmi_servreg_notif_state_updated_ind_msg_v01_ei[];
71
72struct qmi_servreg_notif_set_ack_req_msg_v01 {
73 char service_name[QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1];
74 uint16_t transaction_id;
75};
76#define QMI_SERVREG_NOTIF_SET_ACK_REQ_MSG_V01_MAX_MSG_LEN 72
77struct elem_info qmi_servreg_notif_set_ack_req_msg_v01_ei[];
78
79struct qmi_servreg_notif_set_ack_resp_msg_v01 {
80 struct qmi_response_type_v01 resp;
81};
82#define QMI_SERVREG_NOTIF_SET_ACK_RESP_MSG_V01_MAX_MSG_LEN 7
83struct elem_info qmi_servreg_notif_set_ack_resp_msg_v01_ei[];
84
85struct qmi_servreg_notif_restart_pd_req_msg_v01 {
86 char service_name[QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1];
87};
88#define QMI_SERVREG_NOTIF_RESTART_PD_REQ_MSG_V01_MAX_MSG_LEN 67
89extern struct elem_info qmi_servreg_notif_restart_pd_req_msg_v01_ei[];
90
91struct qmi_servreg_notif_restart_pd_resp_msg_v01 {
92 struct qmi_response_type_v01 resp;
93};
94#define QMI_SERVREG_NOTIF_RESTART_PD_RESP_MSG_V01_MAX_MSG_LEN 7
95extern struct elem_info qmi_servreg_notif_restart_pd_resp_msg_v01_ei[];
96
97struct elem_info qmi_servreg_notif_register_listener_req_msg_v01_ei[] = {
98 {
99 .data_type = QMI_UNSIGNED_1_BYTE,
100 .elem_len = 1,
101 .elem_size = sizeof(uint8_t),
102 .is_array = NO_ARRAY,
103 .tlv_type = 0x01,
104 .offset = offsetof(struct
105 qmi_servreg_notif_register_listener_req_msg_v01,
106 enable),
107 },
108 {
109 .data_type = QMI_STRING,
110 .elem_len = QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1,
111 .elem_size = sizeof(char),
112 .is_array = NO_ARRAY,
113 .tlv_type = 0x02,
114 .offset = offsetof(struct
115 qmi_servreg_notif_register_listener_req_msg_v01,
116 service_name),
117 },
118 {
119 .data_type = QMI_EOTI,
120 .is_array = NO_ARRAY,
121 .is_array = QMI_COMMON_TLV_TYPE,
122 },
123};
124
125struct elem_info qmi_servreg_notif_register_listener_resp_msg_v01_ei[] = {
126 {
127 .data_type = QMI_STRUCT,
128 .elem_len = 1,
129 .elem_size = sizeof(struct qmi_response_type_v01),
130 .is_array = NO_ARRAY,
131 .tlv_type = 0x02,
132 .offset = offsetof(struct
133 qmi_servreg_notif_register_listener_resp_msg_v01,
134 resp),
135 .ei_array = get_qmi_response_type_v01_ei(),
136 },
137 {
138 .data_type = QMI_OPT_FLAG,
139 .elem_len = 1,
140 .elem_size = sizeof(uint8_t),
141 .is_array = NO_ARRAY,
142 .tlv_type = 0x10,
143 .offset = offsetof(struct
144 qmi_servreg_notif_register_listener_resp_msg_v01,
145 curr_state_valid),
146 },
147 {
148 .data_type = QMI_SIGNED_4_BYTE_ENUM,
149 .elem_len = 1,
150 .elem_size = sizeof(
151 enum qmi_servreg_notif_service_state_enum_type_v01),
152 .is_array = NO_ARRAY,
153 .tlv_type = 0x10,
154 .offset = offsetof(struct
155 qmi_servreg_notif_register_listener_resp_msg_v01,
156 curr_state),
157 },
158 {
159 .data_type = QMI_EOTI,
160 .is_array = NO_ARRAY,
161 .is_array = QMI_COMMON_TLV_TYPE,
162 },
163};
164
165struct elem_info qmi_servreg_notif_query_state_req_msg_v01_ei[] = {
166 {
167 .data_type = QMI_STRING,
168 .elem_len = QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1,
169 .elem_size = sizeof(char),
170 .is_array = NO_ARRAY,
171 .tlv_type = 0x01,
172 .offset = offsetof(struct
173 qmi_servreg_notif_query_state_req_msg_v01,
174 service_name),
175 },
176 {
177 .data_type = QMI_EOTI,
178 .is_array = NO_ARRAY,
179 .is_array = QMI_COMMON_TLV_TYPE,
180 },
181};
182
183struct elem_info qmi_servreg_notif_query_state_resp_msg_v01_ei[] = {
184 {
185 .data_type = QMI_STRUCT,
186 .elem_len = 1,
187 .elem_size = sizeof(struct qmi_response_type_v01),
188 .is_array = NO_ARRAY,
189 .tlv_type = 0x02,
190 .offset = offsetof(struct
191 qmi_servreg_notif_query_state_resp_msg_v01,
192 resp),
193 .ei_array = get_qmi_response_type_v01_ei(),
194 },
195 {
196 .data_type = QMI_OPT_FLAG,
197 .elem_len = 1,
198 .elem_size = sizeof(uint8_t),
199 .is_array = NO_ARRAY,
200 .tlv_type = 0x10,
201 .offset = offsetof(struct
202 qmi_servreg_notif_query_state_resp_msg_v01,
203 curr_state_valid),
204 },
205 {
206 .data_type = QMI_SIGNED_4_BYTE_ENUM,
207 .elem_len = 1,
208 .elem_size = sizeof(enum
209 qmi_servreg_notif_service_state_enum_type_v01),
210 .is_array = NO_ARRAY,
211 .tlv_type = 0x10,
212 .offset = offsetof(struct
213 qmi_servreg_notif_query_state_resp_msg_v01,
214 curr_state),
215 },
216 {
217 .data_type = QMI_EOTI,
218 .is_array = NO_ARRAY,
219 .is_array = QMI_COMMON_TLV_TYPE,
220 },
221};
222
223struct elem_info qmi_servreg_notif_state_updated_ind_msg_v01_ei[] = {
224 {
225 .data_type = QMI_SIGNED_4_BYTE_ENUM,
226 .elem_len = 1,
227 .elem_size = sizeof(enum
228 qmi_servreg_notif_service_state_enum_type_v01),
229 .is_array = NO_ARRAY,
230 .tlv_type = 0x01,
231 .offset = offsetof(struct
232 qmi_servreg_notif_state_updated_ind_msg_v01,
233 curr_state),
234 },
235 {
236 .data_type = QMI_STRING,
237 .elem_len = QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1,
238 .elem_size = sizeof(char),
239 .is_array = NO_ARRAY,
240 .tlv_type = 0x02,
241 .offset = offsetof(struct
242 qmi_servreg_notif_state_updated_ind_msg_v01,
243 service_name),
244 },
245 {
246 .data_type = QMI_UNSIGNED_2_BYTE,
247 .elem_len = 1,
248 .elem_size = sizeof(uint16_t),
249 .is_array = NO_ARRAY,
250 .tlv_type = 0x03,
251 .offset = offsetof(struct
252 qmi_servreg_notif_state_updated_ind_msg_v01,
253 transaction_id),
254 },
255 {
256 .data_type = QMI_EOTI,
257 .is_array = NO_ARRAY,
258 .is_array = QMI_COMMON_TLV_TYPE,
259 },
260};
261
262struct elem_info qmi_servreg_notif_set_ack_req_msg_v01_ei[] = {
263 {
264 .data_type = QMI_STRING,
265 .elem_len = QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1,
266 .elem_size = sizeof(char),
267 .is_array = NO_ARRAY,
268 .tlv_type = 0x01,
269 .offset = offsetof(struct
270 qmi_servreg_notif_set_ack_req_msg_v01,
271 service_name),
272 },
273 {
274 .data_type = QMI_UNSIGNED_2_BYTE,
275 .elem_len = 1,
276 .elem_size = sizeof(uint16_t),
277 .is_array = NO_ARRAY,
278 .tlv_type = 0x02,
279 .offset = offsetof(struct
280 qmi_servreg_notif_set_ack_req_msg_v01,
281 transaction_id),
282 },
283 {
284 .data_type = QMI_EOTI,
285 .is_array = NO_ARRAY,
286 .is_array = QMI_COMMON_TLV_TYPE,
287 },
288};
289
290struct elem_info qmi_servreg_notif_set_ack_resp_msg_v01_ei[] = {
291 {
292 .data_type = QMI_STRUCT,
293 .elem_len = 1,
294 .elem_size = sizeof(struct qmi_response_type_v01),
295 .is_array = NO_ARRAY,
296 .tlv_type = 0x02,
297 .offset = offsetof(struct
298 qmi_servreg_notif_set_ack_resp_msg_v01,
299 resp),
300 .ei_array = get_qmi_response_type_v01_ei(),
301 },
302 {
303 .data_type = QMI_EOTI,
304 .is_array = NO_ARRAY,
305 .is_array = QMI_COMMON_TLV_TYPE,
306 },
307};
308
309struct elem_info qmi_servreg_notif_restart_pd_req_msg_v01_ei[] = {
310 {
311 .data_type = QMI_STRING,
312 .elem_len = QMI_SERVREG_NOTIF_NAME_LENGTH_V01 + 1,
313 .elem_size = sizeof(char),
314 .is_array = NO_ARRAY,
315 .tlv_type = 0x01,
316 .offset = offsetof(struct
317 qmi_servreg_notif_restart_pd_req_msg_v01,
318 service_name),
319 },
320 {
321 .data_type = QMI_EOTI,
322 .is_array = NO_ARRAY,
323 .is_array = QMI_COMMON_TLV_TYPE,
324 },
325};
326
327struct elem_info qmi_servreg_notif_restart_pd_resp_msg_v01_ei[] = {
328 {
329 .data_type = QMI_STRUCT,
330 .elem_len = 1,
331 .elem_size = sizeof(struct qmi_response_type_v01),
332 .is_array = NO_ARRAY,
333 .tlv_type = 0x02,
334 .offset = offsetof(struct
335 qmi_servreg_notif_restart_pd_resp_msg_v01,
336 resp),
337 .ei_array = get_qmi_response_type_v01_ei(),
338 },
339 {
340 .data_type = QMI_EOTI,
341 .is_array = NO_ARRAY,
342 .is_array = QMI_COMMON_TLV_TYPE,
343 },
344};
345#endif