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