xref: /titanic_52/usr/src/uts/common/sys/sysevent/dev.h (revision 06e46062ef4f5f4b687cbafb4518fb123fe23920)
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 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SYSEVENT_DEV_H
28 #define	_SYS_SYSEVENT_DEV_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/sysevent/eventdefs.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Event schema for EC_DEV_ADD/ESC_DISK
40  *
41  *	Event Class 	- EC_DEV_ADD
42  *	Event Sub-Class - ESC_DISK
43  *
44  *	Attribute Name	- EV_VERSION
45  *	Attribute Type	- DATA_TYPE_INT32
46  *	Attribute Value	- event version number
47  *
48  *	Attribute Name	- DEV_NAME
49  *	Attribute Type	- DATA_TYPE_STRING
50  *	Attribute Value	- /dev name to the raw device.
51  *			  The name does not include the slice number component.
52  *
53  *	Attribute Name	- DEV_PHYS_PATH
54  *	Attribute Type	- DATA_TYPE_STRING
55  *	Attribute Value	- physical path of the device without the "/devices"
56  *			  prefix.
57  *
58  *	Attribute Name	- DEV_DRIVER_NAME
59  *	Attribute Type	- DATA_TYPE_STRING
60  *	Attribute Value	- driver name
61  *
62  *	Attribute Name	- DEV_INSTANCE
63  *	Attribute Type	- DATA_TYPE_INT32
64  *	Attribute Value	- driver instance number
65  *
66  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
67  *	Attribute Type	- data type of the devinfo_node_property
68  *	Attribute Value	- value of the devinfo_node_property
69  *
70  *
71  * Event schema for EC_DEV_ADD/ESC_NETWORK
72  *
73  *	Event Class 	- EC_DEV_ADD
74  *	Event Sub-Class - ESC_NETWORK
75  *
76  *	Attribute Name	- EV_VERSION
77  *	Attribute Type	- DATA_TYPE_INT32
78  *	Attribute Value	- event version number
79  *
80  *	Attribute Name	- DEV_NAME
81  *	Attribute Type	- DATA_TYPE_STRING
82  *	Attribute Value	- /dev name associated with the device if exists.
83  *			  /dev name associated with the driver for DLPI
84  *			  Style-2 only drivers.
85  *
86  *	Attribute Name	- DEV_PHYS_PATH
87  *	Attribute Type	- DATA_TYPE_STRING
88  *	Attribute Value	- physical path of the device without the "/devices"
89  *			  prefix.
90  *
91  *	Attribute Name	- DEV_DRIVER_NAME
92  *	Attribute Type	- DATA_TYPE_STRING
93  *	Attribute Value	- driver name
94  *
95  *	Attribute Name	- DEV_INSTANCE
96  *	Attribute Type	- DATA_TYPE_INT32
97  *	Attribute Value	- driver instance number
98  *
99  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
100  *	Attribute Type	- data type of the devinfo_node_property
101  *	Attribute Value	- value of the devinfo_node_property
102  *
103  *
104  * Event schema for EC_DEV_REMOVE/ESC_DISK
105  *
106  *	Event Class 	- EC_DEV_REMOVE
107  *	Event Sub-Class - ESC_DISK
108  *
109  *	Attribute Name	- EV_VERSION
110  *	Attribute Type	- DATA_TYPE_INT32
111  *	Attribute Value	- event version number
112  *
113  *	Attribute Name	- DEV_NAME
114  *	Attribute Type	- DATA_TYPE_STRING
115  *	Attribute Value	- /dev name to the raw device.
116  *			  The name does not include the slice number component.
117  *
118  *	Attribute Name	- DEV_PHYS_PATH
119  *	Attribute Type	- DATA_TYPE_STRING
120  *	Attribute Value	- physical path of the device without the "/devices"
121  *			  prefix.
122  *
123  *	Attribute Name	- DEV_DRIVER_NAME
124  *	Attribute Type	- DATA_TYPE_STRING
125  *	Attribute Value	- driver name
126  *
127  *	Attribute Name	- DEV_INSTANCE
128  *	Attribute Type	- DATA_TYPE_INT32
129  *	Attribute Value	- driver instance number
130  *
131  *
132  * Event schema for EC_DEV_REMOVE/ESC_NETWORK
133  *
134  *	Event Class 	- EC_DEV_REMOVE
135  *	Event Sub-Class - ESC_NETWORK
136  *
137  *	Attribute Name	- EV_VERSION
138  *	Attribute Type	- DATA_TYPE_INT32
139  *	Attribute Value	- event version number
140  *
141  *	Attribute Name	- DEV_NAME
142  *	Attribute Type	- DATA_TYPE_STRING
143  *	Attribute Value	- /dev name associated with the device if exists.
144  *			  /dev name associated with the driver for DLPI
145  *			  Style-2 only drivers.
146  *
147  *	Attribute Name	- DEV_PHYS_PATH
148  *	Attribute Type	- DATA_TYPE_STRING
149  *	Attribute Value	- physical path of the device without the "/devices"
150  *			  prefix.
151  *
152  *	Attribute Name	- DEV_DRIVER_NAME
153  *	Attribute Type	- DATA_TYPE_STRING
154  *	Attribute Value	- driver name
155  *
156  *	Attribute Name	- DEV_INSTANCE
157  *	Attribute Type	- DATA_TYPE_INT32
158  *	Attribute Value	- driver instance number
159  *
160  *
161  * Event schema for EC_DEV_BRANCH/ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
162  *
163  *	Event Class 	- EC_DEV_BRANCH
164  *	Event Sub-Class - ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
165  *
166  *	Attribute Name	- EV_VERSION
167  *	Attribute Type	- DATA_TYPE_INT32
168  *	Attribute Value	- event version number
169  *
170  *	Attribute Name	- DEV_PHYS_PATH
171  *	Attribute Type	- DATA_TYPE_STRING
172  *	Attribute Value	- physical path to the root node of the device subtree
173  *			  without the "/devices" prefix.
174  */
175 
176 #define	EV_VERSION		"version"
177 #define	DEV_PHYS_PATH		"phys_path"
178 #define	DEV_NAME		"dev_name"
179 #define	DEV_DRIVER_NAME		"driver_name"
180 #define	DEV_INSTANCE		"instance"
181 #define	DEV_PROP_PREFIX		"prop-"
182 
183 #define	EV_V1			1
184 
185 /* maximum number of devinfo node properties added to the event */
186 #define	MAX_PROP_COUNT		100
187 
188 /* only properties with size less than PROP_LEN_LIMIT are added to the event */
189 #define	PROP_LEN_LIMIT		1024
190 
191 #ifdef	__cplusplus
192 }
193 #endif
194 
195 #endif /* _SYS_SYSEVENT_DEV_H */
196