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