Print this page
LOCAL: disk-lights work 2
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/fm/topo/libtopo/common/libtopo.h
+++ new/usr/src/lib/fm/topo/libtopo/common/libtopo.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 #ifndef _LIBTOPO_H
27 27 #define _LIBTOPO_H
28 28
29 29 #include <sys/nvpair.h>
30 30 #include <stdio.h>
31 31 #include <libdevinfo.h>
32 32
33 33 #ifdef __cplusplus
34 34 extern "C" {
35 35 #endif
36 36
37 37 #define TOPO_VERSION 1 /* Library ABI Interface Version */
38 38
39 39 typedef struct topo_hdl topo_hdl_t;
40 40 typedef struct topo_node tnode_t;
41 41 typedef struct topo_walk topo_walk_t;
42 42 typedef int32_t topo_instance_t;
43 43 typedef uint32_t topo_version_t;
44 44
45 45 typedef struct topo_list {
46 46 struct topo_list *l_prev;
47 47 struct topo_list *l_next;
48 48 } topo_list_t;
49 49
50 50 typedef struct topo_faclist {
51 51 topo_list_t tf_list;
52 52 tnode_t *tf_node;
53 53 } topo_faclist_t;
54 54
55 55 /*
56 56 * The following functions, error codes and data structures are private
57 57 * to libtopo snapshot consumers and enumerator modules.
58 58 */
59 59 extern topo_hdl_t *topo_open(int, const char *, int *);
60 60 extern void topo_close(topo_hdl_t *);
61 61 extern char *topo_snap_hold(topo_hdl_t *, const char *, int *);
62 62 extern void topo_snap_release(topo_hdl_t *);
63 63
64 64 /*
65 65 * Snapshot walker support
66 66 */
67 67 typedef int (*topo_walk_cb_t)(topo_hdl_t *, tnode_t *, void *);
68 68
69 69 extern topo_walk_t *topo_walk_init(topo_hdl_t *, const char *, topo_walk_cb_t,
70 70 void *, int *);
71 71 extern int topo_walk_step(topo_walk_t *, int);
72 72 extern void topo_walk_fini(topo_walk_t *);
73 73 extern di_node_t topo_hdl_devinfo(topo_hdl_t *);
74 74 extern di_prom_handle_t topo_hdl_prominfo(topo_hdl_t *);
75 75
76 76 /*
77 77 * Walk status returned from walker
78 78 */
79 79 #define TOPO_WALK_ERR -1
80 80 #define TOPO_WALK_NEXT 0
81 81 #define TOPO_WALK_TERMINATE 1
82 82
83 83 /*
84 84 * Types of walks: depth-first (child) or breadth-first (sibling)
85 85 */
86 86 #define TOPO_WALK_CHILD 0x0001
87 87 #define TOPO_WALK_SIBLING 0x0002
88 88
89 89 /*
90 90 * FMRI helper routines
91 91 */
92 92 extern int topo_fmri_present(topo_hdl_t *, nvlist_t *, int *);
93 93 extern int topo_fmri_replaced(topo_hdl_t *, nvlist_t *, int *);
94 94 extern int topo_fmri_contains(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
95 95 extern int topo_fmri_expand(topo_hdl_t *, nvlist_t *, int *);
96 96 extern int topo_fmri_unusable(topo_hdl_t *, nvlist_t *, int *);
97 97 extern int topo_fmri_service_state(topo_hdl_t *, nvlist_t *, int *);
98 98 extern int topo_fmri_retire(topo_hdl_t *, nvlist_t *, int *);
99 99 extern int topo_fmri_unretire(topo_hdl_t *, nvlist_t *, int *);
100 100 extern int topo_fmri_nvl2str(topo_hdl_t *, nvlist_t *, char **, int *);
101 101 extern int topo_fmri_str2nvl(topo_hdl_t *, const char *, nvlist_t **, int *);
102 102 extern int topo_fmri_asru(topo_hdl_t *, nvlist_t *, nvlist_t **, int *);
103 103 extern int topo_fmri_fru(topo_hdl_t *, nvlist_t *, nvlist_t **,
104 104 int *);
105 105 extern int topo_fmri_label(topo_hdl_t *, nvlist_t *, char **, int *);
106 106 extern int topo_fmri_serial(topo_hdl_t *, nvlist_t *, char **, int *);
107 107 extern int topo_fmri_compare(topo_hdl_t *, nvlist_t *, nvlist_t *, int *);
108 108 extern int topo_fmri_facility(topo_hdl_t *, nvlist_t *, const char *,
109 109 uint32_t, topo_walk_cb_t, void *, int *);
110 110
111 111 /*
112 112 * Consolidation private utility functions
113 113 */
114 114 extern ulong_t topo_fmri_strhash(topo_hdl_t *, const char *);
115 115 extern ulong_t topo_fmri_strhash_noauth(topo_hdl_t *, const char *);
116 116 extern boolean_t topo_fmri_strcmp(topo_hdl_t *, const char *, const char *);
117 117 extern boolean_t topo_fmri_strcmp_noauth(topo_hdl_t *, const char *,
118 118 const char *);
119 119
120 120 /*
121 121 * Topo node utilities: callable from topo_walk_step() callback or module
122 122 * enumeration, topo_mod_enumerate()
123 123 */
124 124 extern char *topo_node_name(tnode_t *);
125 125 extern topo_instance_t topo_node_instance(tnode_t *);
126 126 extern tnode_t *topo_node_parent(tnode_t *);
127 127 extern void *topo_node_private(tnode_t *);
128 128 extern int topo_node_flags(tnode_t *);
129 129 extern int topo_node_asru(tnode_t *, nvlist_t **, nvlist_t *, int *);
↓ open down ↓ |
129 lines elided |
↑ open up ↑ |
130 130 extern int topo_node_fru(tnode_t *, nvlist_t **, nvlist_t *, int *);
131 131 extern int topo_node_resource(tnode_t *, nvlist_t **, int *);
132 132 extern int topo_node_label(tnode_t *, char **, int *);
133 133 extern tnode_t *topo_node_lookup(tnode_t *, const char *, topo_instance_t);
134 134 extern int topo_method_invoke(tnode_t *node, const char *, topo_version_t,
135 135 nvlist_t *, nvlist_t **, int *);
136 136 extern boolean_t topo_method_supported(tnode_t *, const char *,
137 137 topo_version_t);
138 138 extern int topo_node_facility(topo_hdl_t *, tnode_t *, const char *,
139 139 uint32_t, topo_faclist_t *, int *);
140 +extern int topo_node_child_walk(topo_hdl_t *, tnode_t *, topo_walk_cb_t,
141 + void *, int *);
140 142
141 143 /*
142 144 * Node flags: denotes type of node
143 145 */
144 146 #define TOPO_NODE_DEFAULT 0
145 147 #define TOPO_NODE_FACILITY 1
146 148
147 149 #define TOPO_FAC_TYPE_SENSOR "sensor"
148 150 #define TOPO_FAC_TYPE_INDICATOR "indicator"
149 151
150 152 /*
151 153 * Topo property get functions
152 154 */
153 155 extern int topo_prop_get_int32(tnode_t *, const char *, const char *,
154 156 int32_t *, int *);
155 157 extern int topo_prop_get_uint32(tnode_t *, const char *, const char *,
156 158 uint32_t *, int *);
157 159 extern int topo_prop_get_int64(tnode_t *, const char *, const char *,
158 160 int64_t *, int *);
159 161 extern int topo_prop_get_uint64(tnode_t *, const char *, const char *,
160 162 uint64_t *, int *);
161 163 extern int topo_prop_get_double(tnode_t *, const char *, const char *,
162 164 double *, int *);
163 165 extern int topo_prop_get_string(tnode_t *, const char *, const char *,
164 166 char **, int *);
165 167 extern int topo_prop_get_fmri(tnode_t *, const char *, const char *,
166 168 nvlist_t **, int *);
167 169 extern int topo_prop_get_int32_array(tnode_t *, const char *, const char *,
168 170 int32_t **, uint_t *, int *);
169 171 extern int topo_prop_get_uint32_array(tnode_t *, const char *, const char *,
170 172 uint32_t **, uint_t *, int *);
171 173 extern int topo_prop_get_int64_array(tnode_t *, const char *, const char *,
172 174 int64_t **, uint_t *, int *);
173 175 extern int topo_prop_get_uint64_array(tnode_t *, const char *, const char *,
174 176 uint64_t **, uint_t *, int *);
175 177 extern int topo_prop_get_string_array(tnode_t *, const char *, const char *,
176 178 char ***, uint_t *, int *);
177 179 extern int topo_prop_get_fmri_array(tnode_t *, const char *, const char *,
178 180 nvlist_t ***, uint_t *, int *);
179 181
180 182 /*
181 183 * Topo property set functions
182 184 */
183 185 extern int topo_prop_set_int32(tnode_t *, const char *, const char *, int,
184 186 int32_t, int *);
185 187 extern int topo_prop_set_uint32(tnode_t *, const char *, const char *, int,
186 188 uint32_t, int *);
187 189 extern int topo_prop_set_int64(tnode_t *, const char *, const char *,
188 190 int, int64_t, int *);
189 191 extern int topo_prop_set_uint64(tnode_t *, const char *, const char *,
190 192 int, uint64_t, int *);
191 193 extern int topo_prop_set_double(tnode_t *, const char *, const char *,
192 194 int, double, int *);
193 195 extern int topo_prop_set_string(tnode_t *, const char *, const char *,
194 196 int, const char *, int *);
195 197 extern int topo_prop_set_fmri(tnode_t *, const char *, const char *,
196 198 int, const nvlist_t *, int *);
197 199 extern int topo_prop_set_int32_array(tnode_t *, const char *, const char *, int,
198 200 int32_t *, uint_t, int *);
199 201 extern int topo_prop_set_uint32_array(tnode_t *, const char *, const char *,
200 202 int, uint32_t *, uint_t, int *);
201 203 extern int topo_prop_set_int64_array(tnode_t *, const char *, const char *,
202 204 int, int64_t *, uint_t, int *);
203 205 extern int topo_prop_set_uint64_array(tnode_t *, const char *, const char *,
204 206 int, uint64_t *, uint_t, int *);
205 207 extern int topo_prop_set_string_array(tnode_t *, const char *, const char *,
206 208 int, const char **, uint_t, int *);
207 209 extern int topo_prop_set_fmri_array(tnode_t *, const char *, const char *,
208 210 int, const nvlist_t **, uint_t, int *);
209 211
210 212 #define TOPO_PROP_IMMUTABLE 0
211 213 #define TOPO_PROP_MUTABLE 0x01
212 214 #define TOPO_PROP_NONVOLATILE 0x02
213 215
214 216 /* Protocol property group and property names */
215 217 #define TOPO_PGROUP_PROTOCOL "protocol" /* Required property group */
216 218 #define TOPO_PROP_RESOURCE "resource" /* resource FMRI */
217 219 #define TOPO_PROP_ASRU "ASRU" /* ASRU FMRI */
218 220 #define TOPO_PROP_FRU "FRU" /* FRU FMRI */
219 221 #define TOPO_PROP_MOD "module" /* software module FMRI */
220 222 #define TOPO_PROP_PKG "package" /* software package FMRI */
221 223 #define TOPO_PROP_LABEL "label" /* property LABEL */
222 224
223 225 #define TOPO_METH_FAC_ENUM "fac_enum"
224 226
225 227 /*
226 228 * System property group
227 229 */
228 230 #define TOPO_PGROUP_SYSTEM "system"
229 231 #define TOPO_PROP_ISA "isa"
230 232 #define TOPO_PROP_MACHINE "machine"
231 233
232 234 #define TOPO_PGROUP_IPMI "ipmi"
233 235
234 236 /*
235 237 * These enum definitions are used to define a set of error tags associated with
236 238 * libtopo error conditions occuring during the adminstration of
237 239 * properties, invocation of methods and fmri-based queries. The shell script
238 240 * mkerror.sh is used to parse this file and create a corresponding topo_error.c
239 241 * source file.
240 242 *
241 243 * If you do something other than add a new error tag here, you may need to
242 244 * update the mkerror shell script as it is based upon simple regexps.
243 245 */
244 246 typedef enum topo_prop_errno {
245 247 ETOPO_PROP_UNKNOWN = 3000, /* unknown topo prop error */
246 248 ETOPO_PROP_NOENT, /* undefined property or property group */
247 249 ETOPO_PROP_DEFD, /* static property already defined */
248 250 ETOPO_PROP_NOMEM, /* memory limit exceeded during property allocation */
249 251 ETOPO_PROP_TYPE, /* invalid property type */
250 252 ETOPO_PROP_NAME, /* invalid property name */
251 253 ETOPO_PROP_NOINHERIT, /* can not inherit property */
252 254 ETOPO_PROP_NVL, /* malformed property nvlist */
253 255 ETOPO_PROP_METHOD, /* get property method failed */
254 256 ETOPO_PROP_END /* end of prop errno list (to ease auto-merge) */
255 257 } topo_prop_errno_t;
256 258
257 259 typedef enum topo_method_errno {
258 260 ETOPO_METHOD_UNKNOWN = 3100, /* unknown topo method error */
259 261 ETOPO_METHOD_INVAL, /* invalid method registration */
260 262 ETOPO_METHOD_NOTSUP, /* method not supported */
261 263 ETOPO_METHOD_FAIL, /* method failed */
262 264 ETOPO_METHOD_VEROLD, /* app is compiled to use obsolete method */
263 265 ETOPO_METHOD_VERNEW, /* app is compiled to use obsolete method */
264 266 ETOPO_METHOD_NOMEM, /* memory limit exceeded during method op */
265 267 ETOPO_METHOD_DEFD, /* method op already defined */
266 268 ETOPO_METHOD_END /* end of method errno list */
267 269 } topo_method_errno_t;
268 270
269 271 typedef enum topo_fmri_errno {
270 272 ETOPO_FMRI_UNKNOWN = 3200, /* unknown topo fmri error */
271 273 ETOPO_FMRI_NVL, /* nvlist allocation failure for FMRI */
272 274 ETOPO_FMRI_VERSION, /* invalid FMRI scheme version */
273 275 ETOPO_FMRI_MALFORM, /* malformed FMRI */
274 276 ETOPO_FMRI_NOMEM, /* memory limit exceeded */
275 277 ETOPO_FMRI_END /* end of fmri errno list */
276 278 } topo_fmri_errno_t;
277 279
278 280 typedef enum topo_hdl_errno {
279 281 ETOPO_HDL_UNKNOWN = 3300, /* unknown topo handle error */
280 282 ETOPO_HDL_ABIVER, /* handle opened with invalid ABI version */
281 283 ETOPO_HDL_SNAP, /* snapshot already taken */
282 284 ETOPO_HDL_INVAL, /* invalid argument specified */
283 285 ETOPO_HDL_UUID, /* uuid already set */
284 286 ETOPO_HDL_NOMEM, /* memory limit exceeded */
285 287 ETOPO_HDL_END /* end of handle errno list */
286 288 } topo_hdl_errno_t;
287 289
288 290 extern const char *topo_strerror(int);
289 291 extern void topo_hdl_strfree(topo_hdl_t *, char *);
290 292 extern void topo_debug_set(topo_hdl_t *, const char *, const char *);
291 293
292 294 /*
293 295 * The following functions and data structures to support property
294 296 * observability are private to the fmtopo command.
295 297 */
296 298
297 299 /*
298 300 * Each topology node advertises the name and data stability of each of its
299 301 * modules and properties. (see attributes(5)).
300 302 */
301 303
302 304 /*
303 305 * Topo stability attributes
304 306 */
305 307 typedef enum topo_stability {
306 308 TOPO_STABILITY_UNKNOWN = 0, /* private to libtopo */
307 309 TOPO_STABILITY_INTERNAL, /* private to libtopo */
308 310 TOPO_STABILITY_PRIVATE, /* private to Sun */
309 311 TOPO_STABILITY_OBSOLETE, /* scheduled for removal */
310 312 TOPO_STABILITY_EXTERNAL, /* not controlled by Sun */
311 313 TOPO_STABILITY_UNSTABLE, /* new or rapidly changing */
312 314 TOPO_STABILITY_EVOLVING, /* less rapidly changing */
313 315 TOPO_STABILITY_STABLE, /* mature interface from Sun */
314 316 TOPO_STABILITY_STANDARD /* industry standard */
315 317 } topo_stability_t;
316 318
317 319 #define TOPO_STABILITY_MAX TOPO_STABILITY_STANDARD /* max valid stab */
318 320
319 321 typedef struct topo_pgroup_info {
320 322 const char *tpi_name; /* property group name */
321 323 topo_stability_t tpi_namestab; /* stability of group name */
322 324 topo_stability_t tpi_datastab; /* stability of all property values */
323 325 topo_version_t tpi_version; /* version of pgroup definition */
324 326 } topo_pgroup_info_t;
325 327
326 328 extern topo_stability_t topo_name2stability(const char *);
327 329 extern const char *topo_stability2name(topo_stability_t);
328 330 extern void topo_pgroup_destroy(tnode_t *, const char *);
329 331 extern topo_pgroup_info_t *topo_pgroup_info(tnode_t *, const char *, int *);
330 332
331 333 typedef enum {
332 334 TOPO_TYPE_INVALID = 0,
333 335 TOPO_TYPE_BOOLEAN, /* boolean */
334 336 TOPO_TYPE_INT32, /* int32_t */
335 337 TOPO_TYPE_UINT32, /* uint32_t */
336 338 TOPO_TYPE_INT64, /* int64_t */
337 339 TOPO_TYPE_UINT64, /* uint64_t */
338 340 TOPO_TYPE_STRING, /* const char* */
339 341 TOPO_TYPE_TIME, /* uint64_t */
340 342 TOPO_TYPE_SIZE, /* uint64_t */
341 343 TOPO_TYPE_FMRI, /* nvlist_t */
342 344 TOPO_TYPE_INT32_ARRAY, /* array of int32_t */
343 345 TOPO_TYPE_UINT32_ARRAY, /* array of uint32_t */
344 346 TOPO_TYPE_INT64_ARRAY, /* array of int64_t */
345 347 TOPO_TYPE_UINT64_ARRAY, /* array of uint64_t */
346 348 TOPO_TYPE_STRING_ARRAY, /* array of const char* */
347 349 TOPO_TYPE_FMRI_ARRAY, /* array of nvlist_t */
348 350 TOPO_TYPE_DOUBLE /* double */
349 351 } topo_type_t;
350 352
351 353 extern nvlist_t *topo_prop_getprops(tnode_t *, int *err);
352 354 extern int topo_prop_getprop(tnode_t *, const char *, const char *,
353 355 nvlist_t *, nvlist_t **, int *);
354 356 extern int topo_prop_getpgrp(tnode_t *, const char *, nvlist_t **, int *);
355 357 extern int topo_prop_setprop(tnode_t *, const char *, nvlist_t *,
356 358 int, nvlist_t *, int *);
357 359 extern int topo_fmri_getprop(topo_hdl_t *, nvlist_t *, const char *,
358 360 const char *, nvlist_t *, nvlist_t **, int *);
359 361 extern int topo_fmri_getpgrp(topo_hdl_t *, nvlist_t *, const char *,
360 362 nvlist_t **, int *);
361 363 extern int topo_fmri_setprop(topo_hdl_t *, nvlist_t *, const char *,
362 364 nvlist_t *, int, nvlist_t *, int *);
363 365
364 366 /* Property node NVL names used in topo_prop_getprops */
365 367 #define TOPO_PROP_GROUP "property-group"
366 368 #define TOPO_PROP_GROUP_NAME "property-group-name"
367 369 #define TOPO_PROP_GROUP_DSTAB "property-group-data-stability"
368 370 #define TOPO_PROP_GROUP_NSTAB "property-group-name-stability"
369 371 #define TOPO_PROP_GROUP_VERSION "property-group-version"
370 372 #define TOPO_PROP_VAL "property"
371 373 #define TOPO_PROP_VAL_NAME "property-name"
372 374 #define TOPO_PROP_VAL_VAL "property-value"
373 375 #define TOPO_PROP_VAL_TYPE "property-type"
374 376 #define TOPO_PROP_FLAG "property-flag"
375 377
376 378 /*
377 379 * ARGS list used in topo property methods
378 380 */
379 381 #define TOPO_PROP_ARGS "args"
380 382 #define TOPO_PROP_PARGS "private-args"
381 383
382 384 extern int topo_xml_print(topo_hdl_t *, FILE *, const char *scheme, int *);
383 385
384 386 extern void *topo_hdl_alloc(topo_hdl_t *, size_t);
385 387 extern void *topo_hdl_zalloc(topo_hdl_t *, size_t);
386 388 extern void topo_hdl_free(topo_hdl_t *, void *, size_t);
387 389 extern int topo_hdl_nvalloc(topo_hdl_t *, nvlist_t **, uint_t);
388 390 extern int topo_hdl_nvdup(topo_hdl_t *, nvlist_t *, nvlist_t **);
389 391 extern char *topo_hdl_strdup(topo_hdl_t *, const char *);
390 392
391 393 /*
392 394 * Interfaces for converting sensor/indicator types, units, states, etc to
393 395 * a string
394 396 */
395 397 void topo_sensor_type_name(uint32_t type, char *buf, size_t len);
396 398 void topo_sensor_units_name(uint8_t type, char *buf, size_t len);
397 399 void topo_led_type_name(uint8_t type, char *buf, size_t len);
398 400 void topo_led_state_name(uint8_t type, char *buf, size_t len);
399 401 void topo_sensor_state_name(uint32_t sensor_type, uint8_t state, char *buf,
400 402 size_t len);
401 403
402 404 /*
403 405 * Defines for standard properties for sensors and indicators
404 406 */
405 407 #define TOPO_PGROUP_FACILITY "facility"
406 408
407 409 #define TOPO_SENSOR_READING "reading"
408 410 #define TOPO_SENSOR_STATE "state"
409 411 #define TOPO_SENSOR_CLASS "sensor-class"
410 412 #define TOPO_FACILITY_TYPE "type"
411 413 #define TOPO_SENSOR_UNITS "units"
412 414 #define TOPO_LED_MODE "mode"
413 415
414 416 /*
415 417 * Sensor Classes
416 418 *
417 419 * The "sensor-class" property in the "facility" propgroup on
418 420 * facility nodes of type "sensor" should be set to one of these
419 421 * two values.
420 422 *
421 423 * Threshold sensors provide an analog sensor reading via the
422 424 * "reading" property in the facility propgroup. They will also
423 425 * provide one or more discrete states via the "state" property
424 426 * in the facility propgroup.
425 427 *
426 428 * Discrete sensors will not provide an analog reading by will
427 429 * provide one or more discrete states via the "state" property
428 430 * in the facility propgroup.
429 431 */
430 432 #define TOPO_SENSOR_CLASS_THRESHOLD "threshold"
431 433 #define TOPO_SENSOR_CLASS_DISCRETE "discrete"
432 434
433 435 /*
434 436 * Sensor unit types. We're using the unit types and corresponding
435 437 * codes described in the IPMI 2.0 spec as a reference as it seems to be a
436 438 * reasonably comprehensive list. This also simplifies the IPMI provider code
437 439 * since the unit type codes will map exactly to what libtopo uses (so no
438 440 * conversion necessary).
439 441 */
440 442 typedef enum topo_sensor_unit {
441 443 TOPO_SENSOR_UNITS_UNSPECIFIED = 0,
442 444 TOPO_SENSOR_UNITS_DEGREES_C,
443 445 TOPO_SENSOR_UNITS_DEGREES_F,
444 446 TOPO_SENSOR_UNITS_DEGREES_K,
445 447 TOPO_SENSOR_UNITS_VOLTS,
446 448 TOPO_SENSOR_UNITS_AMPS,
447 449 TOPO_SENSOR_UNITS_WATTS,
448 450 TOPO_SENSOR_UNITS_JOULES,
449 451 TOPO_SENSOR_UNITS_COULOMBS,
450 452 TOPO_SENSOR_UNITS_VA,
451 453 TOPO_SENSOR_UNITS_NITS,
452 454 TOPO_SENSOR_UNITS_LUMEN,
453 455 TOPO_SENSOR_UNITS_LUX,
454 456 TOPO_SENSOR_UNITS_CANDELA,
455 457 TOPO_SENSOR_UNITS_KPA,
456 458 TOPO_SENSOR_UNITS_PSI,
457 459
458 460 TOPO_SENSOR_UNITS_NEWTON,
459 461 TOPO_SENSOR_UNITS_CFM,
460 462 TOPO_SENSOR_UNITS_RPM,
461 463 TOPO_SENSOR_UNITS_HZ,
462 464 TOPO_SENSOR_UNITS_MICROSEC,
463 465 TOPO_SENSOR_UNITS_MILLISEC,
464 466 TOPO_SENSOR_UNITS_SECS,
465 467 TOPO_SENSOR_UNITS_MIN,
466 468 TOPO_SENSOR_UNITS_HOUR,
467 469 TOPO_SENSOR_UNITS_DAY,
468 470 TOPO_SENSOR_UNITS_WEEK,
469 471 TOPO_SENSOR_UNITS_MIL,
470 472 TOPO_SENSOR_UNITS_INCHES,
471 473 TOPO_SENSOR_UNITS_FEET,
472 474 TOPO_SENSOR_UNITS_CUB_INCH,
473 475 TOPO_SENSOR_UNITS_CUB_FEET,
474 476
475 477 TOPO_SENSOR_UNITS_MM,
476 478 TOPO_SENSOR_UNITS_CM,
477 479 TOPO_SENSOR_UNITS_METERS,
478 480 TOPO_SENSOR_UNITS_CUB_CM,
479 481 TOPO_SENSOR_UNITS_CUB_METER,
480 482 TOPO_SENSOR_UNITS_LITERS,
481 483 TOPO_SENSOR_UNITS_FLUID_OUNCE,
482 484 TOPO_SENSOR_UNITS_RADIANS,
483 485 TOPO_SENSOR_UNITS_STERADIANS,
484 486 TOPO_SENSOR_UNITS_REVOLUTIONS,
485 487 TOPO_SENSOR_UNITS_CYCLES,
486 488 TOPO_SENSOR_UNITS_GRAVITIES,
487 489 TOPO_SENSOR_UNITS_OUNCE,
488 490 TOPO_SENSOR_UNITS_POUND,
489 491 TOPO_SENSOR_UNITS_FOOT_POUND,
490 492 TOPO_SENSOR_UNITS_OZ_INCH,
491 493
492 494 TOPO_SENSOR_UNITS_GAUSS,
493 495 TOPO_SENSOR_UNITS_GILBERTS,
494 496 TOPO_SENSOR_UNITS_HENRY,
495 497 TOPO_SENSOR_UNITS_MILHENRY,
496 498 TOPO_SENSOR_UNITS_FARAD,
497 499 TOPO_SENSOR_UNITS_MICROFARAD,
498 500 TOPO_SENSOR_UNITS_OHMS,
499 501 TOPO_SENSOR_UNITS_SIEMENS,
500 502 TOPO_SENSOR_UNITS_MOLE,
501 503 TOPO_SENSOR_UNITS_BECQUEREL,
502 504 TOPO_SENSOR_UNITS_PPM,
503 505 TOPO_SENSOR_UNITS_RESERVED1,
504 506 TOPO_SENSOR_UNITS_DECIBELS,
505 507 TOPO_SENSOR_UNITS_DBA,
506 508 TOPO_SENSOR_UNITS_DBC,
507 509 TOPO_SENSOR_UNITS_GRAY,
508 510
509 511 TOPO_SENSOR_UNITS_SIEVERT,
510 512 TOPO_SENSOR_UNITS_COLOR_TEMP_K,
511 513 TOPO_SENSOR_UNITS_BIT,
512 514 TOPO_SENSOR_UNITS_KILOBIT,
513 515 TOPO_SENSOR_UNITS_MEGABIT,
514 516 TOPO_SENSOR_UNITS_GIGABIT,
515 517 TOPO_SENSOR_UNITS_BYTE,
516 518 TOPO_SENSOR_UNITS_KILOBYTE,
517 519 TOPO_SENSOR_UNITS_MEGABYTE,
518 520 TOPO_SENSOR_UNITS_GIGABYTE,
519 521 TOPO_SENSOR_UNITS_WORD,
520 522 TOPO_SENSOR_UNITS_DWORD,
521 523 TOPO_SENSOR_UNITS_QWORD,
522 524 TOPO_SENSOR_UNITS_MEMLINE,
523 525 TOPO_SENSOR_UNITS_HIT,
524 526 TOPO_SENSOR_UNITS_MISS,
525 527
526 528 TOPO_SENSOR_UNITS_RETRY,
527 529 TOPO_SENSOR_UNITS_RESET,
528 530 TOPO_SENSOR_UNITS_OVERFLOW,
529 531 TOPO_SENSOR_UNITS_UNDERRUN,
530 532 TOPO_SENSOR_UNITS_COLLISION,
531 533 TOPO_SENSOR_UNITS_PACKETS,
532 534 TOPO_SENSOR_UNITS_MESSAGES,
533 535 TOPO_SENSOR_UNITS_CHARACTERS,
534 536 TOPO_SENSOR_UNITS_ERROR,
535 537 TOPO_SENSOR_UNITS_CE,
536 538 TOPO_SENSOR_UNITS_UE,
537 539 TOPO_SENSOR_UNITS_FATAL_ERROR,
538 540 TOPO_SENSOR_UNITS_GRAMS
539 541 } topo_sensor_unit_t;
540 542
541 543 /*
542 544 * These defines are used by the topo_method_sensor_failure to indicate
543 545 * whether the source of a sensor failure is believed to be the result of an
544 546 * internal failure, external condition or unknown
545 547 */
546 548 #define TOPO_SENSOR_ERRSRC_UNKNOWN 0
547 549 #define TOPO_SENSOR_ERRSRC_INTERNAL 1
548 550 #define TOPO_SENSOR_ERRSRC_EXTERNAL 2
549 551
550 552 /*
551 553 * Sensor Types amd the associated sensor-type-specific states
552 554 *
553 555 * These are used to decode the type and state properties in the facility
554 556 * propgroup on facility nodes of type sensor.
555 557 *
556 558 * Again we're basically using the same defines as for IPMI as it's serves
557 559 * as a good starting point and simplifies the IPMI provider code. Of course
558 560 * other facility providers will need to convert from their native codes
559 561 * to the topo code when they set the type and state properties.
560 562 */
561 563 #define TOPO_SENSOR_TYPE_RESERVED 0x0000
562 564 #define TOPO_SENSOR_TYPE_TEMP 0x0001
563 565 #define TOPO_SENSOR_TYPE_VOLTAGE 0x0002
564 566 #define TOPO_SENSOR_TYPE_CURRENT 0x0003
565 567 #define TOPO_SENSOR_TYPE_FAN 0x0004
566 568 #define TOPO_SENSOR_TYPE_PHYSICAL 0x0005
567 569
568 570 #define TOPO_SENSOR_STATE_PHYSICAL_GENERAL 0x0001
569 571 #define TOPO_SENSOR_STATE_PHYSICAL_BAY 0x0002
570 572 #define TOPO_SENSOR_STATE_PHYSICAL_CARD 0x0004
571 573 #define TOPO_SENSOR_STATE_PHYSICAL_PROCESSOR 0x0008
572 574 #define TOPO_SENSOR_STATE_PHYSICAL_LAN 0x0010
573 575 #define TOPO_SENSOR_STATE_PHYSICAL_DOCK 0x0020
574 576 #define TOPO_SENSOR_STATE_PHYSICAL_FAN 0x0040
575 577
576 578 #define TOPO_SENSOR_TYPE_PLATFORM 0x0006
577 579
578 580 #define TOPO_SENSOR_STATE_PLATFORM_SECURE 0x0001
579 581 #define TOPO_SENSOR_STATE_PLATFORM_USER_PASS 0x0002
580 582 #define TOPO_SENSOR_STATE_PLATFORM_SETUP_PASS 0x0004
581 583 #define TOPO_SENSOR_STATE_PLATFORM_NETWORK_PASS 0x0008
582 584 #define TOPO_SENSOR_STATE_PLATFORM_OTHER_PASS 0x0010
583 585 #define TOPO_SENSOR_STATE_PLATFORM_OUT_OF_BAND 0x0020
584 586
585 587 #define TOPO_SENSOR_TYPE_PROCESSOR 0x0007
586 588
587 589 #define TOPO_SENSOR_STATE_PROCESSOR_IERR 0x0001
588 590 #define TOPO_SENSOR_STATE_PROCESSOR_THERMAL 0x0002
589 591 #define TOPO_SENSOR_STATE_PROCESSOR_FRB1 0x0004
590 592 #define TOPO_SENSOR_STATE_PROCESSOR_FRB2 0x0008
591 593 #define TOPO_SENSOR_STATE_PROCESSOR_FRB3 0x0010
592 594 #define TOPO_SENSOR_STATE_PROCESSOR_CONFIG 0x0020
593 595 #define TOPO_SENSOR_STATE_PROCESSOR_SMBIOS 0x0040
594 596 #define TOPO_SENSOR_STATE_PROCESSOR_PRESENT 0x0080
595 597 #define TOPO_SENSOR_STATE_PROCESSOR_DISABLED 0x0100
596 598 #define TOPO_SENSOR_STATE_PROCESSOR_TERMINATOR 0x0200
597 599 #define TOPO_SENSOR_STATE_PROCESSOR_THROTTLED 0x0400
598 600
599 601 #define TOPO_SENSOR_TYPE_POWER_SUPPLY 0x0008
600 602
601 603 #define TOPO_SENSOR_STATE_POWER_SUPPLY_PRESENT 0x0001
602 604 #define TOPO_SENSOR_STATE_POWER_SUPPLY_FAILURE 0x0002
603 605 #define TOPO_SENSOR_STATE_POWER_SUPPLY_PREDFAIL 0x0004
604 606 #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_LOST 0x0008
605 607 #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_RANGE 0x0010
606 608 #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_RANGE_PRES 0x0020
607 609 #define TOPO_SENSOR_STATE_POWER_SUPPLY_CONFIG_ERR 0x0040
608 610
609 611 #define TOPO_SENSOR_TYPE_POWER_UNIT 0x0009
610 612
611 613 #define TOPO_SENSOR_STATE_POWER_UNIT_OFF 0x0001
612 614 #define TOPO_SENSOR_STATE_POWER_UNIT_CYCLE 0x0002
613 615 #define TOPO_SENSOR_STATE_POWER_UNIT_240_DOWN 0x0004
614 616 #define TOPO_SENSOR_STATE_POWER_UNIT_INTERLOCK_DOWN 0x0008
615 617 #define TOPO_SENSOR_STATE_POWER_UNIT_AC_LOST 0x0010
616 618 #define TOPO_SENSOR_STATE_POWER_UNIT_SOFT_FAILURE 0x0020
617 619 #define TOPO_SENSOR_STATE_POWER_UNIT_FAIL 0x0040
618 620 #define TOPO_SENSOR_STATE_POWER_UNIT_PREDFAIL 0x0080
619 621
620 622 #define TOPO_SENSOR_TYPE_COOLING 0x000A
621 623 #define TOPO_SENSOR_TYPE_OTHER 0x000B
622 624
623 625 #define TOPO_SENSOR_TYPE_MEMORY 0x000C
624 626
625 627 #define TOPO_SENSOR_STATE_MEMORY_CE 0x0001
626 628 #define TOPO_SENSOR_STATE_MEMORY_UE 0x0002
627 629 #define TOPO_SENSOR_STATE_MEMORY_PARITY 0x0004
628 630 #define TOPO_SENSOR_STATE_MEMORY_SCRUB_FAIL 0x0008
629 631 #define TOPO_SENSOR_STATE_MEMORY_DISABLED 0x0010
630 632 #define TOPO_SENSOR_STATE_MEMORY_CE_LOG_LIMIT 0x0020
631 633 #define TOPO_SENSOR_STATE_MEMORY_PRESENT 0x0040
632 634 #define TOPO_SENSOR_STATE_MEMORY_CONFIG_ERR 0x0080
633 635 #define TOPO_SENSOR_STATE_MEMORY_SPARE 0x0100
634 636 #define TOPO_SENSOR_STATE_MEMORY_THROTTLED 0x0200
635 637 #define TOPO_SENSOR_STATE_MEMORY_OVERTEMP 0x0400
636 638
637 639 #define TOPO_SENSOR_TYPE_BAY 0x000D
638 640
639 641 #define TOPO_SENSOR_STATE_BAY_PRESENT 0x0001
640 642 #define TOPO_SENSOR_STATE_BAY_FAULT 0x0002
641 643 #define TOPO_SENSOR_STATE_BAY_PREDFAIL 0x0004
642 644 #define TOPO_SENSOR_STATE_BAY_SPARE 0x0008
643 645 #define TOPO_SENSOR_STATE_BAY_CHECK 0x0010
644 646 #define TOPO_SENSOR_STATE_BAY_CRITICAL 0x0020
645 647 #define TOPO_SENSOR_STATE_BAY_FAILED 0x0040
646 648 #define TOPO_SENSOR_STATE_BAY_REBUILDING 0x0080
647 649 #define TOPO_SENSOR_STATE_BAY_ABORTED 0x0100
648 650
649 651 #define TOPO_SENSOR_TYPE_POST_RESIZE 0x000E
650 652
651 653 #define TOPO_SENSOR_TYPE_FIRMWARE 0x000F
652 654
653 655 #define TOPO_SENSOR_STATE_FIRMWARE_ERROR 0x0001
654 656 #define TOPO_SENSOR_STATE_FIRMWARE_HANG 0x0002
655 657 #define TOPO_SENSOR_STATE_FIRMWARE_PROGRESS 0x0004
656 658
657 659 #define TOPO_SENSOR_TYPE_EVENT_LOG 0x0010
658 660
659 661 #define TOPO_SENSOR_STATE_EVENT_LOG_CE 0x0001
660 662 #define TOPO_SENSOR_STATE_EVENT_LOG_TYPE 0x0002
661 663 #define TOPO_SENSOR_STATE_EVENT_LOG_RESET 0x0004
662 664 #define TOPO_SENSOR_STATE_EVENT_LOG_ALL 0x0008
663 665 #define TOPO_SENSOR_STATE_EVENT_LOG_FULL 0x0010
664 666 #define TOPO_SENSOR_STATE_EVENT_LOG_ALMOST_FULL 0x0020
665 667
666 668 #define TOPO_SENSOR_TYPE_WATCHDOG1 0x0011
667 669
668 670 #define TOPO_SENSOR_STATE_WATCHDOG_BIOS_RESET 0x0001
669 671 #define TOPO_SENSOR_STATE_WATCHDOG_OS_RESET 0x0002
670 672 #define TOPO_SENSOR_STATE_WATCHDOG_OS_SHUTDOWN 0x0004
671 673 #define TOPO_SENSOR_STATE_WATCHDOG_OS_PWR_DOWN 0x0008
672 674 #define TOPO_SENSOR_STATE_WATCHDOG_OS_PWR_CYCLE 0x0010
673 675 #define TOPO_SENSOR_STATE_WATCHDOG_OS_NMI_DIAG 0x0020
674 676 #define TOPO_SENSOR_STATE_WATCHDOG_EXPIRED 0x0040
675 677 #define TOPO_SENSOR_STATE_WATCHDOG_PRE_TIMEOUT_INT 0x0080
676 678
677 679 #define TOPO_SENSOR_TYPE_SYSTEM 0x0012
678 680
679 681 #define TOPO_SENSOR_STATE_SYSTEM_RECONF 0x0001
680 682 #define TOPO_SENSOR_STATE_SYSTEM_BOOT 0x0002
681 683 #define TOPO_SENSOR_STATE_SYSTEM_UNKNOWN_HW_FAILURE 0x0004
682 684 #define TOPO_SENSOR_STATE_SYSTEM_AUX_LOG_UPDATED 0x0008
683 685 #define TOPO_SENSOR_STATE_SYSTEM_PEF_ACTION 0x0010
684 686 #define TOPO_SENSOR_STATE_SYSTEM_TIMETAMP_CLOCKSYNC 0x0020
685 687
686 688 #define TOPO_SENSOR_TYPE_CRITICAL 0x0013
687 689
688 690 #define TOPO_SENSOR_STATE_CRITICAL_EXT_NMI 0x0001
689 691 #define TOPO_SENSOR_STATE_CRITICAL_BUS_TIMEOUT 0x0002
690 692 #define TOPO_SENSOR_STATE_CRITICAL_IO_NMI 0x0004
691 693 #define TOPO_SENSOR_STATE_CRITICAL_SW_NMI 0x0008
692 694 #define TOPO_SENSOR_STATE_CRITICAL_PCI_PERR 0x0010
693 695 #define TOPO_SENSOR_STATE_CRITICAL_PCI_SERR 0x0020
694 696 #define TOPO_SENSOR_STATE_CRITICAL_EISA_FAILSAFE 0x0040
695 697 #define TOPO_SENSOR_STATE_CRITICAL_BUS_CE 0x0080
696 698 #define TOPO_SENSOR_STATE_CRITICAL_BUS_UE 0x0100
697 699 #define TOPO_SENSOR_STATE_CRITICAL_FATAL_NMI 0x0200
698 700 #define TOPO_SENSOR_STATE_CRITICAL_BUS_FATAL_ERR 0x0400
699 701 #define TOPO_SENSOR_STATE_CRITICAL_BUS_DEGRADED 0x0800
700 702
701 703 #define TOPO_SENSOR_TYPE_BUTTON 0x0014
702 704
703 705 #define TOPO_SENSOR_STATE_BUTTON_PWR 0x0001
704 706 #define TOPO_SENSOR_STATE_BUTTON_SLEEP 0x0002
705 707 #define TOPO_SENSOR_STATE_BUTTON_RESET 0x0004
706 708 #define TOPO_SENSOR_STATE_BUTTON_FRU_LATCH 0x0008
707 709 #define TOPO_SENSOR_STATE_BUTTON_FRU_SERVICE 0x0010
708 710
709 711 #define TOPO_SENSOR_TYPE_MODULE 0x0015
710 712 #define TOPO_SENSOR_TYPE_MICROCONTROLLER 0x0016
711 713 #define TOPO_SENSOR_TYPE_CARD 0x0017
712 714 #define TOPO_SENSOR_TYPE_CHASSIS 0x0018
713 715
714 716 #define TOPO_SENSOR_TYPE_CHIPSET 0x0019
715 717
716 718 #define TOPO_SENSOR_STATE_CHIPSET_PWR_CTL_FAIL 0x0001
717 719
718 720 #define TOPO_SENSOR_TYPE_FRU 0x001A
719 721
720 722 #define TOPO_SENSOR_TYPE_CABLE 0x001B
721 723
722 724 #define TOPO_SENSOR_STATE_CABLE_CONNECTED 0x0001
723 725 #define TOPO_SENSOR_STATE_CABLE_CONFIG_ERR 0x0002
724 726
725 727 #define TOPO_SENSOR_TYPE_TERMINATOR 0x001C
726 728
727 729 #define TOPO_SENSOR_TYPE_BOOT_STATE 0x001D
728 730
729 731 #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_PWR_UP 0x0001
730 732 #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_HARD_RESET 0x0002
731 733 #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_WARM_RESET 0x0004
732 734 #define TOPO_SENSOR_STATE_BOOT_STATE_PXE_BOOT 0x0008
733 735 #define TOPO_SENSOR_STATE_BOOT_STATE_DIAG_BOOT 0x0010
734 736 #define TOPO_SENSOR_STATE_BOOT_STATE_OS_HARD_RESET 0x0020
735 737 #define TOPO_SENSOR_STATE_BOOT_STATE_OS_WARM_RESET 0x0040
736 738 #define TOPO_SENSOR_STATE_BOOT_STATE_SYS_RESTART 0x0080
737 739
738 740 #define TOPO_SENSOR_TYPE_BOOT_ERROR 0x001E
739 741
740 742 #define TOPO_SENSOR_STATE_BOOT_ERROR_NOMEDIA 0x0001
741 743 #define TOPO_SENSOR_STATE_BOOT_ERROR_NON_BOOTABLE_DISK 0x0002
742 744 #define TOPO_SENSOR_STATE_BOOT_ERROR_NO_PXE_SERVER 0x0004
743 745 #define TOPO_SENSOR_STATE_BOOT_ERROR_INV_BOOT_SECT 0x0008
744 746 #define TOPO_SENSOR_STATE_BOOT_ERROR_USR_SELECT_TIMEOUT 0x0010
745 747
746 748 #define TOPO_SENSOR_TYPE_BOOT_OS 0x001F
747 749
748 750 #define TOPO_SENSOR_STATE_BOOT_OS_A_DRV_BOOT_COMPLETE 0x0001
749 751 #define TOPO_SENSOR_STATE_BOOT_OS_C_DRV_BOOT_COMPLETE 0x0002
750 752 #define TOPO_SENSOR_STATE_BOOT_OS_PXE_BOOT_COMPLETE 0x0004
751 753 #define TOPO_SENSOR_STATE_BOOT_OS_DIAG_BOOT_COMPLETE 0x0008
752 754 #define TOPO_SENSOR_STATE_BOOT_OS_CDROM_BOOT_COMPLETE 0x0010
753 755 #define TOPO_SENSOR_STATE_BOOT_OS_ROM_BOOT_COMPLETE 0x0020
754 756 #define TOPO_SENSOR_STATE_BOOT_OS_UNSPEC_BOOT_COMPLETE 0x0040
755 757
756 758 #define TOPO_SENSOR_TYPE_OS_SHUTDOWN 0x0020
757 759
758 760 #define TOPO_SENSOR_STATE_OS_SHUTDOWN_LOADING 0x0001
759 761 #define TOPO_SENSOR_STATE_OS_SHUTDOWN_CRASH 0x0002
760 762 #define TOPO_SENSOR_STATE_OS_STOP_GRACEFUL 0x0004
761 763 #define TOPO_SENSOR_STATE_OS_SHUTDOWN_GRACEFUL 0x0008
762 764 #define TOPO_SENSOR_STATE_OS_SHUTDOWN_PEF 0x0010
763 765 #define TOPO_SENSOR_STATE_OS_SHUTDOWN_BMC 0x0020
764 766
765 767 #define TOPO_SENSOR_TYPE_SLOT 0x0021
766 768
767 769 #define TOPO_SENSOR_STATE_SLOT_FAULT_ASSERTED 0x0001
768 770 #define TOPO_SENSOR_STATE_SLOT_IDENTIFY_ASSERTED 0x0002
769 771 #define TOPO_SENSOR_STATE_SLOT_CONNECTED 0x0004
770 772 #define TOPO_SENSOR_STATE_SLOT_INSTALL_READY 0x0008
771 773 #define TOPO_SENSOR_STATE_SLOT_REMOVE_READY 0x0010
772 774 #define TOPO_SENSOR_STATE_SLOT_PWR_OFF 0x0020
773 775 #define TOPO_SENSOR_STATE_SLOT_REMOVED 0x0040
774 776 #define TOPO_SENSOR_STATE_SLOT_INTERLOCK_ASSERTED 0x0080
775 777 #define TOPO_SENSOR_STATE_SLOT_DISABLED 0x0100
776 778 #define TOPO_SENSOR_STATE_SLOT_SPARE_DEVICE 0x0200
777 779
778 780 #define TOPO_SENSOR_TYPE_ACPI 0x0022
779 781
780 782 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S0_G0 0x0001
781 783 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S1 0x0002
782 784 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S2 0x0004
783 785 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S3 0x0008
784 786 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S4 0x0010
785 787 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S5_G2_SOFT_OFF 0x0020
786 788 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S4_S5_SOFT_OFF 0x0040
787 789 #define TOPO_SENSOR_STATE_ACPI_PSATTE_G3_MECH_OFF 0x0080
788 790 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S1_S2_S3_SLEEP 0x0100
789 791 #define TOPO_SENSOR_STATE_ACPI_PSTATE_G1_SLEEP 0x0200
790 792 #define TOPO_SENSOR_STATE_ACPI_PSTATE_S5_OVERRIDE 0x0400
791 793 #define TOPO_SENSOR_STATE_ACPI_PSTATE_LEGACY_ON 0x0800
792 794 #define TOPO_SENSOR_STATE_ACPI_PSTATE_LEGACY_OFF 0x1000
793 795 #define TOPO_SENSOR_STATE_ACPI_PSTATE_UNKNOWN 0x2000
794 796
795 797 #define TOPO_SENSOR_TYPE_WATCHDOG2 0x0023
796 798
797 799 #define TOPO_SENSOR_STATE_WATCHDOG2_EXPIRED 0x0001
798 800 #define TOPO_SENSOR_STATE_WATCHDOG2_HARD_RESET 0x0002
799 801 #define TOPO_SENSOR_STATE_WATCHDOG2_PWR_DOWN 0x0004
800 802 #define TOPO_SENSOR_STATE_WATCHDOG2_PWR_CYCLE 0x0008
801 803 #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED1 0x0010
802 804 #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED2 0x0020
803 805 #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED3 0x0040
804 806 #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED4 0x0080
805 807 #define TOPO_SENSOR_STATE_WATCHDOG2_TIMEOUT_INT 0x0100
806 808
807 809 #define TOPO_SENSOR_TYPE_ALERT 0x0024
808 810
809 811 #define TOPO_SENSOR_STATE_ALERT_PLAT_PAGE 0x0001
810 812 #define TOPO_SENSOR_STATE_ALERT_PLAT_LAN_ALERT 0x0002
811 813 #define TOPO_SENSOR_STATE_ALERT_PLAT_EVT_TRAP 0x0004
812 814 #define TOPO_SENSOR_STATE_ALERT_PLAT_SNMP_TRAP 0x0008
813 815
814 816 #define TOPO_SENSOR_TYPE_PRESENCE 0x0025
815 817
816 818 #define TOPO_SENSOR_STATE_PRESENCE_PRESENT 0x0001
817 819 #define TOPO_SENSOR_STATE_PRESENCE_ABSENT 0x0002
818 820 #define TOPO_SENSOR_STATE_PRESENCE_DISABLED 0x0004
819 821
820 822 #define TOPO_SENSOR_TYPE_ASIC 0x0026
821 823
822 824 #define TOPO_SENSOR_TYPE_LAN 0x0027
823 825
824 826 #define TOPO_SENSOR_STATE_LAN_HEARTBEAT_LOST 0x0001
825 827 #define TOPO_SENSOR_STATE_LAN_HEARTBEAT 0x0002
826 828
827 829 #define TOPO_SENSOR_TYPE_HEALTH 0x0028
828 830
829 831 #define TOPO_SENSOR_STATE_HEALTH_SENSOR_ACC_DEGRADED 0x0001
830 832 #define TOPO_SENSOR_STATE_HEALTH_CNTLR_ACC_DEGRADED 0x0002
831 833 #define TOPO_SENSOR_STATE_HEALTH_CNTLR_OFFLINE 0x0004
832 834 #define TOPO_SENSOR_STATE_HEALTH_CNTLR_UNAVAIL 0x0008
833 835 #define TOPO_SENSOR_STATE_HEALTH_SENSOR_FAILURE 0x0010
834 836 #define TOPO_SENSOR_STATE_HEALTH_FRU_FAILURE 0x0020
835 837
836 838 #define TOPO_SENSOR_TYPE_BATTERY 0x0029
837 839
838 840 #define TOPO_SENSOR_STATE_BATTERY_LOW 0x0001
839 841 #define TOPO_SENSOR_STATE_BATTERY_FAILED 0x0002
840 842 #define TOPO_SENSOR_STATE_BATTERY_PRESENCE 0x0004
841 843
842 844 #define TOPO_SENSOR_TYPE_AUDIT 0x002A
843 845
844 846 #define TOPO_SENSOR_STATE_AUDIT_SESSION_ACTIVATED 0x0001
845 847 #define TOPO_SENSOR_STATE_AUDIT_SESSION_DEACTIVATED 0x0002
846 848
847 849 #define TOPO_SENSOR_TYPE_VERSION 0x002B
848 850
849 851 #define TOPO_SENSOR_STATE_VERSION_HW_CHANGE 0x0001
850 852 #define TOPO_SENSOR_STATE_VERSION_SW_CHANGE 0x0002
851 853 #define TOPO_SENSOR_STATE_VERSION_HW_INCOMPATIBLE 0x0004
852 854 #define TOPO_SENSOR_STATE_VERSION_SW_INCOMPATIBLE 0x0008
853 855 #define TOPO_SENSOR_STATE_VERSION_HW_INVAL 0x0010
854 856 #define TOPO_SENSOR_STATE_VERSION_SW_INVAL 0x0020
855 857 #define TOPO_SENSOR_STATE_VERSION_HW_CHANGE_SUCCESS 0x0040
856 858 #define TOPO_SENSOR_STATE_VERSION_SW_CHANGE_SUCCESS 0x0080
857 859
858 860 #define TOPO_SENSOR_TYPE_FRU_STATE 0x002C
859 861
860 862 #define TOPO_SENSOR_STATE_FRU_STATE_NOT_INSTALLED 0x0001
861 863 #define TOPO_SENSOR_STATE_FRU_STATE_INACTIVE 0x0002
862 864 #define TOPO_SENSOR_STATE_FRU_STATE_ACT_REQ 0x0004
863 865 #define TOPO_SENSOR_STATE_FRU_STATE_ACT_INPROGRESS 0x0008
864 866 #define TOPO_SENSOR_STATE_FRU_STATE_ACTIVE 0x0010
865 867 #define TOPO_SENSOR_STATE_FRU_STATE_DEACT_REQ 0x0020
866 868 #define TOPO_SENSOR_STATE_FRU_STATE_DEACT_INPROGRESS 0x0040
867 869 #define TOPO_SENSOR_STATE_FRU_STATE_COMM_LOST 0x0080
868 870
869 871 /*
870 872 * We simplify the IPMI sensor type code defines by combining the generic
871 873 * and sensor-specific codes into a single range. Because there's overlap
872 874 * between the two ranges we offset the generic type codes by 0x0100
873 875 * which allows ample room in the hole for future expansion of the table to
874 876 * accomodate either additions to the IPMI spec or to support new sensor types
875 877 * for alternate provider modules.
876 878 */
877 879 #define TOPO_SENSOR_TYPE_THRESHOLD_STATE 0x0101
878 880
879 881 #define TOPO_SENSOR_STATE_THRESH_LOWER_NONCRIT 0x0001
880 882 #define TOPO_SENSOR_STATE_THRESH_LOWER_CRIT 0x0002
881 883 #define TOPO_SENSOR_STATE_THRESH_LOWER_NONREC 0x0004
882 884 #define TOPO_SENSOR_STATE_THRESH_UPPER_NONCRIT 0x0008
883 885 #define TOPO_SENSOR_STATE_THRESH_UPPER_CRIT 0x0010
884 886 #define TOPO_SENSOR_STATE_THRESH_UPPER_NONREC 0x0020
885 887
886 888 #define TOPO_SENSOR_TYPE_GENERIC_USAGE 0x0102
887 889
888 890 #define TOPO_SENSOR_STATE_GENERIC_USAGE_IDLE 0x0001
889 891 #define TOPO_SENSOR_STATE_GENERIC_USAGE_ACTIVE 0x0002
890 892 #define TOPO_SENSOR_STATE_GENERIC_USAGE_BUSY 0x0004
891 893
892 894 #define TOPO_SENSOR_TYPE_GENERIC_STATE 0x0103
893 895
894 896 #define TOPO_SENSOR_STATE_GENERIC_STATE_DEASSERTED 0x0001
895 897 #define TOPO_SENSOR_STATE_GENERIC_STATE_ASSERTED 0x0002
896 898
897 899 #define TOPO_SENSOR_TYPE_GENERIC_PREDFAIL 0x0104
898 900
899 901 #define TOPO_SENSOR_STATE_GENERIC_PREDFAIL_DEASSERTED 0x0001
900 902 #define TOPO_SENSOR_STATE_GENERIC_PREDFAIL_ASSERTED 0x0002
901 903
902 904 #define TOPO_SENSOR_TYPE_GENERIC_LIMIT 0x0105
903 905
904 906 #define TOPO_SENSOR_STATE_GENERIC_LIMIT_NOT_EXCEEDED 0x0001
905 907 #define TOPO_SENSOR_STATE_GENERIC_LIMIT_EXCEEDED 0x0002
906 908
907 909 #define TOPO_SENSOR_TYPE_GENERIC_PERFORMANCE 0x0106
908 910
909 911 #define TOPO_SENSOR_STATE_GENERIC_PERFORMANCE_MET 0x0001
910 912 #define TOPO_SENSOR_STATE_GENERIC_PERFORMANCE_LAGS 0x0002
911 913
912 914 #define TOPO_SENSOR_TYPE_SEVERITY 0x0107
913 915
914 916 #define TOPO_SENSOR_STATE_SEVERITY_OK 0x0001
915 917 #define TOPO_SENSOR_STATE_SEVERITY_NONCRIT_GOING_HIGH 0x0002
916 918 #define TOPO_SENSOR_STATE_SEVERITY_CRIT_GOING_HIGH 0x0004
917 919 #define TOPO_SENSOR_STATE_SEVERITY_NONREC_GOING_HIGH 0x0008
918 920 #define TOPO_SENSOR_STATE_SEVERITY_NONCRIT_GOING_LOW 0x0010
919 921 #define TOPO_SENSOR_STATE_SEVERITY_CRIT_GOING_LOW 0x0020
920 922 #define TOPO_SENSOR_STATE_SEVERITY_NONREC_GOING_LOW 0x0020
921 923 #define TOPO_SENSOR_STATE_SEVERITY_MONITOR 0x0040
922 924 #define TOPO_SENSOR_STATE_SEVERITY_INFORMATIONAL 0x0080
923 925
924 926 #define TOPO_SENSOR_TYPE_GENERIC_PRESENCE 0x0108
925 927
926 928 #define TOPO_SENSOR_STATE_GENERIC_PRESENCE_DEASSERTED 0x0001
927 929 #define TOPO_SENSOR_STATE_GENERIC_PRESENCE_ASSERTED 0x0002
928 930
929 931 #define TOPO_SENSOR_TYPE_GENERIC_AVAILABILITY 0x0109
930 932
931 933 #define TOPO_SENSOR_STATE_GENERIC_AVAIL_DEASSERTED 0x0001
932 934 #define TOPO_SENSOR_STATE_GENERIC_AVAIL_ASSERTED 0x0002
933 935
934 936 #define TOPO_SENSOR_TYPE_GENERIC_STATUS 0x010A
935 937
936 938 #define TOPO_SENSOR_STATE_GENERIC_STATUS_RUNNING 0x0001
937 939 #define TOPO_SENSOR_STATE_GENERIC_STATUS_IN_TEST 0x0002
938 940 #define TOPO_SENSOR_STATE_GENERIC_STATUS_POWER_OFF 0x0004
939 941 #define TOPO_SENSOR_STATE_GENERIC_STATUS_ONLINE 0x0008
940 942 #define TOPO_SENSOR_STATE_GENERIC_STATUS_OFFLINE 0x0010
941 943 #define TOPO_SENSOR_STATE_GENERIC_STATUS_OFF_DUTY 0x0020
942 944 #define TOPO_SENSOR_STATE_GENERIC_STATUS_DEGRADED 0x0040
943 945 #define TOPO_SENSOR_STATE_GENERIC_STATUS_POWER_SAVE 0x0080
944 946 #define TOPO_SENSOR_STATE_GENERIC_STATUS_INSTALL_ERR 0x0100
945 947
946 948 #define TOPO_SENSOR_TYPE_GENERIC_REDUNDANCY 0x010B
947 949
948 950 /*
949 951 * ACPI power state
950 952 */
951 953 #define TOPO_SENSOR_TYPE_GENERIC_ACPI 0x010C
952 954
953 955 #define TOPO_SENSOR_STATE_GENERIC_ACPI_D0 0x0001
954 956 #define TOPO_SENSOR_STATE_GENERIC_ACPI_D1 0x0002
955 957 #define TOPO_SENSOR_STATE_GENERIC_ACPI_D2 0x0004
956 958 #define TOPO_SENSOR_STATE_GENERIC_ACPI_D3 0x0008
957 959
958 960 /*
959 961 * These sensor types don't exist in the IPMI spec, but allow consumers to
960 962 * associate discrete sensors with component failure. The 'ok' sensor is the
961 963 * inverse of the 'failure' sensor. Note that the values intentionally mimic
962 964 * TOPO_SENSOR_TYPE_GENERIC_STATE, so that you can use existing IPMI sensors
963 965 * but just change the type to get semantically meaningful behavior.
964 966 */
965 967 #define TOPO_SENSOR_TYPE_GENERIC_FAILURE 0x010D
966 968
967 969 #define TOPO_SENSOR_STATE_GENERIC_FAIL_DEASSERTED 0x0001
968 970 #define TOPO_SENSOR_STATE_GENERIC_FAIL_NONRECOV 0x0002
969 971 #define TOPO_SENSOR_STATE_GENERIC_FAIL_CRITICAL 0x0004
970 972
971 973 #define TOPO_SENSOR_TYPE_GENERIC_OK 0x010E
972 974
973 975 #define TOPO_SENSOR_STATE_GENERIC_OK_DEASSERTED 0x0001
974 976 #define TOPO_SENSOR_STATE_GENERIC_OK_ASSERTED 0x0002
975 977
976 978 /*
977 979 * Indicator modes and types
978 980 */
979 981 typedef enum topo_led_state {
980 982 TOPO_LED_STATE_OFF = 0,
981 983 TOPO_LED_STATE_ON
982 984 } topo_led_state_t;
983 985
984 986 #define TOPO_FAC_TYPE_ANY 0xFFFFFFFF
985 987
986 988 /*
987 989 * This list is limited to the set of LED's that we're likely to manage through
988 990 * FMA. Thus is does not include things like power or activity LED's
989 991 */
990 992 typedef enum topo_led_type {
991 993 TOPO_LED_TYPE_SERVICE = 0,
992 994 TOPO_LED_TYPE_LOCATE,
993 995 TOPO_LED_TYPE_OK2RM,
994 996 TOPO_LED_TYPE_PRESENT
995 997 } topo_led_type_t;
996 998
997 999
998 1000 #ifdef __cplusplus
999 1001 }
1000 1002 #endif
1001 1003
1002 1004 #endif /* _LIBTOPO_H */
↓ open down ↓ |
853 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX