xref: /titanic_50/usr/src/uts/common/sys/sysevent/dev.h (revision 0bb073995ac5a95bd35f2dd790df1ea3d8c2d507)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_SYSEVENT_DEV_H
27 #define	_SYS_SYSEVENT_DEV_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/sysevent/eventdefs.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * Event schema for EC_DEV_ADD/ESC_DISK
39  *
40  *	Event Class 	- EC_DEV_ADD
41  *	Event Sub-Class - ESC_DISK
42  *
43  *	Attribute Name	- EV_VERSION
44  *	Attribute Type	- DATA_TYPE_INT32
45  *	Attribute Value	- event version number
46  *
47  *	Attribute Name	- DEV_NAME
48  *	Attribute Type	- DATA_TYPE_STRING
49  *	Attribute Value	- /dev name to the raw device.
50  *			  The name does not include the slice number component.
51  *
52  *	Attribute Name	- DEV_PHYS_PATH
53  *	Attribute Type	- DATA_TYPE_STRING
54  *	Attribute Value	- physical path of the device without the "/devices"
55  *			  prefix.
56  *
57  *	Attribute Name	- DEV_DRIVER_NAME
58  *	Attribute Type	- DATA_TYPE_STRING
59  *	Attribute Value	- driver name
60  *
61  *	Attribute Name	- DEV_INSTANCE
62  *	Attribute Type	- DATA_TYPE_INT32
63  *	Attribute Value	- driver instance number
64  *
65  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
66  *	Attribute Type	- data type of the devinfo_node_property
67  *	Attribute Value	- value of the devinfo_node_property
68  *
69  *
70  * Event schema for EC_DEV_ADD/ESC_NETWORK
71  *
72  *	Event Class 	- EC_DEV_ADD
73  *	Event Sub-Class - ESC_NETWORK
74  *
75  *	Attribute Name	- EV_VERSION
76  *	Attribute Type	- DATA_TYPE_INT32
77  *	Attribute Value	- event version number
78  *
79  *	Attribute Name	- DEV_NAME
80  *	Attribute Type	- DATA_TYPE_STRING
81  *	Attribute Value	- /dev name associated with the device if exists.
82  *			  /dev name associated with the driver for DLPI
83  *			  Style-2 only drivers.
84  *
85  *	Attribute Name	- DEV_PHYS_PATH
86  *	Attribute Type	- DATA_TYPE_STRING
87  *	Attribute Value	- physical path of the device without the "/devices"
88  *			  prefix.
89  *
90  *	Attribute Name	- DEV_DRIVER_NAME
91  *	Attribute Type	- DATA_TYPE_STRING
92  *	Attribute Value	- driver name
93  *
94  *	Attribute Name	- DEV_INSTANCE
95  *	Attribute Type	- DATA_TYPE_INT32
96  *	Attribute Value	- driver instance number
97  *
98  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
99  *	Attribute Type	- data type of the devinfo_node_property
100  *	Attribute Value	- value of the devinfo_node_property
101  *
102  *
103  * Event schema for EC_DEV_ADD/ESC_PRINTER
104  *
105  *	Event Class 	- EC_DEV_ADD
106  *	Event Sub-Class - ESC_PRINTER
107  *
108  *	Attribute Name	- EV_VERSION
109  *	Attribute Type	- DATA_TYPE_INT32
110  *	Attribute Value	- event version number
111  *
112  *	Attribute Name	- DEV_NAME
113  *	Attribute Type	- DATA_TYPE_STRING
114  *	Attribute Value	- /dev/printers name associated with the device
115  *			  if exists.
116  *			  /dev name associated with the device if it exists
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  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
132  *	Attribute Type	- data type of the devinfo_node_property
133  *	Attribute Value	- value of the devinfo_node_property
134  *
135  *
136  * Event schema for EC_DEV_REMOVE/ESC_DISK
137  *
138  *	Event Class 	- EC_DEV_REMOVE
139  *	Event Sub-Class - ESC_DISK
140  *
141  *	Attribute Name	- EV_VERSION
142  *	Attribute Type	- DATA_TYPE_INT32
143  *	Attribute Value	- event version number
144  *
145  *	Attribute Name	- DEV_NAME
146  *	Attribute Type	- DATA_TYPE_STRING
147  *	Attribute Value	- /dev name to the raw device.
148  *			  The name does not include the slice number component.
149  *
150  *	Attribute Name	- DEV_PHYS_PATH
151  *	Attribute Type	- DATA_TYPE_STRING
152  *	Attribute Value	- physical path of the device without the "/devices"
153  *			  prefix.
154  *
155  *	Attribute Name	- DEV_DRIVER_NAME
156  *	Attribute Type	- DATA_TYPE_STRING
157  *	Attribute Value	- driver name
158  *
159  *	Attribute Name	- DEV_INSTANCE
160  *	Attribute Type	- DATA_TYPE_INT32
161  *	Attribute Value	- driver instance number
162  *
163  *
164  * Event schema for EC_DEV_REMOVE/ESC_NETWORK
165  *
166  *	Event Class 	- EC_DEV_REMOVE
167  *	Event Sub-Class - ESC_NETWORK
168  *
169  *	Attribute Name	- EV_VERSION
170  *	Attribute Type	- DATA_TYPE_INT32
171  *	Attribute Value	- event version number
172  *
173  *	Attribute Name	- DEV_NAME
174  *	Attribute Type	- DATA_TYPE_STRING
175  *	Attribute Value	- /dev name associated with the device if exists.
176  *			  /dev name associated with the driver for DLPI
177  *			  Style-2 only drivers.
178  *
179  *	Attribute Name	- DEV_PHYS_PATH
180  *	Attribute Type	- DATA_TYPE_STRING
181  *	Attribute Value	- physical path of the device without the "/devices"
182  *			  prefix.
183  *
184  *	Attribute Name	- DEV_DRIVER_NAME
185  *	Attribute Type	- DATA_TYPE_STRING
186  *	Attribute Value	- driver name
187  *
188  *	Attribute Name	- DEV_INSTANCE
189  *	Attribute Type	- DATA_TYPE_INT32
190  *	Attribute Value	- driver instance number
191  *
192  *
193  * Event schema for EC_DEV_REMOVE/ESC_PRINTER
194  *
195  *	Event Class 	- EC_DEV_REMOVE
196  *	Event Sub-Class - ESC_PRINTER
197  *
198  *	Attribute Name	- EV_VERSION
199  *	Attribute Type	- DATA_TYPE_INT32
200  *	Attribute Value	- event version number
201  *
202  *	Attribute Name	- DEV_NAME
203  *	Attribute Type	- DATA_TYPE_STRING
204  *	Attribute Value	- /dev/printers name associated with the device
205  *			  if exists.
206  *			  /dev name associated with the device if it exists
207  *
208  *	Attribute Name	- DEV_PHYS_PATH
209  *	Attribute Type	- DATA_TYPE_STRING
210  *	Attribute Value	- physical path of the device without the "/devices"
211  *			  prefix.
212  *
213  *	Attribute Name	- DEV_DRIVER_NAME
214  *	Attribute Type	- DATA_TYPE_STRING
215  *	Attribute Value	- driver name
216  *
217  *	Attribute Name	- DEV_INSTANCE
218  *	Attribute Type	- DATA_TYPE_INT32
219  *	Attribute Value	- driver instance number
220  *
221  *
222  * Event schema for EC_DEV_BRANCH/ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
223  *
224  *	Event Class 	- EC_DEV_BRANCH
225  *	Event Sub-Class - ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
226  *
227  *	Attribute Name	- EV_VERSION
228  *	Attribute Type	- DATA_TYPE_INT32
229  *	Attribute Value	- event version number
230  *
231  *	Attribute Name	- DEV_PHYS_PATH
232  *	Attribute Type	- DATA_TYPE_STRING
233  *	Attribute Value	- physical path to the root node of the device subtree
234  *			  without the "/devices" prefix.
235  */
236 
237 #define	EV_VERSION		"version"
238 #define	DEV_PHYS_PATH		"phys_path"
239 #define	DEV_NAME		"dev_name"
240 #define	DEV_DRIVER_NAME		"driver_name"
241 #define	DEV_INSTANCE		"instance"
242 #define	DEV_PROP_PREFIX		"prop-"
243 
244 #define	EV_V1			1
245 
246 /* maximum number of devinfo node properties added to the event */
247 #define	MAX_PROP_COUNT		100
248 
249 /* only properties with size less than PROP_LEN_LIMIT are added to the event */
250 #define	PROP_LEN_LIMIT		1024
251 
252 #ifdef	__cplusplus
253 }
254 #endif
255 
256 #endif /* _SYS_SYSEVENT_DEV_H */
257