xref: /illumos-gate/usr/src/uts/sun4u/daktari/sys/hpc3130_events.h (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_DAK_HPC3130_EVENTS_H
28 #define	_DAK_HPC3130_EVENTS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	HPC3130_DAK_IOC			('D' << 8)
37 #define	HPC3130_GET_EVENT		(HPC3130_DAK_IOC | 0)	/* (uint8_t) */
38 #define	HPC3130_CONF_DR			(HPC3130_DAK_IOC | 1)
39 
40 #define	HPC3130_SLOTS			0x4
41 #define	HPC3130_CONTROLLERS		0x4
42 #define	HPC3130_DR_DISABLE		0x0
43 #define	HPC3130_DR_ENABLE		0x1
44 
45 #ifdef _KERNEL
46 
47 /*
48  * Internal events bits.  These are translated to hpc3130_event_type_t's
49  * by the time the user sees them (in ioctl(HPC3130_GET_SOFT_EVENT))
50  */
51 #define	HPC3130_IEVENT_OCCUPANCY	(1<<0)
52 #define	HPC3130_IEVENT_POWER		(1<<1)
53 #define	HPC3130_IEVENT_BUTTON		(1<<2)
54 #define	HPC3130_IEVENT_FAULT		(1<<3)
55 #define	HPC3130_IEVENT_OK2REM		(1<<4)
56 #endif /* _KERNEL */
57 
58 typedef enum {
59 	HPC3130_EVENT_NONE,
60 	HPC3130_EVENT_INSERTION,
61 	HPC3130_EVENT_REMOVAL,
62 	HPC3130_EVENT_POWERON,
63 	HPC3130_EVENT_POWEROFF,
64 	HPC3130_EVENT_BUTTON,
65 	HPC3130_LED_FAULT_ON,
66 	HPC3130_LED_FAULT_OFF,
67 	HPC3130_LED_REMOVABLE_ON,
68 	HPC3130_LED_REMOVABLE_OFF
69 } hpc3130_event_type_t;
70 
71 #define	HPC3130_NAME_MAX MAXPATHLEN
72 
73 typedef enum {
74 	HPC3130_SLOT_TYPE_PCI,
75 	HPC3130_SLOT_TYPE_SBD
76 } hpc3130_slot_type_t;
77 
78 struct hpc3130_event {
79 	hpc3130_event_type_t id;
80 	char name[HPC3130_NAME_MAX];
81 };
82 
83 #ifdef	__cplusplus
84 }
85 #endif
86 
87 #endif	/* _DAK_HPC3130_EVENTS_H */
88