1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __QCOM_PDR_HELPER_INTERNAL__
3 #define __QCOM_PDR_HELPER_INTERNAL__
5 #include <linux/soc/qcom/pdr.h>
7 #define SERVREG_LOCATOR_SERVICE 0x40
8 #define SERVREG_NOTIFIER_SERVICE 0x42
10 #define SERVREG_REGISTER_LISTENER_REQ 0x20
11 #define SERVREG_GET_DOMAIN_LIST_REQ 0x21
12 #define SERVREG_STATE_UPDATED_IND_ID 0x22
13 #define SERVREG_SET_ACK_REQ 0x23
14 #define SERVREG_RESTART_PD_REQ 0x24
16 #define SERVREG_DOMAIN_LIST_LENGTH 32
17 #define SERVREG_RESTART_PD_REQ_MAX_LEN 67
18 #define SERVREG_REGISTER_LISTENER_REQ_LEN 71
19 #define SERVREG_SET_ACK_REQ_LEN 72
20 #define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN 74
21 #define SERVREG_STATE_UPDATED_IND_MAX_LEN 79
22 #define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN 2389
24 struct servreg_location_entry
{
25 char name
[SERVREG_NAME_LENGTH
+ 1];
26 u8 service_data_valid
;
31 struct qmi_elem_info servreg_location_entry_ei
[] = {
33 .data_type
= QMI_STRING
,
34 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
35 .elem_size
= sizeof(char),
36 .array_type
= NO_ARRAY
,
38 .offset
= offsetof(struct servreg_location_entry
,
42 .data_type
= QMI_UNSIGNED_4_BYTE
,
44 .elem_size
= sizeof(u32
),
45 .array_type
= NO_ARRAY
,
47 .offset
= offsetof(struct servreg_location_entry
,
51 .data_type
= QMI_UNSIGNED_1_BYTE
,
53 .elem_size
= sizeof(u8
),
54 .array_type
= NO_ARRAY
,
56 .offset
= offsetof(struct servreg_location_entry
,
60 .data_type
= QMI_UNSIGNED_4_BYTE
,
62 .elem_size
= sizeof(u32
),
63 .array_type
= NO_ARRAY
,
65 .offset
= offsetof(struct servreg_location_entry
,
71 struct servreg_get_domain_list_req
{
72 char service_name
[SERVREG_NAME_LENGTH
+ 1];
73 u8 domain_offset_valid
;
77 struct qmi_elem_info servreg_get_domain_list_req_ei
[] = {
79 .data_type
= QMI_STRING
,
80 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
81 .elem_size
= sizeof(char),
82 .array_type
= NO_ARRAY
,
84 .offset
= offsetof(struct servreg_get_domain_list_req
,
88 .data_type
= QMI_OPT_FLAG
,
90 .elem_size
= sizeof(u8
),
91 .array_type
= NO_ARRAY
,
93 .offset
= offsetof(struct servreg_get_domain_list_req
,
97 .data_type
= QMI_UNSIGNED_4_BYTE
,
99 .elem_size
= sizeof(u32
),
100 .array_type
= NO_ARRAY
,
102 .offset
= offsetof(struct servreg_get_domain_list_req
,
108 struct servreg_get_domain_list_resp
{
109 struct qmi_response_type_v01 resp
;
110 u8 total_domains_valid
;
112 u8 db_rev_count_valid
;
114 u8 domain_list_valid
;
116 struct servreg_location_entry domain_list
[SERVREG_DOMAIN_LIST_LENGTH
];
119 struct qmi_elem_info servreg_get_domain_list_resp_ei
[] = {
121 .data_type
= QMI_STRUCT
,
123 .elem_size
= sizeof(struct qmi_response_type_v01
),
124 .array_type
= NO_ARRAY
,
126 .offset
= offsetof(struct servreg_get_domain_list_resp
,
128 .ei_array
= qmi_response_type_v01_ei
,
131 .data_type
= QMI_OPT_FLAG
,
133 .elem_size
= sizeof(u8
),
134 .array_type
= NO_ARRAY
,
136 .offset
= offsetof(struct servreg_get_domain_list_resp
,
137 total_domains_valid
),
140 .data_type
= QMI_UNSIGNED_2_BYTE
,
142 .elem_size
= sizeof(u16
),
143 .array_type
= NO_ARRAY
,
145 .offset
= offsetof(struct servreg_get_domain_list_resp
,
149 .data_type
= QMI_OPT_FLAG
,
151 .elem_size
= sizeof(u8
),
152 .array_type
= NO_ARRAY
,
154 .offset
= offsetof(struct servreg_get_domain_list_resp
,
158 .data_type
= QMI_UNSIGNED_2_BYTE
,
160 .elem_size
= sizeof(u16
),
161 .array_type
= NO_ARRAY
,
163 .offset
= offsetof(struct servreg_get_domain_list_resp
,
167 .data_type
= QMI_OPT_FLAG
,
169 .elem_size
= sizeof(u8
),
170 .array_type
= NO_ARRAY
,
172 .offset
= offsetof(struct servreg_get_domain_list_resp
,
176 .data_type
= QMI_DATA_LEN
,
178 .elem_size
= sizeof(u8
),
179 .array_type
= NO_ARRAY
,
181 .offset
= offsetof(struct servreg_get_domain_list_resp
,
185 .data_type
= QMI_STRUCT
,
186 .elem_len
= SERVREG_DOMAIN_LIST_LENGTH
,
187 .elem_size
= sizeof(struct servreg_location_entry
),
188 .array_type
= VAR_LEN_ARRAY
,
190 .offset
= offsetof(struct servreg_get_domain_list_resp
,
192 .ei_array
= servreg_location_entry_ei
,
197 struct servreg_register_listener_req
{
199 char service_path
[SERVREG_NAME_LENGTH
+ 1];
202 struct qmi_elem_info servreg_register_listener_req_ei
[] = {
204 .data_type
= QMI_UNSIGNED_1_BYTE
,
206 .elem_size
= sizeof(u8
),
207 .array_type
= NO_ARRAY
,
209 .offset
= offsetof(struct servreg_register_listener_req
,
213 .data_type
= QMI_STRING
,
214 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
215 .elem_size
= sizeof(char),
216 .array_type
= NO_ARRAY
,
218 .offset
= offsetof(struct servreg_register_listener_req
,
224 struct servreg_register_listener_resp
{
225 struct qmi_response_type_v01 resp
;
227 enum servreg_service_state curr_state
;
230 struct qmi_elem_info servreg_register_listener_resp_ei
[] = {
232 .data_type
= QMI_STRUCT
,
234 .elem_size
= sizeof(struct qmi_response_type_v01
),
235 .array_type
= NO_ARRAY
,
237 .offset
= offsetof(struct servreg_register_listener_resp
,
239 .ei_array
= qmi_response_type_v01_ei
,
242 .data_type
= QMI_OPT_FLAG
,
244 .elem_size
= sizeof(u8
),
245 .array_type
= NO_ARRAY
,
247 .offset
= offsetof(struct servreg_register_listener_resp
,
251 .data_type
= QMI_SIGNED_4_BYTE_ENUM
,
253 .elem_size
= sizeof(enum servreg_service_state
),
254 .array_type
= NO_ARRAY
,
256 .offset
= offsetof(struct servreg_register_listener_resp
,
262 struct servreg_restart_pd_req
{
263 char service_path
[SERVREG_NAME_LENGTH
+ 1];
266 struct qmi_elem_info servreg_restart_pd_req_ei
[] = {
268 .data_type
= QMI_STRING
,
269 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
270 .elem_size
= sizeof(char),
271 .array_type
= NO_ARRAY
,
273 .offset
= offsetof(struct servreg_restart_pd_req
,
279 struct servreg_restart_pd_resp
{
280 struct qmi_response_type_v01 resp
;
283 struct qmi_elem_info servreg_restart_pd_resp_ei
[] = {
285 .data_type
= QMI_STRUCT
,
287 .elem_size
= sizeof(struct qmi_response_type_v01
),
288 .array_type
= NO_ARRAY
,
290 .offset
= offsetof(struct servreg_restart_pd_resp
,
292 .ei_array
= qmi_response_type_v01_ei
,
297 struct servreg_state_updated_ind
{
298 enum servreg_service_state curr_state
;
299 char service_path
[SERVREG_NAME_LENGTH
+ 1];
303 struct qmi_elem_info servreg_state_updated_ind_ei
[] = {
305 .data_type
= QMI_SIGNED_4_BYTE_ENUM
,
307 .elem_size
= sizeof(u32
),
308 .array_type
= NO_ARRAY
,
310 .offset
= offsetof(struct servreg_state_updated_ind
,
314 .data_type
= QMI_STRING
,
315 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
316 .elem_size
= sizeof(char),
317 .array_type
= NO_ARRAY
,
319 .offset
= offsetof(struct servreg_state_updated_ind
,
323 .data_type
= QMI_UNSIGNED_2_BYTE
,
325 .elem_size
= sizeof(u16
),
326 .array_type
= NO_ARRAY
,
328 .offset
= offsetof(struct servreg_state_updated_ind
,
334 struct servreg_set_ack_req
{
335 char service_path
[SERVREG_NAME_LENGTH
+ 1];
339 struct qmi_elem_info servreg_set_ack_req_ei
[] = {
341 .data_type
= QMI_STRING
,
342 .elem_len
= SERVREG_NAME_LENGTH
+ 1,
343 .elem_size
= sizeof(char),
344 .array_type
= NO_ARRAY
,
346 .offset
= offsetof(struct servreg_set_ack_req
,
350 .data_type
= QMI_UNSIGNED_2_BYTE
,
352 .elem_size
= sizeof(u16
),
353 .array_type
= NO_ARRAY
,
355 .offset
= offsetof(struct servreg_set_ack_req
,
361 struct servreg_set_ack_resp
{
362 struct qmi_response_type_v01 resp
;
365 struct qmi_elem_info servreg_set_ack_resp_ei
[] = {
367 .data_type
= QMI_STRUCT
,
369 .elem_size
= sizeof(struct qmi_response_type_v01
),
370 .array_type
= NO_ARRAY
,
372 .offset
= offsetof(struct servreg_set_ack_resp
,
374 .ei_array
= qmi_response_type_v01_ei
,