xref: /onnv-gate/usr/src/uts/common/sys/sysevent/dev.h (revision 2441:5de3659dcf9f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*2441Sjacobs  * Common Development and Distribution License (the "License").
6*2441Sjacobs  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*2441Sjacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_SYSEVENT_DEV_H
270Sstevel@tonic-gate #define	_SYS_SYSEVENT_DEV_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <sys/sysevent/eventdefs.h>
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifdef	__cplusplus
340Sstevel@tonic-gate extern "C" {
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate /*
380Sstevel@tonic-gate  * Event schema for EC_DEV_ADD/ESC_DISK
390Sstevel@tonic-gate  *
400Sstevel@tonic-gate  *	Event Class 	- EC_DEV_ADD
410Sstevel@tonic-gate  *	Event Sub-Class - ESC_DISK
420Sstevel@tonic-gate  *
430Sstevel@tonic-gate  *	Attribute Name	- EV_VERSION
440Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
450Sstevel@tonic-gate  *	Attribute Value	- event version number
460Sstevel@tonic-gate  *
470Sstevel@tonic-gate  *	Attribute Name	- DEV_NAME
480Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
490Sstevel@tonic-gate  *	Attribute Value	- /dev name to the raw device.
500Sstevel@tonic-gate  *			  The name does not include the slice number component.
510Sstevel@tonic-gate  *
520Sstevel@tonic-gate  *	Attribute Name	- DEV_PHYS_PATH
530Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
540Sstevel@tonic-gate  *	Attribute Value	- physical path of the device without the "/devices"
550Sstevel@tonic-gate  *			  prefix.
560Sstevel@tonic-gate  *
570Sstevel@tonic-gate  *	Attribute Name	- DEV_DRIVER_NAME
580Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
590Sstevel@tonic-gate  *	Attribute Value	- driver name
600Sstevel@tonic-gate  *
610Sstevel@tonic-gate  *	Attribute Name	- DEV_INSTANCE
620Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
630Sstevel@tonic-gate  *	Attribute Value	- driver instance number
640Sstevel@tonic-gate  *
650Sstevel@tonic-gate  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
660Sstevel@tonic-gate  *	Attribute Type	- data type of the devinfo_node_property
670Sstevel@tonic-gate  *	Attribute Value	- value of the devinfo_node_property
680Sstevel@tonic-gate  *
690Sstevel@tonic-gate  *
700Sstevel@tonic-gate  * Event schema for EC_DEV_ADD/ESC_NETWORK
710Sstevel@tonic-gate  *
720Sstevel@tonic-gate  *	Event Class 	- EC_DEV_ADD
730Sstevel@tonic-gate  *	Event Sub-Class - ESC_NETWORK
740Sstevel@tonic-gate  *
750Sstevel@tonic-gate  *	Attribute Name	- EV_VERSION
760Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
770Sstevel@tonic-gate  *	Attribute Value	- event version number
780Sstevel@tonic-gate  *
790Sstevel@tonic-gate  *	Attribute Name	- DEV_NAME
800Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
810Sstevel@tonic-gate  *	Attribute Value	- /dev name associated with the device if exists.
820Sstevel@tonic-gate  *			  /dev name associated with the driver for DLPI
830Sstevel@tonic-gate  *			  Style-2 only drivers.
840Sstevel@tonic-gate  *
850Sstevel@tonic-gate  *	Attribute Name	- DEV_PHYS_PATH
860Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
870Sstevel@tonic-gate  *	Attribute Value	- physical path of the device without the "/devices"
880Sstevel@tonic-gate  *			  prefix.
890Sstevel@tonic-gate  *
900Sstevel@tonic-gate  *	Attribute Name	- DEV_DRIVER_NAME
910Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
920Sstevel@tonic-gate  *	Attribute Value	- driver name
930Sstevel@tonic-gate  *
940Sstevel@tonic-gate  *	Attribute Name	- DEV_INSTANCE
950Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
960Sstevel@tonic-gate  *	Attribute Value	- driver instance number
970Sstevel@tonic-gate  *
980Sstevel@tonic-gate  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
990Sstevel@tonic-gate  *	Attribute Type	- data type of the devinfo_node_property
1000Sstevel@tonic-gate  *	Attribute Value	- value of the devinfo_node_property
1010Sstevel@tonic-gate  *
1020Sstevel@tonic-gate  *
103*2441Sjacobs  * Event schema for EC_DEV_ADD/ESC_PRINTER
104*2441Sjacobs  *
105*2441Sjacobs  *	Event Class 	- EC_DEV_ADD
106*2441Sjacobs  *	Event Sub-Class - ESC_PRINTER
107*2441Sjacobs  *
108*2441Sjacobs  *	Attribute Name	- EV_VERSION
109*2441Sjacobs  *	Attribute Type	- DATA_TYPE_INT32
110*2441Sjacobs  *	Attribute Value	- event version number
111*2441Sjacobs  *
112*2441Sjacobs  *	Attribute Name	- DEV_NAME
113*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
114*2441Sjacobs  *	Attribute Value	- /dev/printers name associated with the device
115*2441Sjacobs  *			  if exists.
116*2441Sjacobs  *			  /dev name associated with the device if it exists
117*2441Sjacobs  *
118*2441Sjacobs  *	Attribute Name	- DEV_PHYS_PATH
119*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
120*2441Sjacobs  *	Attribute Value	- physical path of the device without the "/devices"
121*2441Sjacobs  *			  prefix.
122*2441Sjacobs  *
123*2441Sjacobs  *	Attribute Name	- DEV_DRIVER_NAME
124*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
125*2441Sjacobs  *	Attribute Value	- driver name
126*2441Sjacobs  *
127*2441Sjacobs  *	Attribute Name	- DEV_INSTANCE
128*2441Sjacobs  *	Attribute Type	- DATA_TYPE_INT32
129*2441Sjacobs  *	Attribute Value	- driver instance number
130*2441Sjacobs  *
131*2441Sjacobs  *	Attribute Name	- DEV_PROP_PREFIX<devinfo_node_property>
132*2441Sjacobs  *	Attribute Type	- data type of the devinfo_node_property
133*2441Sjacobs  *	Attribute Value	- value of the devinfo_node_property
134*2441Sjacobs  *
135*2441Sjacobs  *
1360Sstevel@tonic-gate  * Event schema for EC_DEV_REMOVE/ESC_DISK
1370Sstevel@tonic-gate  *
1380Sstevel@tonic-gate  *	Event Class 	- EC_DEV_REMOVE
1390Sstevel@tonic-gate  *	Event Sub-Class - ESC_DISK
1400Sstevel@tonic-gate  *
1410Sstevel@tonic-gate  *	Attribute Name	- EV_VERSION
1420Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
1430Sstevel@tonic-gate  *	Attribute Value	- event version number
1440Sstevel@tonic-gate  *
1450Sstevel@tonic-gate  *	Attribute Name	- DEV_NAME
1460Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1470Sstevel@tonic-gate  *	Attribute Value	- /dev name to the raw device.
1480Sstevel@tonic-gate  *			  The name does not include the slice number component.
1490Sstevel@tonic-gate  *
1500Sstevel@tonic-gate  *	Attribute Name	- DEV_PHYS_PATH
1510Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1520Sstevel@tonic-gate  *	Attribute Value	- physical path of the device without the "/devices"
1530Sstevel@tonic-gate  *			  prefix.
1540Sstevel@tonic-gate  *
1550Sstevel@tonic-gate  *	Attribute Name	- DEV_DRIVER_NAME
1560Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1570Sstevel@tonic-gate  *	Attribute Value	- driver name
1580Sstevel@tonic-gate  *
1590Sstevel@tonic-gate  *	Attribute Name	- DEV_INSTANCE
1600Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
1610Sstevel@tonic-gate  *	Attribute Value	- driver instance number
1620Sstevel@tonic-gate  *
1630Sstevel@tonic-gate  *
1640Sstevel@tonic-gate  * Event schema for EC_DEV_REMOVE/ESC_NETWORK
1650Sstevel@tonic-gate  *
1660Sstevel@tonic-gate  *	Event Class 	- EC_DEV_REMOVE
1670Sstevel@tonic-gate  *	Event Sub-Class - ESC_NETWORK
1680Sstevel@tonic-gate  *
1690Sstevel@tonic-gate  *	Attribute Name	- EV_VERSION
1700Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
1710Sstevel@tonic-gate  *	Attribute Value	- event version number
1720Sstevel@tonic-gate  *
1730Sstevel@tonic-gate  *	Attribute Name	- DEV_NAME
1740Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1750Sstevel@tonic-gate  *	Attribute Value	- /dev name associated with the device if exists.
1760Sstevel@tonic-gate  *			  /dev name associated with the driver for DLPI
1770Sstevel@tonic-gate  *			  Style-2 only drivers.
1780Sstevel@tonic-gate  *
1790Sstevel@tonic-gate  *	Attribute Name	- DEV_PHYS_PATH
1800Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1810Sstevel@tonic-gate  *	Attribute Value	- physical path of the device without the "/devices"
1820Sstevel@tonic-gate  *			  prefix.
1830Sstevel@tonic-gate  *
1840Sstevel@tonic-gate  *	Attribute Name	- DEV_DRIVER_NAME
1850Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
1860Sstevel@tonic-gate  *	Attribute Value	- driver name
1870Sstevel@tonic-gate  *
1880Sstevel@tonic-gate  *	Attribute Name	- DEV_INSTANCE
1890Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
1900Sstevel@tonic-gate  *	Attribute Value	- driver instance number
1910Sstevel@tonic-gate  *
1920Sstevel@tonic-gate  *
193*2441Sjacobs  * Event schema for EC_DEV_REMOVE/ESC_PRINTER
194*2441Sjacobs  *
195*2441Sjacobs  *	Event Class 	- EC_DEV_REMOVE
196*2441Sjacobs  *	Event Sub-Class - ESC_PRINTER
197*2441Sjacobs  *
198*2441Sjacobs  *	Attribute Name	- EV_VERSION
199*2441Sjacobs  *	Attribute Type	- DATA_TYPE_INT32
200*2441Sjacobs  *	Attribute Value	- event version number
201*2441Sjacobs  *
202*2441Sjacobs  *	Attribute Name	- DEV_NAME
203*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
204*2441Sjacobs  *	Attribute Value	- /dev/printers name associated with the device
205*2441Sjacobs  *			  if exists.
206*2441Sjacobs  *			  /dev name associated with the device if it exists
207*2441Sjacobs  *
208*2441Sjacobs  *	Attribute Name	- DEV_PHYS_PATH
209*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
210*2441Sjacobs  *	Attribute Value	- physical path of the device without the "/devices"
211*2441Sjacobs  *			  prefix.
212*2441Sjacobs  *
213*2441Sjacobs  *	Attribute Name	- DEV_DRIVER_NAME
214*2441Sjacobs  *	Attribute Type	- DATA_TYPE_STRING
215*2441Sjacobs  *	Attribute Value	- driver name
216*2441Sjacobs  *
217*2441Sjacobs  *	Attribute Name	- DEV_INSTANCE
218*2441Sjacobs  *	Attribute Type	- DATA_TYPE_INT32
219*2441Sjacobs  *	Attribute Value	- driver instance number
220*2441Sjacobs  *
221*2441Sjacobs  *
2220Sstevel@tonic-gate  * Event schema for EC_DEV_BRANCH/ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
2230Sstevel@tonic-gate  *
2240Sstevel@tonic-gate  *	Event Class 	- EC_DEV_BRANCH
2250Sstevel@tonic-gate  *	Event Sub-Class - ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE
2260Sstevel@tonic-gate  *
2270Sstevel@tonic-gate  *	Attribute Name	- EV_VERSION
2280Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_INT32
2290Sstevel@tonic-gate  *	Attribute Value	- event version number
2300Sstevel@tonic-gate  *
2310Sstevel@tonic-gate  *	Attribute Name	- DEV_PHYS_PATH
2320Sstevel@tonic-gate  *	Attribute Type	- DATA_TYPE_STRING
2330Sstevel@tonic-gate  *	Attribute Value	- physical path to the root node of the device subtree
2340Sstevel@tonic-gate  *			  without the "/devices" prefix.
2350Sstevel@tonic-gate  */
2360Sstevel@tonic-gate 
2370Sstevel@tonic-gate #define	EV_VERSION		"version"
2380Sstevel@tonic-gate #define	DEV_PHYS_PATH		"phys_path"
2390Sstevel@tonic-gate #define	DEV_NAME		"dev_name"
2400Sstevel@tonic-gate #define	DEV_DRIVER_NAME		"driver_name"
2410Sstevel@tonic-gate #define	DEV_INSTANCE		"instance"
2420Sstevel@tonic-gate #define	DEV_PROP_PREFIX		"prop-"
2430Sstevel@tonic-gate 
2440Sstevel@tonic-gate #define	EV_V1			1
2450Sstevel@tonic-gate 
2460Sstevel@tonic-gate /* maximum number of devinfo node properties added to the event */
2470Sstevel@tonic-gate #define	MAX_PROP_COUNT		100
2480Sstevel@tonic-gate 
2490Sstevel@tonic-gate /* only properties with size less than PROP_LEN_LIMIT are added to the event */
2500Sstevel@tonic-gate #define	PROP_LEN_LIMIT		1024
2510Sstevel@tonic-gate 
2520Sstevel@tonic-gate #ifdef	__cplusplus
2530Sstevel@tonic-gate }
2540Sstevel@tonic-gate #endif
2550Sstevel@tonic-gate 
2560Sstevel@tonic-gate #endif /* _SYS_SYSEVENT_DEV_H */
257