xref: /illumos-gate/usr/src/uts/common/sys/sysevent/dr.h (revision 4f364e7c95ee7fd9d5bbeddc1940e92405bb0e72)
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_SYSEVENT_DR_H
27 #define	_SYS_SYSEVENT_DR_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * dr.h contains the publicly defined sysevent attribute names and values
37  * for all DR type sysevents.  Additions/removals/changes are subject to
38  * PSARC approval.
39  */
40 
41 /*
42  * Event type EC_DR/ESC_DR_AP_STATE_CHANGE event schema
43  *	Event Class 	- EC_DR
44  *	Event Sub-Class - ESC_DR_AP_STATE_CHANGE
45  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
46  *	Attribute Name	- DR_AP_ID
47  *	Attribute Type	- SE_DATA_TYPE_STRING
48  *	Attribute Value	- [Attachment Point Identifier]
49  *	Attribute Name	- DR_HINT
50  *	Attribute Type	- SE_DATA_TYPE_STRING
51  *	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
52  */
53 #define	DR_AP_ID	"dr_ap_id"	/* Attachment point id */
54 #define	DR_HINT	"dr_hint"		/* Operation hint */
55 #define	DR_HINT_INSERT	"dr_insert"	/* Insert hint */
56 #define	DR_HINT_REMOVE	"dr_remove"	/* Remove hint */
57 #define	DR_RESERVED_ATTR	""
58 
59 /*
60  * Useful macros for insert/remove event.
61  */
62 #define	SE_NO_HINT		0x0
63 #define	SE_HINT_INSERT		0x1
64 #define	SE_HINT_REMOVE		0x2
65 #define	SE_HINT2STR(h)		((h) == SE_HINT_INSERT ? DR_HINT_INSERT : \
66 				    (h) == SE_HINT_REMOVE ? DR_HINT_REMOVE : \
67 				    DR_RESERVED_ATTR)
68 /*
69  * Event type EC_DR/ESC_DR_REQ event schema
70  *	Event Class	- EC_DR
71  *	Event Sub-Class	- ESC_DR_REQ
72  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
73  *	Attribute Name	- DR_AP_ID
74  *	Attribute Type	- SE_DATA_TYPE_STRING
75  *	Attribute Value	- [Attachment Point Name]
76  *	Attribute Name	- DR_REQ_TYPE
77  *	Attribute Type	- SE_DATA_TYPE_STRING
78  *	Attribute Value	- DR_RESERVED_ATTR | DR_REQ_INCOMING_RES |
79  *			DR_REQ_OUTGOING_RES | DR_REQ_INVESTIGATE_RES
80  */
81 #define	DR_REQ_TYPE	"dr_request_type"	/* User request type */
82 #define	DR_REQ_INCOMING_RES	"dr_request_incoming_resource"
83 #define	DR_REQ_OUTGOING_RES	"dr_request_outgoing_resource"
84 #define	DR_REQ_INVESTIGATE_RES	"dr_request_investigate_resource"
85 
86 #define	SE_INVESTIGATE_RES	0x0
87 #define	SE_INCOMING_RES		0x1
88 #define	SE_OUTGOING_RES		0x2
89 #define	SE_REQ2STR(h)		((h) == SE_INCOMING_RES ? \
90 					DR_REQ_INCOMING_RES : \
91 					(h) == SE_OUTGOING_RES ? \
92 					DR_REQ_OUTGOING_RES : \
93 					DR_REQ_INVESTIGATE_RES)
94 /*
95  * 	Event Class 	- EC_DR
96  * 	Event Sub-Class - ESC_DR_TARGET_STATE_CHANGE
97  * 	Event Publisher	- SUNW:kern:<driver-name>
98  * 	Attribute Name	- DR_TARGET_ID
99  * 	Attribute Type	- [SE_DATA_TYPE_STRING]
100  * 	Attribute Value	- </physical_path_to_hba:target>
101  * 	Attribute Name	- DR_HINT
102  * 	Attribute Type	- [SE_DATA_TYPE_STRING]
103  * 	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
104  */
105 #define	DR_TARGET_ID	"dr_target_id"
106 
107 #ifdef	__cplusplus
108 }
109 #endif
110 
111 #endif /* _SYS_SYSEVENT_DR_H */
112