8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / picl / plugins / sun4u / envmon / piclenvmon.h
blob86c07f486e6a03bd74077d9de315e88fcb6e32cd
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _PICLENVMON_H
28 #define _PICLENVMON_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
37 * Log message texts
39 #define EM_INIT_FAILED gettext("SUNW_piclenvmon: init failed!")
40 #define EM_MISSING_NODE gettext("SUNW_piclenvmon: no %s node!")
41 #define EM_SC_NODE_INCOMPLETE \
42 gettext("SUNW_piclenvmon: SC node devfs-path property missing")
43 #define EM_SC_NODE_MISSING \
44 gettext("SUNW_piclenvmon: failed to locate SC device node")
45 #define EM_EVREG_FAILED \
46 gettext("SUNW_piclenvmon: failed to register for events %x")
47 #define EM_NODE_ACCESS \
48 gettext("SUNW_piclenvmon: couldn't access \"%s\", " \
49 "type %d, PICL err %d")
50 #define EM_SYS_ERR gettext("SUNW_piclenvmon: %s: %s")
51 #define EM_EV_MISSING_ARG \
52 gettext("SUNW_piclenvmon: missing %s in ADD_FRU/REMOVE_FRU event")
53 #define EM_INVALID_COLOR \
54 gettext("SUNW_piclenvmon: invalid LED color 0x%x returned for %s")
57 * define for super-user uid - used in credential checking
59 #define SUPER_USER ((uid_t)0)
62 * Constants for distinquishing environmental monitor types
64 #define ENVMON_VOLT_SENS 0
65 #define ENVMON_VOLT_IND 1
66 #define ENVMON_AMP_SENS 2
67 #define ENVMON_AMP_IND 3
68 #define ENVMON_TEMP_SENS 4
69 #define ENVMON_TEMP_IND 5
70 #define ENVMON_FAN_SENS 6
71 #define ENVMON_FAN_IND 7
72 #define ENVMON_LED_IND 8
73 #define ENVMON_KEY_SWITCH 9
74 #define ENVMON_CHASSIS 10
77 * ENVMONTYPES is the total of all the environmental monitor types. Needs
78 * to be incrementee everytime a new type is added.
80 #define ENVMONTYPES 11
83 * number of key-switches supported
85 #define N_KEY_SWITCHES 1
88 * nomenclature names used to identify LED significance
90 #define LED_ACT "ACT"
91 #define LED_SERVICE "SERVICE"
92 #define LED_OK2RM "OK2RM"
93 #define LED_LOCATE "LOCATE"
95 #define KEYSWITCH_NAME "keyswitch"
96 #define CHASSIS_SERIAL_NUMBER "chassis_serial_number"
99 * Config file name
101 #define ENVMON_CONFFILE_NAME "piclenvmon.conf"
103 typedef int (*ptree_vol_rdfunc_t)(ptree_rarg_t *arg, void *buf);
104 typedef int (*ptree_vol_wrfunc_t)(ptree_warg_t *arg, const void *buf);
106 typedef struct node_el {
107 picl_nodehdl_t nodeh;
108 struct node_el *next;
109 } node_el_t;
111 typedef struct node_list {
112 node_el_t *head;
113 node_el_t *tail;
114 } node_list_t;
117 * index entry for looking up sensor handle
119 typedef struct {
120 int maxnum; /* number of entries in handles array */
121 int num; /* number of entries in being used */
122 uchar_t *fru_types;
123 envmon_handle_t *envhandles;
124 picl_prophdl_t *piclprhdls;
125 } handle_array_t;
127 #ifdef __cplusplus
129 #endif
131 #endif /* _PICLENVMON_H */