xref: /illumos-gate/usr/src/uts/common/sys/contract/device.h (revision dd72704bd9e794056c558153663c739e2012d721)
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 (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 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_CONTRACT_DEVICE_H
27 #define	_SYS_CONTRACT_DEVICE_H
28 
29 #include <sys/contract.h>
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 typedef struct ctmpl_device ctmpl_device_t;
36 typedef struct cont_device cont_device_t;
37 
38 /*
39  * ct_ev_* flags
40  */
41 #define	CT_DEV_EV_ONLINE	0x1	/* device is moving to online state */
42 #define	CT_DEV_EV_DEGRADED	0x2	/* device is moving to degraded state */
43 #define	CT_DEV_EV_OFFLINE	0x4	/* device is moving to offline state */
44 #define	CT_DEV_ALLEVENT		0x7
45 
46 /*
47  * ctp_id values
48  */
49 #define	CTDP_ACCEPT		0x1	/* the acceptable set term */
50 #define	CTDP_NONEG		0x2	/* the non-negotiable term */
51 #define	CTDP_MINOR		0x4	/* the minor path term */
52 #define	CTDP_ALLPARAMS		0x7
53 
54 #define	CTDP_NONEG_CLEAR	0x0	/* clear the noneg flag */
55 #define	CTDP_NONEG_SET		0x1	/* set noneg */
56 
57 /*
58  * Status fields
59  */
60 #define	CTDS_STATE		"ctds_state"
61 #define	CTDS_ASET		"ctds_aset"
62 #define	CTDS_NONEG		"ctds_noneg"
63 #define	CTDS_MINOR		"ctds_minor"
64 
65 /*
66  * Max Time allowed for synchronous acknowledgement of a negotiation event
67  */
68 #define	CT_DEV_ACKTIME	60	/* 60 seconds */
69 
70 #ifdef	__cplusplus
71 }
72 #endif
73 
74 #endif	/* _SYS_CONTRACT_DEVICE_H */
75