17836SJohn.Forte@Sun.COM /* 27836SJohn.Forte@Sun.COM * CDDL HEADER START 37836SJohn.Forte@Sun.COM * 47836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 57836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 67836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 77836SJohn.Forte@Sun.COM * 87836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 107836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 117836SJohn.Forte@Sun.COM * and limitations under the License. 127836SJohn.Forte@Sun.COM * 137836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 147836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 167836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 177836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 187836SJohn.Forte@Sun.COM * 197836SJohn.Forte@Sun.COM * CDDL HEADER END 207836SJohn.Forte@Sun.COM */ 217836SJohn.Forte@Sun.COM /* 229585STim.Szeto@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237836SJohn.Forte@Sun.COM * Use is subject to license terms. 247836SJohn.Forte@Sun.COM */ 257836SJohn.Forte@Sun.COM 267836SJohn.Forte@Sun.COM #ifndef _STMF_SBD_IOCTL_H 277836SJohn.Forte@Sun.COM #define _STMF_SBD_IOCTL_H 287836SJohn.Forte@Sun.COM 297836SJohn.Forte@Sun.COM #ifdef __cplusplus 307836SJohn.Forte@Sun.COM extern "C" { 317836SJohn.Forte@Sun.COM #endif 327836SJohn.Forte@Sun.COM 337836SJohn.Forte@Sun.COM /* 349585STim.Szeto@Sun.COM * error codes from sbd. 357836SJohn.Forte@Sun.COM */ 369585STim.Szeto@Sun.COM typedef enum sbd_ret { 379585STim.Szeto@Sun.COM SBD_RET_META_CREATION_FAILED = 0x01, 389585STim.Szeto@Sun.COM SBD_RET_INVALID_BLKSIZE, 399585STim.Szeto@Sun.COM SBD_RET_REQUIRES_SEPARATE_META, 409585STim.Szeto@Sun.COM SBD_RET_FILE_ALREADY_REGISTERED, 419585STim.Szeto@Sun.COM SBD_RET_GUID_ALREADY_REGISTERED, 429585STim.Szeto@Sun.COM SBD_RET_DATA_PATH_NOT_ABSOLUTE, 439585STim.Szeto@Sun.COM SBD_RET_META_PATH_NOT_ABSOLUTE, 449585STim.Szeto@Sun.COM SBD_RET_META_FILE_LOOKUP_FAILED, 459585STim.Szeto@Sun.COM SBD_RET_ZFS_META_CREATE_FAILED, 469585STim.Szeto@Sun.COM SBD_ZVOL_META_NAME_MISMATCH, 479585STim.Szeto@Sun.COM SBD_RET_DATA_FILE_LOOKUP_FAILED, 489585STim.Szeto@Sun.COM SBD_RET_WRONG_META_FILE_TYPE, 499585STim.Szeto@Sun.COM SBD_RET_WRONG_DATA_FILE_TYPE, 509585STim.Szeto@Sun.COM SBD_RET_DATA_FILE_OPEN_FAILED, 519585STim.Szeto@Sun.COM SBD_RET_META_FILE_OPEN_FAILED, 529585STim.Szeto@Sun.COM SBD_RET_DATA_FILE_GETATTR_FAILED, 539585STim.Szeto@Sun.COM SBD_RET_META_FILE_GETATTR_FAILED, 549585STim.Szeto@Sun.COM SBD_RET_FILE_SIZE_ERROR, 559585STim.Szeto@Sun.COM SBD_RET_FILE_ALIGN_ERROR, 569585STim.Szeto@Sun.COM SBD_RET_SIZE_OUT_OF_RANGE, 579585STim.Szeto@Sun.COM SBD_RET_SIZE_NOT_SUPPORTED_BY_FS, 589585STim.Szeto@Sun.COM SBD_RET_NO_META, 599585STim.Szeto@Sun.COM SBD_RET_VERSION_NOT_SUPPORTED, 609585STim.Szeto@Sun.COM SBD_RET_LU_BUSY, 619585STim.Szeto@Sun.COM SBD_RET_NOT_FOUND, 629585STim.Szeto@Sun.COM SBD_RET_INSUFFICIENT_BUF_SPACE, 639585STim.Szeto@Sun.COM SBD_RET_WRITE_CACHE_SET_FAILED, 647836SJohn.Forte@Sun.COM 659585STim.Szeto@Sun.COM SBD_RET_MAX_VAL 669585STim.Szeto@Sun.COM } sbd_ret_t; 679585STim.Szeto@Sun.COM 689585STim.Szeto@Sun.COM #define SBD_IOCTL_DEF(n) ((((int)0x5B) << 16) | (n)) 699585STim.Szeto@Sun.COM #define SBD_IOCTL_CREATE_AND_REGISTER_LU SBD_IOCTL_DEF(1) 709585STim.Szeto@Sun.COM #define SBD_IOCTL_IMPORT_LU SBD_IOCTL_DEF(2) 719585STim.Szeto@Sun.COM #define SBD_IOCTL_DELETE_LU SBD_IOCTL_DEF(3) 729585STim.Szeto@Sun.COM #define SBD_IOCTL_MODIFY_LU SBD_IOCTL_DEF(4) 739585STim.Szeto@Sun.COM #define SBD_IOCTL_GET_LU_PROPS SBD_IOCTL_DEF(5) 749585STim.Szeto@Sun.COM #define SBD_IOCTL_GET_LU_LIST SBD_IOCTL_DEF(6) 757836SJohn.Forte@Sun.COM 769585STim.Szeto@Sun.COM typedef struct sbd_create_and_reg_lu { 779585STim.Szeto@Sun.COM uint32_t slu_struct_size; 789585STim.Szeto@Sun.COM uint16_t slu_meta_fname_valid:1, 799585STim.Szeto@Sun.COM slu_lu_size_valid:1, 809585STim.Szeto@Sun.COM slu_blksize_valid:1, 819585STim.Szeto@Sun.COM slu_vid_valid:1, 829585STim.Szeto@Sun.COM slu_pid_valid:1, 839585STim.Szeto@Sun.COM slu_rev_valid:1, 849585STim.Szeto@Sun.COM slu_serial_valid:1, 859585STim.Szeto@Sun.COM slu_alias_valid:1, 86*10113SNattuvetty.Bhavyan@Sun.COM slu_mgmt_url_valid:1, 879585STim.Szeto@Sun.COM slu_guid_valid:1, 889585STim.Szeto@Sun.COM slu_company_id_valid:1, 899585STim.Szeto@Sun.COM slu_writeback_cache_disable_valid:1, 909585STim.Szeto@Sun.COM slu_writeback_cache_disable:1, 919585STim.Szeto@Sun.COM slu_write_protected:1; 927836SJohn.Forte@Sun.COM 939585STim.Szeto@Sun.COM uint16_t slu_meta_fname_off; 949585STim.Szeto@Sun.COM uint64_t slu_lu_size; 959585STim.Szeto@Sun.COM uint16_t slu_data_fname_off; 969585STim.Szeto@Sun.COM uint16_t slu_serial_off; 979585STim.Szeto@Sun.COM uint8_t slu_serial_size; 989585STim.Szeto@Sun.COM uint8_t slu_ret_filesize_nbits; 999585STim.Szeto@Sun.COM uint16_t slu_blksize; 1009585STim.Szeto@Sun.COM uint32_t slu_company_id; 1019585STim.Szeto@Sun.COM uint16_t slu_alias_off; 102*10113SNattuvetty.Bhavyan@Sun.COM uint16_t slu_mgmt_url_off; 1039585STim.Szeto@Sun.COM uint32_t slu_rsvd1; 1049585STim.Szeto@Sun.COM char slu_rev[4]; 1059585STim.Szeto@Sun.COM char slu_vid[8]; 1069585STim.Szeto@Sun.COM char slu_pid[16]; 1079585STim.Szeto@Sun.COM uint8_t slu_guid[16]; 1089585STim.Szeto@Sun.COM char slu_buf[8]; /* likely more than 8 */ 1099585STim.Szeto@Sun.COM } sbd_create_and_reg_lu_t; 1107836SJohn.Forte@Sun.COM 1119585STim.Szeto@Sun.COM typedef struct sbd_import_lu { 1129585STim.Szeto@Sun.COM uint32_t ilu_struct_size; 1139585STim.Szeto@Sun.COM uint32_t ilu_rsvd; 1149585STim.Szeto@Sun.COM uint8_t ilu_ret_guid[16]; 1159585STim.Szeto@Sun.COM char ilu_meta_fname[8]; /* Can be more than 8 */ 1169585STim.Szeto@Sun.COM } sbd_import_lu_t; 1177836SJohn.Forte@Sun.COM 1189585STim.Szeto@Sun.COM typedef struct sbd_modify_lu { 1199585STim.Szeto@Sun.COM uint32_t mlu_struct_size; 1209585STim.Szeto@Sun.COM uint32_t mlu_lu_size_valid:1, 1219585STim.Szeto@Sun.COM mlu_serial_valid:1, 1229585STim.Szeto@Sun.COM mlu_alias_valid:1, 123*10113SNattuvetty.Bhavyan@Sun.COM mlu_mgmt_url_valid:1, 1249585STim.Szeto@Sun.COM mlu_writeback_cache_disable_valid:1, 1259585STim.Szeto@Sun.COM mlu_writeback_cache_disable:1, 1269585STim.Szeto@Sun.COM mlu_write_protected_valid:1, 1279585STim.Szeto@Sun.COM mlu_write_protected:1, 1289585STim.Szeto@Sun.COM mlu_by_guid:1, 1299585STim.Szeto@Sun.COM mlu_by_fname:1; 1309585STim.Szeto@Sun.COM uint64_t mlu_lu_size; 1319585STim.Szeto@Sun.COM uint16_t mlu_alias_off; 132*10113SNattuvetty.Bhavyan@Sun.COM uint16_t mlu_mgmt_url_off; 1339585STim.Szeto@Sun.COM uint16_t mlu_serial_off; 1349585STim.Szeto@Sun.COM uint16_t mlu_serial_size; 1359585STim.Szeto@Sun.COM uint16_t mlu_fname_off; 136*10113SNattuvetty.Bhavyan@Sun.COM uint16_t mlu_rsvd1; 137*10113SNattuvetty.Bhavyan@Sun.COM uint32_t mlu_rsvd2; 1389585STim.Szeto@Sun.COM uint8_t mlu_input_guid[16]; 1399585STim.Szeto@Sun.COM char mlu_buf[8]; /* can be more than 8 */ 1409585STim.Szeto@Sun.COM } sbd_modify_lu_t; 1419585STim.Szeto@Sun.COM 1429585STim.Szeto@Sun.COM typedef struct sbd_delete_lu { 1439585STim.Szeto@Sun.COM uint32_t dlu_struct_size; 1449585STim.Szeto@Sun.COM uint16_t dlu_by_guid:1, 1459585STim.Szeto@Sun.COM dlu_by_meta_name:1; 1469585STim.Szeto@Sun.COM uint16_t dlu_rsvd; 1479585STim.Szeto@Sun.COM uint8_t dlu_guid[16]; 1489585STim.Szeto@Sun.COM uint8_t dlu_meta_name[8]; 1499585STim.Szeto@Sun.COM } sbd_delete_lu_t; 1507836SJohn.Forte@Sun.COM 1519585STim.Szeto@Sun.COM typedef struct sbd_lu_props { 1529585STim.Szeto@Sun.COM uint32_t slp_input_guid:1, /* GUID or meta filename */ 1539585STim.Szeto@Sun.COM slp_separate_meta:1, 1549585STim.Szeto@Sun.COM slp_meta_fname_valid:1, 1559585STim.Szeto@Sun.COM slp_data_fname_valid:1, 1569585STim.Szeto@Sun.COM slp_zfs_meta:1, 1579585STim.Szeto@Sun.COM slp_alias_valid:1, 158*10113SNattuvetty.Bhavyan@Sun.COM slp_mgmt_url_valid:1, 1599585STim.Szeto@Sun.COM slp_lu_vid:1, 1609585STim.Szeto@Sun.COM slp_lu_pid:1, 1619585STim.Szeto@Sun.COM slp_lu_rev:1, 1629585STim.Szeto@Sun.COM slp_serial_valid:1, 1639585STim.Szeto@Sun.COM slp_writeback_cache_disable_cur:1, 1649585STim.Szeto@Sun.COM slp_writeback_cache_disable_saved:1, 1659585STim.Szeto@Sun.COM slp_write_protected:1; 1667836SJohn.Forte@Sun.COM 1679585STim.Szeto@Sun.COM uint16_t slp_meta_fname_off; 1689585STim.Szeto@Sun.COM uint16_t slp_data_fname_off; 1699585STim.Szeto@Sun.COM uint64_t slp_lu_size; 1709585STim.Szeto@Sun.COM uint16_t slp_serial_off; 1719585STim.Szeto@Sun.COM uint16_t slp_blksize; 1729585STim.Szeto@Sun.COM uint16_t slp_alias_off; 173*10113SNattuvetty.Bhavyan@Sun.COM uint16_t slp_mgmt_url_off; 1749585STim.Szeto@Sun.COM uint32_t slp_buf_size_needed; /* Upon return */ 1759585STim.Szeto@Sun.COM uint16_t slp_serial_size; 1769585STim.Szeto@Sun.COM uint16_t slp_rsvd; 1779585STim.Szeto@Sun.COM char slp_rev[4]; 1789585STim.Szeto@Sun.COM char slp_vid[8]; 1799585STim.Szeto@Sun.COM char slp_pid[16]; 1809585STim.Szeto@Sun.COM uint8_t slp_guid[16]; 1819585STim.Szeto@Sun.COM uint8_t slp_buf[8]; /* likely more than 8 */ 1829585STim.Szeto@Sun.COM } sbd_lu_props_t; 1837836SJohn.Forte@Sun.COM 1847836SJohn.Forte@Sun.COM #ifdef __cplusplus 1857836SJohn.Forte@Sun.COM } 1867836SJohn.Forte@Sun.COM #endif 1877836SJohn.Forte@Sun.COM 1887836SJohn.Forte@Sun.COM #endif /* _STMF_SBD_IOCTL_H */ 189