import exynos 7570 bsp
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos7580.git] / mobicore / Daemon / src / MobiCoreDriverCmd.h
1 /*
2 * Copyright (c) 2013-2014 TRUSTONIC LIMITED
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the TRUSTONIC LIMITED nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifndef MOBICORE_REGISTRY_API_H_
33 #define MOBICORE_REGISTRY_API_H_
34
35 #include "mcUuid.h"
36 #include "mcSpid.h"
37
38 #define SOCK_PATH "#mcdaemon"
39
40 typedef enum {
41 // Auth token OPS
42 MC_DRV_REG_READ_AUTH_TOKEN = 0,
43 MC_DRV_REG_WRITE_AUTH_TOKEN,
44 MC_DRV_REG_DELETE_AUTH_TOKEN,
45 // Root container OPS
46 MC_DRV_REG_READ_ROOT_CONT,
47 MC_DRV_REG_WRITE_ROOT_CONT,
48 MC_DRV_REG_DELETE_ROOT_CONT,
49 // Service Provider Container OPS
50 MC_DRV_REG_READ_SP_CONT,
51 MC_DRV_REG_WRITE_SP_CONT,
52 MC_DRV_REG_DELETE_SP_CONT,
53 // Trustlet Container OPS
54 MC_DRV_REG_READ_TL_CONT,
55 MC_DRV_REG_WRITE_TL_CONT,
56 MC_DRV_REG_DELETE_TL_CONT,
57 // Shared Object Data write
58 MC_DRV_REG_WRITE_SO_DATA,
59 // TA Blob store
60 MC_DRV_REG_STORE_TA_BLOB,
61 // Delete all TA objects
62 MC_DRV_REG_DELETE_TA_OBJS,
63
64 MC_DRV_REG_END
65 } mcDrvCmd_t;
66
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70
71 typedef struct {
72 /* id - free run counter managed by driver, initialized by
73 * initial_cmd_counter, incremented for each command.
74 * If difference between current value and value from previous command
75 * is greater than 1, it means daemon and driver are out of synch. */
76 uint32_t id;
77 uint32_t cmd;
78 uint32_t data_size;
79 } CommandHeader;
80
81 typedef struct {
82 /* id - must be same value as it was in the corresponding command,
83 * but managed by daemon */
84 uint32_t id;
85 uint32_t result;
86 uint32_t data_size;
87 } ResponseHeader;
88
89 typedef struct {
90 uint32_t len;
91 uint32_t tl_start_off;
92 uint8_t value[];
93 } regObject_t;
94
95 typedef struct {
96 mcUuid_t uuid;
97 mcSpid_t spid;
98 uint8_t blob[];
99 } TlBlob;
100
101 typedef struct {
102 mcSpid_t spid;
103 uint8_t blob[];
104 } TaBlob;
105
106 #ifdef __cplusplus
107 }
108 #endif
109
110 #endif // MOBICORE_REGISTRY_API_H_