NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ote_client.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2017, NVIDIA CORPORATION. All rights reserved
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
41 #ifndef __OTE_CLIENT_H
42 #define __OTE_CLIENT_H
43 
44 #include <common/ote_command.h>
45 
46 #define TLK_DEVICE_BASE_NAME "tlk_device"
47 #define TE_IOCTL_MAGIC_NUMBER ('t')
48 
49 #define TE_IOCTL_OPEN_CLIENT_SESSION \
50  _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x10, union te_cmd)
51 #define TE_IOCTL_CLOSE_CLIENT_SESSION \
52  _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x11, union te_cmd)
53 #define TE_IOCTL_LAUNCH_OP \
54  _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x14, union te_cmd)
55 
56 /* secure storage ioctl */
57 #define TE_IOCTL_SS_CMD \
58  _IOR(TE_IOCTL_MAGIC_NUMBER, 0x30, int)
59 
60 #define TE_IOCTL_SS_CMD_GET_NEW_REQ 1
61 #define TE_IOCTL_SS_CMD_REQ_COMPLETE 2
62 
63 /* macros to help manage debug output */
64 #define LIBCA_ERR(args...) te_fprintf(TE_ERR, args)
65 #define LIBCA_INFO(args...) te_fprintf(TE_INFO, args)
66 #define LIBCA_SECURE(args...) te_fprintf(TE_SECURE, args)
67 
70 enum {
71  TLK_SMC_REQUEST = 0xFFFF1000,
72  TLK_SMC_GET_MORE = 0xFFFF1001,
73  TLK_SMC_ANSWER = 0xFFFF1002,
74  TLK_SMC_NO_ANSWER = 0xFFFF1003,
75  TLK_SMC_OPEN_SESSION = 0xFFFF1004,
76  TLK_SMC_CLOSE_SESSION = 0xFFFF1005,
77 };
78 
85 struct te_answer {
86  uint32_t result;
87  uint32_t session_id;
88  uint32_t result_origin;
89 };
90 
91 
99 };
100 
106  uint32_t session_id;
108 };
109 
113 struct ote_launchop {
114  uint32_t session_id;
117 };
118 
119 union te_cmd {
123 };
124 
128 typedef enum {
129  TOS_NONE = 0x0,
130  TOS_TRUSTY = 0x1,
131  TOS_TLK = 0x2
132 } tos_type_t;
133 
137 tos_type_t te_tos_type(void);
138 
143 #endif
struct ote_closesession closesession
Definition: ote_client.h:121
te_operation_t operation
Definition: ote_client.h:115
Gets a pending answer without making new operation.
Definition: ote_client.h:72
tos_type_t te_tos_type(void)
Returns the current Trusted OS type.
Answers from secure side.
Definition: ote_client.h:73
Holds operation object information that is to be delivered to the TLK Secure Service.
Definition: ote_common.h:178
Opens an open trusted environment (OTE) session.
Definition: ote_client.h:95
NVIDIA Trusted Little Kernel Interface: Common Commands
te_operation_t operation
Definition: ote_client.h:97
uint32_t session_id
Definition: ote_client.h:106
uint32_t result
Definition: ote_client.h:86
Defines a unique 16-byte ID for each TLK service.
Definition: ote_common.h:102
Launches an operation request.
Definition: ote_client.h:113
uint64_t cmnptr_t
Holds a pointer large enough to support 32- and 64-bit clients.
Definition: ote_common.h:137
uint32_t session_id
Definition: ote_client.h:87
te_service_id_t dest_service_id
Definition: ote_client.h:96
Requests OTE to launch a TA operation.
Definition: ote_client.h:71
struct ote_launchop launchop
Definition: ote_client.h:122
uint32_t session_id
Definition: ote_client.h:114
uint32_t result_origin
Definition: ote_client.h:88
cmnptr_t answer
Definition: ote_client.h:98
tos_type_t
Currently supported Trusted OS variants.
Definition: ote_client.h:128
cmnptr_t answer
Definition: ote_client.h:116
No answers for now (secure side idle).
Definition: ote_client.h:74
Closes an OTE session.
Definition: ote_client.h:105
struct ote_opensession opensession
Definition: ote_client.h:120
cmnptr_t answer
Definition: ote_client.h:107