1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_QSEECOM_H_
20#define _UAPI_QSEECOM_H_
21#include <linux/types.h>
22#include <linux/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define MAX_ION_FD 4
25#define MAX_APP_NAME_SIZE 32
26#define QSEECOM_HASH_SIZE 32
27struct qseecom_register_listener_req {
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 uint32_t listener_id;
30 int32_t ifd_data_fd;
31 uint32_t virt_sb_base;
32 uint32_t sb_size;
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34};
35struct qseecom_send_cmd_req {
36 void *cmd_req_buf;
37 unsigned int cmd_req_len;
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 void *resp_buf;
40 unsigned int resp_len;
41};
42struct qseecom_ion_fd_info {
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 int32_t fd;
45 uint32_t cmd_buf_offset;
46};
47struct qseecom_send_modfd_cmd_req {
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 void *cmd_req_buf;
50 unsigned int cmd_req_len;
51 void *resp_buf;
52 unsigned int resp_len;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 struct qseecom_ion_fd_info ifd_data[MAX_ION_FD];
55};
56struct qseecom_send_resp_req {
57 void *resp_buf;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 unsigned int resp_len;
60};
61struct qseecom_load_img_req {
62 uint32_t mdt_len;
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 uint32_t img_len;
65 int32_t ifd_data_fd;
66 char img_name[MAX_APP_NAME_SIZE];
67 int app_id;
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69};
70struct qseecom_set_sb_mem_param_req {
71 int32_t ifd_data_fd;
72 uint32_t virt_sb_base;
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 uint32_t sb_len;
75};
76struct qseecom_qseos_version_req {
77 unsigned int qseos_version;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79};
80struct qseecom_qseos_app_load_query {
81 char app_name[MAX_APP_NAME_SIZE];
82 int app_id;
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84};
85struct qseecom_send_svc_cmd_req {
86 uint32_t cmd_id;
87 void *cmd_req_buf;
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 unsigned int cmd_req_len;
90 void *resp_buf;
91 unsigned int resp_len;
92};
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94enum qseecom_key_management_usage_type {
95 QSEOS_KM_USAGE_DISK_ENCRYPTION = 0x01,
96 QSEOS_KM_USAGE_FILE_ENCRYPTION = 0x02,
97 QSEOS_KM_USAGE_MAX
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99};
100struct qseecom_create_key_req {
101 unsigned char hash32[QSEECOM_HASH_SIZE];
102 enum qseecom_key_management_usage_type usage;
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104};
105struct qseecom_wipe_key_req {
106 enum qseecom_key_management_usage_type usage;
107 int wipe_key_flag;
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109};
110struct qseecom_update_key_userinfo_req {
111 unsigned char current_hash32[QSEECOM_HASH_SIZE];
112 unsigned char new_hash32[QSEECOM_HASH_SIZE];
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 enum qseecom_key_management_usage_type usage;
115};
116#define SHA256_DIGEST_LENGTH (256/8)
117struct qseecom_save_partition_hash_req {
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 int partition_id;
120 char digest[SHA256_DIGEST_LENGTH];
121};
122struct qseecom_is_es_activated_req {
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 int is_activated;
125};
126enum qseecom_bandwidth_request_mode {
127 INACTIVE = 0,
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 LOW,
130 MEDIUM,
131 HIGH,
132};
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134struct qseecom_send_modfd_listener_resp {
135 void *resp_buf_ptr;
136 unsigned int resp_len;
137 struct qseecom_ion_fd_info ifd_data[MAX_ION_FD];
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139};
140#define QSEECOM_IOC_MAGIC 0x97
141#define QSEECOM_IOCTL_REGISTER_LISTENER_REQ   _IOWR(QSEECOM_IOC_MAGIC, 1, struct qseecom_register_listener_req)
142#define QSEECOM_IOCTL_UNREGISTER_LISTENER_REQ   _IO(QSEECOM_IOC_MAGIC, 2)
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144#define QSEECOM_IOCTL_SEND_CMD_REQ   _IOWR(QSEECOM_IOC_MAGIC, 3, struct qseecom_send_cmd_req)
145#define QSEECOM_IOCTL_SEND_MODFD_CMD_REQ   _IOWR(QSEECOM_IOC_MAGIC, 4, struct qseecom_send_modfd_cmd_req)
146#define QSEECOM_IOCTL_RECEIVE_REQ   _IO(QSEECOM_IOC_MAGIC, 5)
147#define QSEECOM_IOCTL_SEND_RESP_REQ   _IO(QSEECOM_IOC_MAGIC, 6)
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149#define QSEECOM_IOCTL_LOAD_APP_REQ   _IOWR(QSEECOM_IOC_MAGIC, 7, struct qseecom_load_img_req)
150#define QSEECOM_IOCTL_SET_MEM_PARAM_REQ   _IOWR(QSEECOM_IOC_MAGIC, 8, struct qseecom_set_sb_mem_param_req)
151#define QSEECOM_IOCTL_UNLOAD_APP_REQ   _IO(QSEECOM_IOC_MAGIC, 9)
152#define QSEECOM_IOCTL_GET_QSEOS_VERSION_REQ   _IOWR(QSEECOM_IOC_MAGIC, 10, struct qseecom_qseos_version_req)
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154#define QSEECOM_IOCTL_PERF_ENABLE_REQ   _IO(QSEECOM_IOC_MAGIC, 11)
155#define QSEECOM_IOCTL_PERF_DISABLE_REQ   _IO(QSEECOM_IOC_MAGIC, 12)
156#define QSEECOM_IOCTL_LOAD_EXTERNAL_ELF_REQ   _IOWR(QSEECOM_IOC_MAGIC, 13, struct qseecom_load_img_req)
157#define QSEECOM_IOCTL_UNLOAD_EXTERNAL_ELF_REQ   _IO(QSEECOM_IOC_MAGIC, 14)
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159#define QSEECOM_IOCTL_APP_LOADED_QUERY_REQ   _IOWR(QSEECOM_IOC_MAGIC, 15, struct qseecom_qseos_app_load_query)
160#define QSEECOM_IOCTL_SEND_CMD_SERVICE_REQ   _IOWR(QSEECOM_IOC_MAGIC, 16, struct qseecom_send_svc_cmd_req)
161#define QSEECOM_IOCTL_CREATE_KEY_REQ   _IOWR(QSEECOM_IOC_MAGIC, 17, struct qseecom_create_key_req)
162#define QSEECOM_IOCTL_WIPE_KEY_REQ   _IOWR(QSEECOM_IOC_MAGIC, 18, struct qseecom_wipe_key_req)
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164#define QSEECOM_IOCTL_SAVE_PARTITION_HASH_REQ   _IOWR(QSEECOM_IOC_MAGIC, 19, struct qseecom_save_partition_hash_req)
165#define QSEECOM_IOCTL_IS_ES_ACTIVATED_REQ   _IOWR(QSEECOM_IOC_MAGIC, 20, struct qseecom_is_es_activated_req)
166#define QSEECOM_IOCTL_SEND_MODFD_RESP   _IOWR(QSEECOM_IOC_MAGIC, 21, struct qseecom_send_modfd_listener_resp)
167#define QSEECOM_IOCTL_SET_BUS_SCALING_REQ   _IOWR(QSEECOM_IOC_MAGIC, 23, int)
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169#define QSEECOM_IOCTL_UPDATE_KEY_USER_INFO_REQ   _IOWR(QSEECOM_IOC_MAGIC, 24, struct qseecom_update_key_userinfo_req)
170#endif
171
172