xref: /titanic_51/usr/src/uts/common/sys/sysevent/dr.h (revision c2ed73806a3c8c92a3fef6a54ede8f85eb1f6052)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*c2ed7380Syd196099  * Common Development and Distribution License (the "License").
6*c2ed7380Syd196099  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*c2ed7380Syd196099  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_SYSEVENT_DR_H
277c478bd9Sstevel@tonic-gate #define	_SYS_SYSEVENT_DR_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * dr.h contains the publicly defined sysevent attribute names and values
377c478bd9Sstevel@tonic-gate  * for all DR type sysevents.  Additions/removals/changes are subject to
387c478bd9Sstevel@tonic-gate  * PSARC approval.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * Event type EC_DR/ESC_DR_AP_STATE_CHANGE event schema
437c478bd9Sstevel@tonic-gate  *	Event Class 	- EC_DR
447c478bd9Sstevel@tonic-gate  *	Event Sub-Class - ESC_DR_AP_STATE_CHANGE
457c478bd9Sstevel@tonic-gate  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
467c478bd9Sstevel@tonic-gate  *	Attribute Name	- DR_AP_ID
477c478bd9Sstevel@tonic-gate  *	Attribute Type	- SE_DATA_TYPE_STRING
487c478bd9Sstevel@tonic-gate  *	Attribute Value	- [Attachment Point Identifier]
497c478bd9Sstevel@tonic-gate  *	Attribute Name	- DR_HINT
507c478bd9Sstevel@tonic-gate  *	Attribute Type	- SE_DATA_TYPE_STRING
517c478bd9Sstevel@tonic-gate  *	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
527c478bd9Sstevel@tonic-gate  */
537c478bd9Sstevel@tonic-gate #define	DR_AP_ID	"dr_ap_id"	/* Attachment point id */
547c478bd9Sstevel@tonic-gate #define	DR_HINT	"dr_hint"		/* Operation hint */
557c478bd9Sstevel@tonic-gate #define	DR_HINT_INSERT	"dr_insert"	/* Insert hint */
567c478bd9Sstevel@tonic-gate #define	DR_HINT_REMOVE	"dr_remove"	/* Remove hint */
577c478bd9Sstevel@tonic-gate #define	DR_RESERVED_ATTR	""
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate /*
607c478bd9Sstevel@tonic-gate  * Useful macros for insert/remove event.
617c478bd9Sstevel@tonic-gate  */
627c478bd9Sstevel@tonic-gate #define	SE_NO_HINT		0x0
637c478bd9Sstevel@tonic-gate #define	SE_HINT_INSERT		0x1
647c478bd9Sstevel@tonic-gate #define	SE_HINT_REMOVE		0x2
657c478bd9Sstevel@tonic-gate #define	SE_HINT2STR(h)		((h) == SE_HINT_INSERT ? DR_HINT_INSERT : \
667c478bd9Sstevel@tonic-gate 				    (h) == SE_HINT_REMOVE ? DR_HINT_REMOVE : \
677c478bd9Sstevel@tonic-gate 				    DR_RESERVED_ATTR)
687c478bd9Sstevel@tonic-gate /*
697c478bd9Sstevel@tonic-gate  * Event type EC_DR/ESC_DR_REQ event schema
707c478bd9Sstevel@tonic-gate  *	Event Class	- EC_DR
717c478bd9Sstevel@tonic-gate  *	Event Sub-Class	- ESC_DR_REQ
727c478bd9Sstevel@tonic-gate  *	Event Publisher	- SUNW:kern:[dr_subsystem_name]
737c478bd9Sstevel@tonic-gate  *	Attribute Name	- DR_AP_ID
747c478bd9Sstevel@tonic-gate  *	Attribute Type	- SE_DATA_TYPE_STRING
757c478bd9Sstevel@tonic-gate  *	Attribute Value	- [Attachment Point Name]
767c478bd9Sstevel@tonic-gate  *	Attribute Name	- DR_REQ_TYPE
777c478bd9Sstevel@tonic-gate  *	Attribute Type	- SE_DATA_TYPE_STRING
787c478bd9Sstevel@tonic-gate  *	Attribute Value	- DR_RESERVED_ATTR | DR_REQ_INCOMING_RES |
797c478bd9Sstevel@tonic-gate  *			DR_REQ_OUTGOING_RES | DR_REQ_INVESTIGATE_RES
807c478bd9Sstevel@tonic-gate  */
817c478bd9Sstevel@tonic-gate #define	DR_REQ_TYPE	"dr_request_type"	/* User request type */
827c478bd9Sstevel@tonic-gate #define	DR_REQ_INCOMING_RES	"dr_request_incoming_resource"
837c478bd9Sstevel@tonic-gate #define	DR_REQ_OUTGOING_RES	"dr_request_outgoing_resource"
847c478bd9Sstevel@tonic-gate #define	DR_REQ_INVESTIGATE_RES	"dr_request_investigate_resource"
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #define	SE_INVESTIGATE_RES	0x0
877c478bd9Sstevel@tonic-gate #define	SE_INCOMING_RES		0x1
887c478bd9Sstevel@tonic-gate #define	SE_OUTGOING_RES		0x2
897c478bd9Sstevel@tonic-gate #define	SE_REQ2STR(h)		((h) == SE_INCOMING_RES ? \
907c478bd9Sstevel@tonic-gate 					DR_REQ_INCOMING_RES : \
917c478bd9Sstevel@tonic-gate 					(h) == SE_OUTGOING_RES ? \
927c478bd9Sstevel@tonic-gate 					DR_REQ_OUTGOING_RES : \
937c478bd9Sstevel@tonic-gate 					DR_REQ_INVESTIGATE_RES)
94*c2ed7380Syd196099 /*
95*c2ed7380Syd196099  * 	Event Class 	- EC_DR
96*c2ed7380Syd196099  * 	Event Sub-Class - ESC_DR_TARGET_STATE_CHANGE
97*c2ed7380Syd196099  * 	Event Publisher	- SUNW:kern:<driver-name>
98*c2ed7380Syd196099  * 	Attribute Name	- DR_TARGET_ID
99*c2ed7380Syd196099  * 	Attribute Type	- [SE_DATA_TYPE_STRING]
100*c2ed7380Syd196099  * 	Attribute Value	- </physical_path_to_hba:target>
101*c2ed7380Syd196099  * 	Attribute Name	- DR_HINT
102*c2ed7380Syd196099  * 	Attribute Type	- [SE_DATA_TYPE_STRING]
103*c2ed7380Syd196099  * 	Attribute Value	- DR_RESERVED_ATTR | DR_HINT_INSERT | DR_HINT_REMOVE
104*c2ed7380Syd196099  */
105*c2ed7380Syd196099 #define	DR_TARGET_ID	"dr_target_id"
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1087c478bd9Sstevel@tonic-gate }
1097c478bd9Sstevel@tonic-gate #endif
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate #endif /* _SYS_SYSEVENT_DR_H */
112