xref: /titanic_52/usr/src/uts/sun4u/sys/rmclomv_impl.h (revision 3db86aab554edbb4244c8d1a1c90f152eee768af)
1*3db86aabSstevel /*
2*3db86aabSstevel  * CDDL HEADER START
3*3db86aabSstevel  *
4*3db86aabSstevel  * The contents of this file are subject to the terms of the
5*3db86aabSstevel  * Common Development and Distribution License (the "License").
6*3db86aabSstevel  * You may not use this file except in compliance with the License.
7*3db86aabSstevel  *
8*3db86aabSstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3db86aabSstevel  * or http://www.opensolaris.org/os/licensing.
10*3db86aabSstevel  * See the License for the specific language governing permissions
11*3db86aabSstevel  * and limitations under the License.
12*3db86aabSstevel  *
13*3db86aabSstevel  * When distributing Covered Code, include this CDDL HEADER in each
14*3db86aabSstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3db86aabSstevel  * If applicable, add the following below this CDDL HEADER, with the
16*3db86aabSstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17*3db86aabSstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3db86aabSstevel  *
19*3db86aabSstevel  * CDDL HEADER END
20*3db86aabSstevel  */
21*3db86aabSstevel 
22*3db86aabSstevel /*
23*3db86aabSstevel  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*3db86aabSstevel  * Use is subject to license terms.
25*3db86aabSstevel  */
26*3db86aabSstevel 
27*3db86aabSstevel #ifndef _SYS_RMCLOMV_IMPL_H
28*3db86aabSstevel #define	_SYS_RMCLOMV_IMPL_H
29*3db86aabSstevel 
30*3db86aabSstevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*3db86aabSstevel 
32*3db86aabSstevel #ifdef	__cplusplus
33*3db86aabSstevel extern "C" {
34*3db86aabSstevel #endif
35*3db86aabSstevel 
36*3db86aabSstevel #include <sys/envmon.h>
37*3db86aabSstevel 
38*3db86aabSstevel /*
39*3db86aabSstevel  * local driver defines and structures
40*3db86aabSstevel  */
41*3db86aabSstevel 
42*3db86aabSstevel #define	RMCLOMV_DEFAULT_MAX_MBOX_WAIT_TIME	10000
43*3db86aabSstevel #define	RMCLOMV_MIN_LED_STATE			0
44*3db86aabSstevel #define	RMCLOMV_MAX_LED_STATE			2
45*3db86aabSstevel /*
46*3db86aabSstevel  * These are PSU flag bits that map to voltage-indicators:
47*3db86aabSstevel  * DP_PSU_OUTPUT_STATUS
48*3db86aabSstevel  * DP_PSU_INPUT_STATUS
49*3db86aabSstevel  * DP_PSU_SEC_INPUT_STATUS
50*3db86aabSstevel  * DP_PSU_OUTPUT_VLO_STATUS
51*3db86aabSstevel  * DP_PSU_OUTPUT_VHI_STATUS
52*3db86aabSstevel  */
53*3db86aabSstevel #define	RMCLOMV_MAX_VI_PER_PSU			5
54*3db86aabSstevel 
55*3db86aabSstevel /*
56*3db86aabSstevel  * Current indicators:
57*3db86aabSstevel  * DP_PSU_OUTPUT_AHI_STATUS
58*3db86aabSstevel  * DP_PSU_NR_WARNING
59*3db86aabSstevel  */
60*3db86aabSstevel #define	RMCLOMV_MAX_CI_PER_PSU			2
61*3db86aabSstevel 
62*3db86aabSstevel /*
63*3db86aabSstevel  * Fan indicators:
64*3db86aabSstevel  * DP_PSU_FAN_FAULT
65*3db86aabSstevel  * DP_PSU_PDCT_FAN
66*3db86aabSstevel  */
67*3db86aabSstevel #define	RMCLOMV_MAX_FI_PER_PSU			2
68*3db86aabSstevel 
69*3db86aabSstevel /*
70*3db86aabSstevel  * Temperature indicators:
71*3db86aabSstevel  * DP_PSU_OVERTEMP_FAULT
72*3db86aabSstevel  */
73*3db86aabSstevel #define	RMCLOMV_MAX_TI_PER_PSU			1
74*3db86aabSstevel 
75*3db86aabSstevel #define	RMCLOMV_NUM_SPECIAL_FRUS		1
76*3db86aabSstevel #define	RMCLOMV_MIN_ALARM_STATE			0
77*3db86aabSstevel #define	RMCLOMV_MAX_ALARM_STATE			1
78*3db86aabSstevel 
79*3db86aabSstevel /*
80*3db86aabSstevel  * defines for various environmental detectors
81*3db86aabSstevel  */
82*3db86aabSstevel #define	RMCLOMV_ANY_ENV		0
83*3db86aabSstevel #define	RMCLOMV_TEMP_SENS	1
84*3db86aabSstevel #define	RMCLOMV_FAN_SENS	2
85*3db86aabSstevel #define	RMCLOMV_PSU_IND		3
86*3db86aabSstevel #define	RMCLOMV_LED_IND		4
87*3db86aabSstevel #define	RMCLOMV_VOLT_SENS	5
88*3db86aabSstevel #define	RMCLOMV_HPU_IND		6
89*3db86aabSstevel #define	RMCLOMV_AMP_IND		7
90*3db86aabSstevel #define	RMCLOMV_VOLT_IND	8
91*3db86aabSstevel #define	RMCLOMV_TEMP_IND	9
92*3db86aabSstevel #define	RMCLOMV_FAN_IND		10
93*3db86aabSstevel #define	RMCLOMV_ALARM_IND	11
94*3db86aabSstevel 
95*3db86aabSstevel typedef struct {
96*3db86aabSstevel 	dp_handle_t	handle;
97*3db86aabSstevel 	uint16_t	ind_mask;
98*3db86aabSstevel 	envmon_handle_t	handle_name;
99*3db86aabSstevel } rmclomv_cache_entry_t;
100*3db86aabSstevel 
101*3db86aabSstevel /*
102*3db86aabSstevel  * section_len is used when freeing the structure.
103*3db86aabSstevel  * It includes unused entries whereas num_entries does not.
104*3db86aabSstevel  */
105*3db86aabSstevel typedef struct rmclomv_cache_section {
106*3db86aabSstevel 	struct rmclomv_cache_section	*next_section;
107*3db86aabSstevel 	size_t				section_len;
108*3db86aabSstevel 	uint16_t			sensor_type;
109*3db86aabSstevel 	uint16_t			num_entries;
110*3db86aabSstevel 	rmclomv_cache_entry_t		entry[1];
111*3db86aabSstevel } rmclomv_cache_section_t;
112*3db86aabSstevel 
113*3db86aabSstevel #ifdef	__cplusplus
114*3db86aabSstevel }
115*3db86aabSstevel #endif
116*3db86aabSstevel 
117*3db86aabSstevel #endif	/* _SYS_RMCLOMV_IMPL_H */
118