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_QCEDEV__H
20 #define _UAPI_QCEDEV__H
21 #include <linux/types.h>
22 #include <linux/ioctl.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #include "fips_status.h"
25 #define QCEDEV_MAX_SHA_BLOCK_SIZE 64
26 #define QCEDEV_MAX_BEARER 31
27 #define QCEDEV_MAX_KEY_SIZE 64
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define QCEDEV_MAX_IV_SIZE 32
30 #define QCEDEV_MAX_BUFFERS 16
31 #define QCEDEV_MAX_SHA_DIGEST 32
32 #define QCEDEV_USE_PMEM 1
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define QCEDEV_NO_PMEM 0
35 #define QCEDEV_AES_KEY_128 16
36 #define QCEDEV_AES_KEY_192 24
37 #define QCEDEV_AES_KEY_256 32
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 enum qcedev_oper_enum {
40   QCEDEV_OPER_DEC = 0,
41   QCEDEV_OPER_ENC = 1,
42   QCEDEV_OPER_DEC_NO_KEY = 2,
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44   QCEDEV_OPER_ENC_NO_KEY = 3,
45   QCEDEV_OPER_LAST
46 };
47 enum qcedev_cipher_alg_enum {
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49   QCEDEV_ALG_DES = 0,
50   QCEDEV_ALG_3DES = 1,
51   QCEDEV_ALG_AES = 2,
52   QCEDEV_ALG_LAST
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 };
55 enum qcedev_cipher_mode_enum {
56   QCEDEV_AES_MODE_CBC = 0,
57   QCEDEV_AES_MODE_ECB = 1,
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59   QCEDEV_AES_MODE_CTR = 2,
60   QCEDEV_AES_MODE_XTS = 3,
61   QCEDEV_AES_MODE_CCM = 4,
62   QCEDEV_DES_MODE_CBC = 5,
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   QCEDEV_DES_MODE_ECB = 6,
65   QCEDEV_AES_DES_MODE_LAST
66 };
67 enum qcedev_sha_alg_enum {
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69   QCEDEV_ALG_SHA1 = 0,
70   QCEDEV_ALG_SHA256 = 1,
71   QCEDEV_ALG_SHA1_HMAC = 2,
72   QCEDEV_ALG_SHA256_HMAC = 3,
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74   QCEDEV_ALG_AES_CMAC = 4,
75   QCEDEV_ALG_SHA_ALG_LAST
76 };
77 struct buf_info {
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79   union {
80     uint32_t offset;
81     uint8_t * vaddr;
82   };
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84   uint32_t len;
85 };
86 struct qcedev_vbuf_info {
87   struct buf_info src[QCEDEV_MAX_BUFFERS];
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89   struct buf_info dst[QCEDEV_MAX_BUFFERS];
90 };
91 struct qcedev_pmem_info {
92   int fd_src;
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94   struct buf_info src[QCEDEV_MAX_BUFFERS];
95   int fd_dst;
96   struct buf_info dst[QCEDEV_MAX_BUFFERS];
97 };
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 struct qcedev_cipher_op_req {
100   uint8_t use_pmem;
101   union {
102     struct qcedev_pmem_info pmem;
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104     struct qcedev_vbuf_info vbuf;
105   };
106   uint32_t entries;
107   uint32_t data_len;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   uint8_t in_place_op;
110   uint8_t enckey[QCEDEV_MAX_KEY_SIZE];
111   uint32_t encklen;
112   uint8_t iv[QCEDEV_MAX_IV_SIZE];
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114   uint32_t ivlen;
115   uint32_t byteoffset;
116   enum qcedev_cipher_alg_enum alg;
117   enum qcedev_cipher_mode_enum mode;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119   enum qcedev_oper_enum op;
120 };
121 struct qcedev_sha_op_req {
122   struct buf_info data[QCEDEV_MAX_BUFFERS];
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124   uint32_t entries;
125   uint32_t data_len;
126   uint8_t digest[QCEDEV_MAX_SHA_DIGEST];
127   uint32_t diglen;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129   uint8_t * authkey;
130   uint32_t authklen;
131   enum qcedev_sha_alg_enum alg;
132 };
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 struct qfips_verify_t {
135   unsigned kernel_size;
136   void * kernel;
137 };
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 struct file;
140 #define QCEDEV_IOC_MAGIC 0x87
141 #define QCEDEV_IOCTL_ENC_REQ _IOWR(QCEDEV_IOC_MAGIC, 1, struct qcedev_cipher_op_req)
142 #define QCEDEV_IOCTL_DEC_REQ _IOWR(QCEDEV_IOC_MAGIC, 2, struct qcedev_cipher_op_req)
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define QCEDEV_IOCTL_SHA_INIT_REQ _IOWR(QCEDEV_IOC_MAGIC, 3, struct qcedev_sha_op_req)
145 #define QCEDEV_IOCTL_SHA_UPDATE_REQ _IOWR(QCEDEV_IOC_MAGIC, 4, struct qcedev_sha_op_req)
146 #define QCEDEV_IOCTL_SHA_FINAL_REQ _IOWR(QCEDEV_IOC_MAGIC, 5, struct qcedev_sha_op_req)
147 #define QCEDEV_IOCTL_GET_SHA_REQ _IOWR(QCEDEV_IOC_MAGIC, 6, struct qcedev_sha_op_req)
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define QCEDEV_IOCTL_LOCK_CE _IO(QCEDEV_IOC_MAGIC, 7)
150 #define QCEDEV_IOCTL_UNLOCK_CE _IO(QCEDEV_IOC_MAGIC, 8)
151 #define QCEDEV_IOCTL_GET_CMAC_REQ _IOWR(QCEDEV_IOC_MAGIC, 9, struct qcedev_sha_op_req)
152 #define QCEDEV_IOCTL_UPDATE_FIPS_STATUS _IOWR(QCEDEV_IOC_MAGIC, 10, enum fips_status)
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 #define QCEDEV_IOCTL_QUERY_FIPS_STATUS _IOR(QCEDEV_IOC_MAGIC, 11, enum fips_status)
155 #endif
156 
157