xref: /titanic_41/usr/src/uts/common/sys/crypto/ioctladmin.h (revision c2580b931007758eab8cb5ae8726ebe1588e259b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_CRYPTO_IOCTLADMIN_H
28 #define	_SYS_CRYPTO_IOCTLADMIN_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/types.h>
37 #include <sys/crypto/common.h>
38 
39 #define	ADMIN_IOCTL_DEVICE	"/dev/cryptoadm"
40 
41 #define	CRYPTOADMIN(x)		(('y' << 8) | (x))
42 
43 /*
44  * Administrative IOCTLs
45  */
46 
47 typedef struct crypto_get_dev_list {
48 	uint_t			dl_return_value;
49 	uint_t			dl_dev_count;
50 	crypto_dev_list_entry_t	dl_devs[1];
51 } crypto_get_dev_list_t;
52 
53 typedef struct crypto_get_soft_list {
54 	uint_t			sl_return_value;
55 	uint_t			sl_soft_count;
56 	size_t			sl_soft_len;
57 	caddr_t			sl_soft_names;
58 } crypto_get_soft_list_t;
59 
60 typedef struct crypto_get_dev_info {
61 	uint_t			di_return_value;
62 	char			di_dev_name[MAXNAMELEN];
63 	uint_t			di_dev_instance;
64 	uint_t			di_count;
65 	crypto_mech_name_t	di_list[1];
66 } crypto_get_dev_info_t;
67 
68 typedef struct crypto_get_soft_info {
69 	uint_t			si_return_value;
70 	char			si_name[MAXNAMELEN];
71 	uint_t			si_count;
72 	crypto_mech_name_t	si_list[1];
73 } crypto_get_soft_info_t;
74 
75 typedef struct crypto_load_dev_disabled {
76 	uint_t			dd_return_value;
77 	char			dd_dev_name[MAXNAMELEN];
78 	uint_t			dd_dev_instance;
79 	uint_t			dd_count;
80 	crypto_mech_name_t	dd_list[1];
81 } crypto_load_dev_disabled_t;
82 
83 typedef struct crypto_load_soft_disabled {
84 	uint_t			sd_return_value;
85 	char			sd_name[MAXNAMELEN];
86 	uint_t			sd_count;
87 	crypto_mech_name_t	sd_list[1];
88 } crypto_load_soft_disabled_t;
89 
90 typedef struct crypto_unload_soft_module {
91 	uint_t			sm_return_value;
92 	char			sm_name[MAXNAMELEN];
93 } crypto_unload_soft_module_t;
94 
95 typedef struct crypto_load_soft_config {
96 	uint_t			sc_return_value;
97 	char			sc_name[MAXNAMELEN];
98 	uint_t			sc_count;
99 	crypto_mech_name_t	sc_list[1];
100 } crypto_load_soft_config_t;
101 
102 typedef struct crypto_load_door {
103 	uint_t			ld_return_value;
104 	uint_t			ld_did;
105 } crypto_load_door_t;
106 
107 #ifdef	_KERNEL
108 #ifdef	_SYSCALL32
109 
110 typedef struct crypto_get_soft_list32 {
111 	uint32_t		sl_return_value;
112 	uint32_t		sl_soft_count;
113 	size32_t		sl_soft_len;
114 	caddr32_t		sl_soft_names;
115 } crypto_get_soft_list32_t;
116 
117 #endif	/* _SYSCALL32 */
118 #endif	/* _KERNEL */
119 
120 #define	CRYPTO_GET_VERSION		CRYPTOADMIN(1)
121 #define	CRYPTO_GET_DEV_LIST		CRYPTOADMIN(2)
122 #define	CRYPTO_GET_SOFT_LIST		CRYPTOADMIN(3)
123 #define	CRYPTO_GET_DEV_INFO		CRYPTOADMIN(4)
124 #define	CRYPTO_GET_SOFT_INFO		CRYPTOADMIN(5)
125 #define	CRYPTO_LOAD_DEV_DISABLED	CRYPTOADMIN(8)
126 #define	CRYPTO_LOAD_SOFT_DISABLED	CRYPTOADMIN(9)
127 #define	CRYPTO_UNLOAD_SOFT_MODULE	CRYPTOADMIN(10)
128 #define	CRYPTO_LOAD_SOFT_CONFIG		CRYPTOADMIN(11)
129 #define	CRYPTO_POOL_CREATE		CRYPTOADMIN(12)
130 #define	CRYPTO_POOL_WAIT		CRYPTOADMIN(13)
131 #define	CRYPTO_POOL_RUN			CRYPTOADMIN(14)
132 #define	CRYPTO_LOAD_DOOR		CRYPTOADMIN(15)
133 
134 #ifdef	__cplusplus
135 }
136 #endif
137 
138 #endif	/* _SYS_CRYPTO_IOCTLADMIN_H */
139