xref: /titanic_51/usr/src/uts/sun4u/serengeti/sys/sgevents.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_SGEVENTS_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_SGEVENTS_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * sgevents.h - Serengeti Events defintions
38*7c478bd9Sstevel@tonic-gate  *
39*7c478bd9Sstevel@tonic-gate  * This header file contains the common definitions and macros for the
40*7c478bd9Sstevel@tonic-gate  * events support on the Serengeti platform.
41*7c478bd9Sstevel@tonic-gate  */
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate /*
44*7c478bd9Sstevel@tonic-gate  * Serengeti Events Payloads (events are defined in sgsbbc_mailbox.h)
45*7c478bd9Sstevel@tonic-gate  */
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate /*
48*7c478bd9Sstevel@tonic-gate  * there are a class of events which are consider generic. They all have
49*7c478bd9Sstevel@tonic-gate  * the same msg_type and payload.  There is a detail that comes with it to
50*7c478bd9Sstevel@tonic-gate  * let the client know what actualy happened. This can be found in the
51*7c478bd9Sstevel@tonic-gate  * event_details as defined below
52*7c478bd9Sstevel@tonic-gate  */
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate #define	SG_EVT_BOARD_ABSENT		0x10
56*7c478bd9Sstevel@tonic-gate #define	SG_EVT_BOARD_PRESENT		0x11
57*7c478bd9Sstevel@tonic-gate #define	SG_EVT_UNASSIGN			0x20
58*7c478bd9Sstevel@tonic-gate #define	SG_EVT_ASSIGN			0x21
59*7c478bd9Sstevel@tonic-gate #define	SG_EVT_UNAVAILABLE		0x30
60*7c478bd9Sstevel@tonic-gate #define	SG_EVT_AVAILABLE		0x31
61*7c478bd9Sstevel@tonic-gate #define	SG_EVT_POWER_OFF		0x40
62*7c478bd9Sstevel@tonic-gate #define	SG_EVT_POWER_ON			0x41
63*7c478bd9Sstevel@tonic-gate #define	SG_EVT_PASSED_TEST		0x50
64*7c478bd9Sstevel@tonic-gate #define	SG_EVT_FAILED_TEST		0x51
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate 
67*7c478bd9Sstevel@tonic-gate /*
68*7c478bd9Sstevel@tonic-gate  * Miscallaneous defintions
69*7c478bd9Sstevel@tonic-gate  */
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate /* Payload of ENV event */
72*7c478bd9Sstevel@tonic-gate #define	SC_EVENT_FAN		0x4
73*7c478bd9Sstevel@tonic-gate #define	SC_EVENT_ENV		0x7
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate /* Payload of PANIC_SHUTDOWN event */
76*7c478bd9Sstevel@tonic-gate #define	SC_EVENT_PANIC_ENV		0x1
77*7c478bd9Sstevel@tonic-gate #define	SC_EVENT_PANIC_KEYSWITCH	0x2
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate /*
81*7c478bd9Sstevel@tonic-gate  * Generic event payload.
82*7c478bd9Sstevel@tonic-gate  */
83*7c478bd9Sstevel@tonic-gate typedef struct {
84*7c478bd9Sstevel@tonic-gate 	int node;		/* wildcat node number */
85*7c478bd9Sstevel@tonic-gate 	int slot;		/* Slot number for this event */
86*7c478bd9Sstevel@tonic-gate 	uint64_t parent_hdl;	/* Parent fru handle */
87*7c478bd9Sstevel@tonic-gate 	uint64_t child_hdl;	/* Child fru handle */
88*7c478bd9Sstevel@tonic-gate 	int event_details;
89*7c478bd9Sstevel@tonic-gate } sg_system_fru_descriptor_t;
90*7c478bd9Sstevel@tonic-gate 
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate /*
93*7c478bd9Sstevel@tonic-gate  * Domain State event payload.
94*7c478bd9Sstevel@tonic-gate  *
95*7c478bd9Sstevel@tonic-gate  * Possible values for this are defined in serengeti.h (SG_KEY_POSN_XXX)
96*7c478bd9Sstevel@tonic-gate  */
97*7c478bd9Sstevel@tonic-gate typedef int	sg_event_key_position_t;
98*7c478bd9Sstevel@tonic-gate 
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate /*
101*7c478bd9Sstevel@tonic-gate  * Environmental event payloads.
102*7c478bd9Sstevel@tonic-gate  */
103*7c478bd9Sstevel@tonic-gate typedef struct sg_event_env_changed {
104*7c478bd9Sstevel@tonic-gate 	int32_t		event_type;
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate } sg_event_env_changed_t;
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate typedef struct sg_event_fan_status {
109*7c478bd9Sstevel@tonic-gate 	int32_t		event_type;
110*7c478bd9Sstevel@tonic-gate 	int32_t		node_id;
111*7c478bd9Sstevel@tonic-gate 	int32_t		slot_number;
112*7c478bd9Sstevel@tonic-gate 	int32_t		fan_speed;
113*7c478bd9Sstevel@tonic-gate 
114*7c478bd9Sstevel@tonic-gate } sg_event_fan_status_t;
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate /*
118*7c478bd9Sstevel@tonic-gate  * Panic Shutdown event payload.
119*7c478bd9Sstevel@tonic-gate  */
120*7c478bd9Sstevel@tonic-gate typedef int	sg_panic_shutdown_t;
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate 
123*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
124*7c478bd9Sstevel@tonic-gate }
125*7c478bd9Sstevel@tonic-gate #endif
126*7c478bd9Sstevel@tonic-gate 
127*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_SGEVENTS_H */
128