1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2017-2020 NXP
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted provided that the following conditions are met:
9  *
10  * o Redistributions of source code must retain the above copyright notice, this list
11  *   of conditions and the following disclaimer.
12  *
13  * o Redistributions in binary form must reproduce the above copyright notice, this
14  *   list of conditions and the following disclaimer in the documentation and/or
15  *   other materials provided with the distribution.
16  *
17  * o Neither the name of the copyright holder nor the names of its
18  *   contributors may be used to endorse or promote products derived from this
19  *   software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /*!
34  * File containing client-side RPC functions for the PAD service. These
35  * functions are ported to clients that communicate to the SC.
36  *
37  * @addtogroup PAD_SVC
38  * @{
39  */
40 
41 /* Includes */
42 
43 #include "main/types.h"
44 #include "svc/rm/rm_api.h"
45 #include "svc/pad/pad_api.h"
46 #include "../../main/rpc.h"
47 #include "svc/pad/pad_rpc.h"
48 
49 /* Local Defines */
50 
51 /* Local Types */
52 
53 /* Local Functions */
54 
sc_pad_set_mux(sc_ipc_t ipc,sc_pad_t pad,uint8_t mux,sc_pad_config_t config,sc_pad_iso_t iso)55 sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux,
56     sc_pad_config_t config, sc_pad_iso_t iso)
57 {
58     sc_rpc_msg_t msg;
59     sc_err_t err;
60 
61     RPC_VER(&msg) = SC_RPC_VERSION;
62     RPC_SIZE(&msg) = 3U;
63     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
64     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_MUX);
65 
66     RPC_U16(&msg, 0U) = U16(pad);
67     RPC_U8(&msg, 2U) = U8(mux);
68     RPC_U8(&msg, 3U) = U8(config);
69     RPC_U8(&msg, 4U) = U8(iso);
70 
71     sc_call_rpc(ipc, &msg, SC_FALSE);
72 
73     err = (sc_err_t) RPC_R8(&msg);
74 
75     return err;
76 }
77 
sc_pad_get_mux(sc_ipc_t ipc,sc_pad_t pad,uint8_t * mux,sc_pad_config_t * config,sc_pad_iso_t * iso)78 sc_err_t sc_pad_get_mux(sc_ipc_t ipc, sc_pad_t pad, uint8_t *mux,
79     sc_pad_config_t *config, sc_pad_iso_t *iso)
80 {
81     sc_rpc_msg_t msg;
82     sc_err_t err;
83 
84     RPC_VER(&msg) = SC_RPC_VERSION;
85     RPC_SIZE(&msg) = 2U;
86     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
87     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_MUX);
88 
89     RPC_U16(&msg, 0U) = U16(pad);
90 
91     sc_call_rpc(ipc, &msg, SC_FALSE);
92 
93     err = (sc_err_t) RPC_R8(&msg);
94 
95     if (mux != NULL)
96     {
97         *mux = (uint8_t) RPC_U8(&msg, 0U);
98     }
99     if (config != NULL)
100     {
101         *config = (sc_pad_config_t) RPC_U8(&msg, 1U);
102     }
103     if (iso != NULL)
104     {
105         *iso = (sc_pad_iso_t) RPC_U8(&msg, 2U);
106     }
107 
108     return err;
109 }
110 
sc_pad_set_gp(sc_ipc_t ipc,sc_pad_t pad,uint32_t ctrl)111 sc_err_t sc_pad_set_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t ctrl)
112 {
113     sc_rpc_msg_t msg;
114     sc_err_t err;
115 
116     RPC_VER(&msg) = SC_RPC_VERSION;
117     RPC_SIZE(&msg) = 3U;
118     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
119     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_GP);
120 
121     RPC_U32(&msg, 0U) = U32(ctrl);
122     RPC_U16(&msg, 4U) = U16(pad);
123 
124     sc_call_rpc(ipc, &msg, SC_FALSE);
125 
126     err = (sc_err_t) RPC_R8(&msg);
127 
128     return err;
129 }
130 
sc_pad_get_gp(sc_ipc_t ipc,sc_pad_t pad,uint32_t * ctrl)131 sc_err_t sc_pad_get_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t *ctrl)
132 {
133     sc_rpc_msg_t msg;
134     sc_err_t err;
135 
136     RPC_VER(&msg) = SC_RPC_VERSION;
137     RPC_SIZE(&msg) = 2U;
138     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
139     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_GP);
140 
141     RPC_U16(&msg, 0U) = U16(pad);
142 
143     sc_call_rpc(ipc, &msg, SC_FALSE);
144 
145     err = (sc_err_t) RPC_R8(&msg);
146 
147     if (ctrl != NULL)
148     {
149         *ctrl = (uint32_t) RPC_U32(&msg, 0U);
150     }
151 
152     return err;
153 }
154 
sc_pad_set_wakeup(sc_ipc_t ipc,sc_pad_t pad,sc_pad_wakeup_t wakeup)155 sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup)
156 {
157     sc_rpc_msg_t msg;
158     sc_err_t err;
159 
160     RPC_VER(&msg) = SC_RPC_VERSION;
161     RPC_SIZE(&msg) = 2U;
162     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
163     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_WAKEUP);
164 
165     RPC_U16(&msg, 0U) = U16(pad);
166     RPC_U8(&msg, 2U) = U8(wakeup);
167 
168     sc_call_rpc(ipc, &msg, SC_FALSE);
169 
170     err = (sc_err_t) RPC_R8(&msg);
171 
172     return err;
173 }
174 
sc_pad_get_wakeup(sc_ipc_t ipc,sc_pad_t pad,sc_pad_wakeup_t * wakeup)175 sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t *wakeup)
176 {
177     sc_rpc_msg_t msg;
178     sc_err_t err;
179 
180     RPC_VER(&msg) = SC_RPC_VERSION;
181     RPC_SIZE(&msg) = 2U;
182     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
183     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_WAKEUP);
184 
185     RPC_U16(&msg, 0U) = U16(pad);
186 
187     sc_call_rpc(ipc, &msg, SC_FALSE);
188 
189     err = (sc_err_t) RPC_R8(&msg);
190 
191     if (wakeup != NULL)
192     {
193         *wakeup = (sc_pad_wakeup_t) RPC_U8(&msg, 0U);
194     }
195 
196     return err;
197 }
198 
sc_pad_set_all(sc_ipc_t ipc,sc_pad_t pad,uint8_t mux,sc_pad_config_t config,sc_pad_iso_t iso,uint32_t ctrl,sc_pad_wakeup_t wakeup)199 sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux,
200     sc_pad_config_t config, sc_pad_iso_t iso, uint32_t ctrl,
201     sc_pad_wakeup_t wakeup)
202 {
203     sc_rpc_msg_t msg;
204     sc_err_t err;
205 
206     RPC_VER(&msg) = SC_RPC_VERSION;
207     RPC_SIZE(&msg) = 4U;
208     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
209     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_ALL);
210 
211     RPC_U32(&msg, 0U) = U32(ctrl);
212     RPC_U16(&msg, 4U) = U16(pad);
213     RPC_U8(&msg, 6U) = U8(mux);
214     RPC_U8(&msg, 7U) = U8(config);
215     RPC_U8(&msg, 8U) = U8(iso);
216     RPC_U8(&msg, 9U) = U8(wakeup);
217 
218     sc_call_rpc(ipc, &msg, SC_FALSE);
219 
220     err = (sc_err_t) RPC_R8(&msg);
221 
222     return err;
223 }
224 
sc_pad_get_all(sc_ipc_t ipc,sc_pad_t pad,uint8_t * mux,sc_pad_config_t * config,sc_pad_iso_t * iso,uint32_t * ctrl,sc_pad_wakeup_t * wakeup)225 sc_err_t sc_pad_get_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t *mux,
226     sc_pad_config_t *config, sc_pad_iso_t *iso, uint32_t *ctrl,
227     sc_pad_wakeup_t *wakeup)
228 {
229     sc_rpc_msg_t msg;
230     sc_err_t err;
231 
232     RPC_VER(&msg) = SC_RPC_VERSION;
233     RPC_SIZE(&msg) = 2U;
234     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
235     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_ALL);
236 
237     RPC_U16(&msg, 0U) = U16(pad);
238 
239     sc_call_rpc(ipc, &msg, SC_FALSE);
240 
241     err = (sc_err_t) RPC_R8(&msg);
242 
243     if (ctrl != NULL)
244     {
245         *ctrl = (uint32_t) RPC_U32(&msg, 0U);
246     }
247     if (mux != NULL)
248     {
249         *mux = (uint8_t) RPC_U8(&msg, 4U);
250     }
251     if (config != NULL)
252     {
253         *config = (sc_pad_config_t) RPC_U8(&msg, 5U);
254     }
255     if (iso != NULL)
256     {
257         *iso = (sc_pad_iso_t) RPC_U8(&msg, 6U);
258     }
259     if (wakeup != NULL)
260     {
261         *wakeup = (sc_pad_wakeup_t) RPC_U8(&msg, 7U);
262     }
263 
264     return err;
265 }
266 
sc_pad_set(sc_ipc_t ipc,sc_pad_t pad,uint32_t val)267 sc_err_t sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, uint32_t val)
268 {
269     sc_rpc_msg_t msg;
270     sc_err_t err;
271 
272     RPC_VER(&msg) = SC_RPC_VERSION;
273     RPC_SIZE(&msg) = 3U;
274     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
275     RPC_FUNC(&msg) = U8(PAD_FUNC_SET);
276 
277     RPC_U32(&msg, 0U) = U32(val);
278     RPC_U16(&msg, 4U) = U16(pad);
279 
280     sc_call_rpc(ipc, &msg, SC_FALSE);
281 
282     err = (sc_err_t) RPC_R8(&msg);
283 
284     return err;
285 }
286 
sc_pad_get(sc_ipc_t ipc,sc_pad_t pad,uint32_t * val)287 sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val)
288 {
289     sc_rpc_msg_t msg;
290     sc_err_t err;
291 
292     RPC_VER(&msg) = SC_RPC_VERSION;
293     RPC_SIZE(&msg) = 2U;
294     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
295     RPC_FUNC(&msg) = U8(PAD_FUNC_GET);
296 
297     RPC_U16(&msg, 0U) = U16(pad);
298 
299     sc_call_rpc(ipc, &msg, SC_FALSE);
300 
301     err = (sc_err_t) RPC_R8(&msg);
302 
303     if (val != NULL)
304     {
305         *val = (uint32_t) RPC_U32(&msg, 0U);
306     }
307 
308     return err;
309 }
310 
sc_pad_config(sc_ipc_t ipc,sc_pad_t pad,uint32_t val)311 sc_err_t sc_pad_config(sc_ipc_t ipc, sc_pad_t pad, uint32_t val)
312 {
313     sc_rpc_msg_t msg;
314     sc_err_t err;
315 
316     RPC_VER(&msg) = SC_RPC_VERSION;
317     RPC_SIZE(&msg) = 3U;
318     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
319     RPC_FUNC(&msg) = U8(PAD_FUNC_CONFIG);
320 
321     RPC_U32(&msg, 0U) = U32(val);
322     RPC_U16(&msg, 4U) = U16(pad);
323 
324     sc_call_rpc(ipc, &msg, SC_FALSE);
325 
326     err = (sc_err_t) RPC_R8(&msg);
327 
328     return err;
329 }
330 
sc_pad_set_gp_28fdsoi(sc_ipc_t ipc,sc_pad_t pad,sc_pad_28fdsoi_dse_t dse,sc_pad_28fdsoi_ps_t ps)331 sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad,
332     sc_pad_28fdsoi_dse_t dse, sc_pad_28fdsoi_ps_t ps)
333 {
334     sc_rpc_msg_t msg;
335     sc_err_t err;
336 
337     RPC_VER(&msg) = SC_RPC_VERSION;
338     RPC_SIZE(&msg) = 2U;
339     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
340     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_GP_28FDSOI);
341 
342     RPC_U16(&msg, 0U) = U16(pad);
343     RPC_U8(&msg, 2U) = U8(dse);
344     RPC_U8(&msg, 3U) = U8(ps);
345 
346     sc_call_rpc(ipc, &msg, SC_FALSE);
347 
348     err = (sc_err_t) RPC_R8(&msg);
349 
350     return err;
351 }
352 
sc_pad_get_gp_28fdsoi(sc_ipc_t ipc,sc_pad_t pad,sc_pad_28fdsoi_dse_t * dse,sc_pad_28fdsoi_ps_t * ps)353 sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad,
354     sc_pad_28fdsoi_dse_t *dse, sc_pad_28fdsoi_ps_t *ps)
355 {
356     sc_rpc_msg_t msg;
357     sc_err_t err;
358 
359     RPC_VER(&msg) = SC_RPC_VERSION;
360     RPC_SIZE(&msg) = 2U;
361     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
362     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_GP_28FDSOI);
363 
364     RPC_U16(&msg, 0U) = U16(pad);
365 
366     sc_call_rpc(ipc, &msg, SC_FALSE);
367 
368     err = (sc_err_t) RPC_R8(&msg);
369 
370     if (dse != NULL)
371     {
372         *dse = (sc_pad_28fdsoi_dse_t) RPC_U8(&msg, 0U);
373     }
374     if (ps != NULL)
375     {
376         *ps = (sc_pad_28fdsoi_ps_t) RPC_U8(&msg, 1U);
377     }
378 
379     return err;
380 }
381 
sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc,sc_pad_t pad,sc_pad_28fdsoi_dse_t dse,sc_bool_t hys,sc_pad_28fdsoi_pus_t pus,sc_bool_t pke,sc_bool_t pue)382 sc_err_t sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad,
383     sc_pad_28fdsoi_dse_t dse, sc_bool_t hys, sc_pad_28fdsoi_pus_t pus,
384     sc_bool_t pke, sc_bool_t pue)
385 {
386     sc_rpc_msg_t msg;
387     sc_err_t err;
388 
389     RPC_VER(&msg) = SC_RPC_VERSION;
390     RPC_SIZE(&msg) = 3U;
391     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
392     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_GP_28FDSOI_HSIC);
393 
394     RPC_U16(&msg, 0U) = U16(pad);
395     RPC_U8(&msg, 2U) = U8(dse);
396     RPC_U8(&msg, 3U) = U8(pus);
397     RPC_U8(&msg, 4U) = B2U8(hys);
398     RPC_U8(&msg, 5U) = B2U8(pke);
399     RPC_U8(&msg, 6U) = B2U8(pue);
400 
401     sc_call_rpc(ipc, &msg, SC_FALSE);
402 
403     err = (sc_err_t) RPC_R8(&msg);
404 
405     return err;
406 }
407 
sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc,sc_pad_t pad,sc_pad_28fdsoi_dse_t * dse,sc_bool_t * hys,sc_pad_28fdsoi_pus_t * pus,sc_bool_t * pke,sc_bool_t * pue)408 sc_err_t sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad,
409     sc_pad_28fdsoi_dse_t *dse, sc_bool_t *hys, sc_pad_28fdsoi_pus_t *pus,
410     sc_bool_t *pke, sc_bool_t *pue)
411 {
412     sc_rpc_msg_t msg;
413     sc_err_t err;
414 
415     RPC_VER(&msg) = SC_RPC_VERSION;
416     RPC_SIZE(&msg) = 2U;
417     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
418     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_GP_28FDSOI_HSIC);
419 
420     RPC_U16(&msg, 0U) = U16(pad);
421 
422     sc_call_rpc(ipc, &msg, SC_FALSE);
423 
424     err = (sc_err_t) RPC_R8(&msg);
425 
426     if (dse != NULL)
427     {
428         *dse = (sc_pad_28fdsoi_dse_t) RPC_U8(&msg, 0U);
429     }
430     if (pus != NULL)
431     {
432         *pus = (sc_pad_28fdsoi_pus_t) RPC_U8(&msg, 1U);
433     }
434     if (hys != NULL)
435     {
436         *hys = (sc_bool_t) U2B(RPC_U8(&msg, 2U));
437     }
438     if (pke != NULL)
439     {
440         *pke = (sc_bool_t) U2B(RPC_U8(&msg, 3U));
441     }
442     if (pue != NULL)
443     {
444         *pue = (sc_bool_t) U2B(RPC_U8(&msg, 4U));
445     }
446 
447     return err;
448 }
449 
sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc,sc_pad_t pad,uint8_t compen,sc_bool_t fastfrz,uint8_t rasrcp,uint8_t rasrcn,sc_bool_t nasrc_sel,sc_bool_t psw_ovr)450 sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, uint8_t compen,
451     sc_bool_t fastfrz, uint8_t rasrcp, uint8_t rasrcn, sc_bool_t nasrc_sel,
452     sc_bool_t psw_ovr)
453 {
454     sc_rpc_msg_t msg;
455     sc_err_t err;
456 
457     RPC_VER(&msg) = SC_RPC_VERSION;
458     RPC_SIZE(&msg) = 3U;
459     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
460     RPC_FUNC(&msg) = U8(PAD_FUNC_SET_GP_28FDSOI_COMP);
461 
462     RPC_U16(&msg, 0U) = U16(pad);
463     RPC_U8(&msg, 2U) = U8(compen);
464     RPC_U8(&msg, 3U) = U8(rasrcp);
465     RPC_U8(&msg, 4U) = U8(rasrcn);
466     RPC_U8(&msg, 5U) = B2U8(fastfrz);
467     RPC_U8(&msg, 6U) = B2U8(nasrc_sel);
468     RPC_U8(&msg, 7U) = B2U8(psw_ovr);
469 
470     sc_call_rpc(ipc, &msg, SC_FALSE);
471 
472     err = (sc_err_t) RPC_R8(&msg);
473 
474     return err;
475 }
476 
sc_pad_get_gp_28fdsoi_comp(sc_ipc_t ipc,sc_pad_t pad,uint8_t * compen,sc_bool_t * fastfrz,uint8_t * rasrcp,uint8_t * rasrcn,sc_bool_t * nasrc_sel,sc_bool_t * compok,uint8_t * nasrc,sc_bool_t * psw_ovr)477 sc_err_t sc_pad_get_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, uint8_t *compen,
478     sc_bool_t *fastfrz, uint8_t *rasrcp, uint8_t *rasrcn, sc_bool_t *nasrc_sel,
479     sc_bool_t *compok, uint8_t *nasrc, sc_bool_t *psw_ovr)
480 {
481     sc_rpc_msg_t msg;
482     sc_err_t err;
483 
484     RPC_VER(&msg) = SC_RPC_VERSION;
485     RPC_SIZE(&msg) = 2U;
486     RPC_SVC(&msg) = U8(SC_RPC_SVC_PAD);
487     RPC_FUNC(&msg) = U8(PAD_FUNC_GET_GP_28FDSOI_COMP);
488 
489     RPC_U16(&msg, 0U) = U16(pad);
490 
491     sc_call_rpc(ipc, &msg, SC_FALSE);
492 
493     err = (sc_err_t) RPC_R8(&msg);
494 
495     if (compen != NULL)
496     {
497         *compen = (uint8_t) RPC_U8(&msg, 0U);
498     }
499     if (rasrcp != NULL)
500     {
501         *rasrcp = (uint8_t) RPC_U8(&msg, 1U);
502     }
503     if (rasrcn != NULL)
504     {
505         *rasrcn = (uint8_t) RPC_U8(&msg, 2U);
506     }
507     if (nasrc != NULL)
508     {
509         *nasrc = (uint8_t) RPC_U8(&msg, 3U);
510     }
511     if (fastfrz != NULL)
512     {
513         *fastfrz = (sc_bool_t) U2B(RPC_U8(&msg, 4U));
514     }
515     if (nasrc_sel != NULL)
516     {
517         *nasrc_sel = (sc_bool_t) U2B(RPC_U8(&msg, 5U));
518     }
519     if (compok != NULL)
520     {
521         *compok = (sc_bool_t) U2B(RPC_U8(&msg, 6U));
522     }
523     if (psw_ovr != NULL)
524     {
525         *psw_ovr = (sc_bool_t) U2B(RPC_U8(&msg, 7U));
526     }
527 
528     return err;
529 }
530 
531 /**@}*/
532 
533