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
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.
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]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Definitions for multi-host device I/O control commands
39 #define MHIOC ('M'<<8)
40 #define MHIOCENFAILFAST (MHIOC|1)
41 #define MHIOCTKOWN (MHIOC|2)
42 #define MHIOCRELEASE (MHIOC|3)
43 #define MHIOCSTATUS (MHIOC|4)
44 #define MHIOCGRP_INKEYS (MHIOC|5)
45 #define MHIOCGRP_INRESV (MHIOC|6)
46 #define MHIOCGRP_REGISTER (MHIOC|7)
47 #define MHIOCGRP_RESERVE (MHIOC|8)
48 #define MHIOCGRP_PREEMPTANDABORT (MHIOC|9)
49 #define MHIOCGRP_PREEMPT (MHIOC|10)
50 #define MHIOCGRP_CLEAR (MHIOC|11)
51 #define MHIOCGRP_REGISTERANDIGNOREKEY (MHIOC|14)
52 #define MHIOCQRESERVE (MHIOC|12)
53 #define MHIOCREREGISTERDEVID (MHIOC|13)
56 * Following is the structure to specify the delay parameters in
57 * milliseconds, via the MHIOCTKOWN ioctl.
60 int reinstate_resv_delay
;
61 int min_ownership_delay
;
62 int max_ownership_delay
;
65 #define MHIOC_RESV_KEY_SIZE 8
66 typedef struct mhioc_resv_key
{
67 uchar_t key
[MHIOC_RESV_KEY_SIZE
];
70 typedef struct mhioc_key_list
{
73 mhioc_resv_key_t
*list
;
76 typedef struct mhioc_inkeys
{
81 #if defined(_SYSCALL32)
82 struct mhioc_key_list32
{
88 struct mhioc_inkeys32
{
94 typedef struct mhioc_resv_desc
{
98 uint32_t scope_specific_addr
;
101 typedef struct mhioc_resv_desc_list
{
104 mhioc_resv_desc_t
*list
;
105 } mhioc_resv_desc_list_t
;
107 typedef struct mhioc_inresvs
{
109 mhioc_resv_desc_list_t
*li
;
112 #if defined(_SYSCALL32)
113 struct mhioc_resv_desc_list32
{
117 } mhioc_resv_desc_list32_t
;
119 typedef struct mhioc_inresvs32
{
125 typedef struct mhioc_register
{
126 mhioc_resv_key_t oldkey
;
127 mhioc_resv_key_t newkey
;
128 boolean_t aptpl
; /* True if persistent across power failures */
131 typedef struct mhioc_preemptandabort
{
132 mhioc_resv_desc_t resvdesc
;
133 mhioc_resv_key_t victim_key
;
134 } mhioc_preemptandabort_t
;
136 typedef struct mhioc_registerandignorekey
{
137 mhioc_resv_key_t newkey
;
138 boolean_t aptpl
; /* True if persistent across power failures */
139 } mhioc_registerandignorekey_t
;
142 * SCSI-3 PGR Reservation Type Codes. Codes with the _OBSOLETE suffix
143 * have been removed from the SCSI3 PGR standard.
145 #define SCSI3_RESV_READSHARED_OBSOLETE 0
146 #define SCSI3_RESV_WRITEEXCLUSIVE 1
147 #define SCSI3_RESV_READEXCLUSIVE_OBSOLETE 2
148 #define SCSI3_RESV_EXCLUSIVEACCESS 3
149 #define SCSI3_RESV_SHAREDACCESS_OBSOLETE 4
150 #define SCSI3_RESV_WRITEEXCLUSIVEREGISTRANTSONLY 5
151 #define SCSI3_RESV_EXCLUSIVEACCESSREGISTRANTSONLY 6
153 #define SCSI3_SCOPE_LOGICALUNIT 0
154 #define SCSI3_SCOPE_EXTENT_OBSOLETE 1
155 #define SCSI3_SCOPE_ELEMENT 2
161 #endif /* _SYS_MHD_H */