xref: /titanic_41/usr/src/uts/common/sys/sysevent/dr.h (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2000-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SYSEVENT_DR_H
28 #define	_SYS_SYSEVENT_DR_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * dr.h contains the publicly defined sysevent attribute names and values
38  * for all DR type sysevents.  Additions/removals/changes are subject to
39  * PSARC approval.
40  */
41 
42 /*
43  * Event type EC_DR/ESC_DR_AP_STATE_CHANGE event schema
44  *	Event Class 	- EC_DR
45  *	Event Sub-Class - ESC_DR_AP_STATE_CHANGE
46  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
47  *	Attribute Name	- DR_AP_ID
48  *	Attribute Type	- SE_DATA_TYPE_STRING
49  *	Attribute Value	- [Attachment Point Identifier]
50  *	Attribute Name	- DR_HINT
51  *	Attribute Type	- SE_DATA_TYPE_STRING
52  *	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
53  */
54 #define	DR_AP_ID	"dr_ap_id"	/* Attachment point id */
55 #define	DR_HINT	"dr_hint"		/* Operation hint */
56 #define	DR_HINT_INSERT	"dr_insert"	/* Insert hint */
57 #define	DR_HINT_REMOVE	"dr_remove"	/* Remove hint */
58 #define	DR_RESERVED_ATTR	""
59 
60 /*
61  * Useful macros for insert/remove event.
62  */
63 #define	SE_NO_HINT		0x0
64 #define	SE_HINT_INSERT		0x1
65 #define	SE_HINT_REMOVE		0x2
66 #define	SE_HINT2STR(h)		((h) == SE_HINT_INSERT ? DR_HINT_INSERT : \
67 				    (h) == SE_HINT_REMOVE ? DR_HINT_REMOVE : \
68 				    DR_RESERVED_ATTR)
69 /*
70  * Event type EC_DR/ESC_DR_REQ event schema
71  *	Event Class	- EC_DR
72  *	Event Sub-Class	- ESC_DR_REQ
73  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
74  *	Attribute Name	- DR_AP_ID
75  *	Attribute Type	- SE_DATA_TYPE_STRING
76  *	Attribute Value	- [Attachment Point Name]
77  *	Attribute Name	- DR_REQ_TYPE
78  *	Attribute Type	- SE_DATA_TYPE_STRING
79  *	Attribute Value	- DR_RESERVED_ATTR | DR_REQ_INCOMING_RES |
80  *			DR_REQ_OUTGOING_RES | DR_REQ_INVESTIGATE_RES
81  */
82 #define	DR_REQ_TYPE	"dr_request_type"	/* User request type */
83 #define	DR_REQ_INCOMING_RES	"dr_request_incoming_resource"
84 #define	DR_REQ_OUTGOING_RES	"dr_request_outgoing_resource"
85 #define	DR_REQ_INVESTIGATE_RES	"dr_request_investigate_resource"
86 
87 #define	SE_INVESTIGATE_RES	0x0
88 #define	SE_INCOMING_RES		0x1
89 #define	SE_OUTGOING_RES		0x2
90 #define	SE_REQ2STR(h)		((h) == SE_INCOMING_RES ? \
91 					DR_REQ_INCOMING_RES : \
92 					(h) == SE_OUTGOING_RES ? \
93 					DR_REQ_OUTGOING_RES : \
94 					DR_REQ_INVESTIGATE_RES)
95 
96 #ifdef	__cplusplus
97 }
98 #endif
99 
100 #endif /* _SYS_SYSEVENT_DR_H */
101