summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4u/sys/rmclomv_impl.h
blob: 1cdac5a2ab520c5536770994dcddfc4aec7d0d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */

/*
 * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_RMCLOMV_IMPL_H
#define	_SYS_RMCLOMV_IMPL_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

#include <sys/envmon.h>

/*
 * local driver defines and structures
 */

#define	RMCLOMV_DEFAULT_MAX_MBOX_WAIT_TIME	10000
#define	RMCLOMV_MIN_LED_STATE			0
#define	RMCLOMV_MAX_LED_STATE			2
/*
 * These are PSU flag bits that map to voltage-indicators:
 * DP_PSU_OUTPUT_STATUS
 * DP_PSU_INPUT_STATUS
 * DP_PSU_SEC_INPUT_STATUS
 * DP_PSU_OUTPUT_VLO_STATUS
 * DP_PSU_OUTPUT_VHI_STATUS
 */
#define	RMCLOMV_MAX_VI_PER_PSU			5

/*
 * Current indicators:
 * DP_PSU_OUTPUT_AHI_STATUS
 * DP_PSU_NR_WARNING
 */
#define	RMCLOMV_MAX_CI_PER_PSU			2

/*
 * Fan indicators:
 * DP_PSU_FAN_FAULT
 * DP_PSU_PDCT_FAN
 */
#define	RMCLOMV_MAX_FI_PER_PSU			2

/*
 * Temperature indicators:
 * DP_PSU_OVERTEMP_FAULT
 */
#define	RMCLOMV_MAX_TI_PER_PSU			1

#define	RMCLOMV_NUM_SPECIAL_FRUS		1
#define	RMCLOMV_MIN_ALARM_STATE			0
#define	RMCLOMV_MAX_ALARM_STATE			1

/*
 * defines for various environmental detectors
 */
#define	RMCLOMV_ANY_ENV		0
#define	RMCLOMV_TEMP_SENS	1
#define	RMCLOMV_FAN_SENS	2
#define	RMCLOMV_PSU_IND		3
#define	RMCLOMV_LED_IND		4
#define	RMCLOMV_VOLT_SENS	5
#define	RMCLOMV_HPU_IND		6
#define	RMCLOMV_AMP_IND		7
#define	RMCLOMV_VOLT_IND	8
#define	RMCLOMV_TEMP_IND	9
#define	RMCLOMV_FAN_IND		10
#define	RMCLOMV_ALARM_IND	11

typedef struct {
	dp_handle_t	handle;
	uint16_t	ind_mask;
	envmon_handle_t	handle_name;
} rmclomv_cache_entry_t;

/*
 * section_len is used when freeing the structure.
 * It includes unused entries whereas num_entries does not.
 */
typedef struct rmclomv_cache_section {
	struct rmclomv_cache_section	*next_section;
	size_t				section_len;
	uint16_t			sensor_type;
	uint16_t			num_entries;
	rmclomv_cache_entry_t		entry[1];
} rmclomv_cache_section_t;

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_RMCLOMV_IMPL_H */