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