4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _STMF_SBD_IOCTL_H
27 #define _STMF_SBD_IOCTL_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /*
34 * error codes from sbd.
35 */
36 typedef enum sbd_ret {
37 SBD_RET_META_CREATION_FAILED = 0x01,
38 SBD_RET_INVALID_BLKSIZE,
39 SBD_RET_REQUIRES_SEPARATE_META,
40 SBD_RET_FILE_ALREADY_REGISTERED,
41 SBD_RET_GUID_ALREADY_REGISTERED,
42 SBD_RET_DATA_PATH_NOT_ABSOLUTE,
43 SBD_RET_META_PATH_NOT_ABSOLUTE,
59 SBD_RET_VERSION_NOT_SUPPORTED,
60 SBD_RET_LU_BUSY,
61 SBD_RET_NOT_FOUND,
62 SBD_RET_INSUFFICIENT_BUF_SPACE,
63 SBD_RET_WRITE_CACHE_SET_FAILED,
64 SBD_RET_ACCESS_STATE_FAILED,
65
66 SBD_RET_MAX_VAL
67 } sbd_ret_t;
68
69 #define SBD_IOCTL_DEF(n) ((((int)0x5B) << 16) | (n))
70 #define SBD_IOCTL_CREATE_AND_REGISTER_LU SBD_IOCTL_DEF(1)
71 #define SBD_IOCTL_IMPORT_LU SBD_IOCTL_DEF(2)
72 #define SBD_IOCTL_DELETE_LU SBD_IOCTL_DEF(3)
73 #define SBD_IOCTL_MODIFY_LU SBD_IOCTL_DEF(4)
74 #define SBD_IOCTL_GET_LU_PROPS SBD_IOCTL_DEF(5)
75 #define SBD_IOCTL_GET_LU_LIST SBD_IOCTL_DEF(6)
76 #define SBD_IOCTL_SET_LU_STANDBY SBD_IOCTL_DEF(7)
77 #define SBD_IOCTL_SET_GLOBAL_LU SBD_IOCTL_DEF(8)
78 #define SBD_IOCTL_GET_GLOBAL_LU SBD_IOCTL_DEF(9)
79
80 typedef struct sbd_create_and_reg_lu {
81 uint32_t slu_struct_size;
82 uint16_t slu_meta_fname_valid:1,
83 slu_lu_size_valid:1,
84 slu_blksize_valid:1,
85 slu_vid_valid:1,
86 slu_pid_valid:1,
87 slu_rev_valid:1,
88 slu_serial_valid:1,
89 slu_alias_valid:1,
90 slu_mgmt_url_valid:1,
91 slu_guid_valid:1,
92 slu_company_id_valid:1,
93 slu_host_id_valid:1,
94 slu_writeback_cache_disable_valid:1,
95 slu_writeback_cache_disable:1,
96 slu_write_protected:1;
97 uint16_t slu_meta_fname_off;
98 uint64_t slu_lu_size;
205 slp_writeback_cache_disable_cur:1,
206 slp_writeback_cache_disable_saved:1,
207 slp_write_protected:1;
208 uint16_t slp_meta_fname_off;
209 uint16_t slp_data_fname_off;
210 uint64_t slp_lu_size;
211 uint16_t slp_serial_off;
212 uint16_t slp_blksize;
213 uint16_t slp_alias_off;
214 uint16_t slp_mgmt_url_off;
215 uint32_t slp_buf_size_needed; /* Upon return */
216 uint16_t slp_serial_size;
217 uint16_t slp_access_state;
218 char slp_rev[4];
219 char slp_vid[8];
220 char slp_pid[16];
221 uint8_t slp_guid[16];
222 uint8_t slp_buf[8]; /* likely more than 8 */
223 } sbd_lu_props_t;
224
225 #ifdef __cplusplus
226 }
227 #endif
228
229 #endif /* _STMF_SBD_IOCTL_H */
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 */
27
28 #ifndef _STMF_SBD_IOCTL_H
29 #define _STMF_SBD_IOCTL_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /*
36 * error codes from sbd.
37 */
38 typedef enum sbd_ret {
39 SBD_RET_META_CREATION_FAILED = 0x01,
40 SBD_RET_INVALID_BLKSIZE,
41 SBD_RET_REQUIRES_SEPARATE_META,
42 SBD_RET_FILE_ALREADY_REGISTERED,
43 SBD_RET_GUID_ALREADY_REGISTERED,
44 SBD_RET_DATA_PATH_NOT_ABSOLUTE,
45 SBD_RET_META_PATH_NOT_ABSOLUTE,
61 SBD_RET_VERSION_NOT_SUPPORTED,
62 SBD_RET_LU_BUSY,
63 SBD_RET_NOT_FOUND,
64 SBD_RET_INSUFFICIENT_BUF_SPACE,
65 SBD_RET_WRITE_CACHE_SET_FAILED,
66 SBD_RET_ACCESS_STATE_FAILED,
67
68 SBD_RET_MAX_VAL
69 } sbd_ret_t;
70
71 #define SBD_IOCTL_DEF(n) ((((int)0x5B) << 16) | (n))
72 #define SBD_IOCTL_CREATE_AND_REGISTER_LU SBD_IOCTL_DEF(1)
73 #define SBD_IOCTL_IMPORT_LU SBD_IOCTL_DEF(2)
74 #define SBD_IOCTL_DELETE_LU SBD_IOCTL_DEF(3)
75 #define SBD_IOCTL_MODIFY_LU SBD_IOCTL_DEF(4)
76 #define SBD_IOCTL_GET_LU_PROPS SBD_IOCTL_DEF(5)
77 #define SBD_IOCTL_GET_LU_LIST SBD_IOCTL_DEF(6)
78 #define SBD_IOCTL_SET_LU_STANDBY SBD_IOCTL_DEF(7)
79 #define SBD_IOCTL_SET_GLOBAL_LU SBD_IOCTL_DEF(8)
80 #define SBD_IOCTL_GET_GLOBAL_LU SBD_IOCTL_DEF(9)
81 #define SBD_IOCTL_GET_UNMAP_PROPS SBD_IOCTL_DEF(10)
82
83 typedef struct sbd_create_and_reg_lu {
84 uint32_t slu_struct_size;
85 uint16_t slu_meta_fname_valid:1,
86 slu_lu_size_valid:1,
87 slu_blksize_valid:1,
88 slu_vid_valid:1,
89 slu_pid_valid:1,
90 slu_rev_valid:1,
91 slu_serial_valid:1,
92 slu_alias_valid:1,
93 slu_mgmt_url_valid:1,
94 slu_guid_valid:1,
95 slu_company_id_valid:1,
96 slu_host_id_valid:1,
97 slu_writeback_cache_disable_valid:1,
98 slu_writeback_cache_disable:1,
99 slu_write_protected:1;
100 uint16_t slu_meta_fname_off;
101 uint64_t slu_lu_size;
208 slp_writeback_cache_disable_cur:1,
209 slp_writeback_cache_disable_saved:1,
210 slp_write_protected:1;
211 uint16_t slp_meta_fname_off;
212 uint16_t slp_data_fname_off;
213 uint64_t slp_lu_size;
214 uint16_t slp_serial_off;
215 uint16_t slp_blksize;
216 uint16_t slp_alias_off;
217 uint16_t slp_mgmt_url_off;
218 uint32_t slp_buf_size_needed; /* Upon return */
219 uint16_t slp_serial_size;
220 uint16_t slp_access_state;
221 char slp_rev[4];
222 char slp_vid[8];
223 char slp_pid[16];
224 uint8_t slp_guid[16];
225 uint8_t slp_buf[8]; /* likely more than 8 */
226 } sbd_lu_props_t;
227
228 typedef struct sbd_unmap_props {
229 uint32_t sup_found_lu:1,
230 sup_zvol_path_valid:1,
231 sup_guid_valid:1,
232 sup_unmap_enabled;
233 uint32_t sup_rsvd;
234 char sup_zvol_path[256];
235 uint8_t sup_guid[16];
236 } sbd_unmap_props_t;
237
238 #ifdef __cplusplus
239 }
240 #endif
241
242 #endif /* _STMF_SBD_IOCTL_H */
|