17aec1d6eScindi /* 27aec1d6eScindi * CDDL HEADER START 37aec1d6eScindi * 47aec1d6eScindi * The contents of this file are subject to the terms of the 57aec1d6eScindi * Common Development and Distribution License (the "License"). 67aec1d6eScindi * You may not use this file except in compliance with the License. 77aec1d6eScindi * 87aec1d6eScindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97aec1d6eScindi * or http://www.opensolaris.org/os/licensing. 107aec1d6eScindi * See the License for the specific language governing permissions 117aec1d6eScindi * and limitations under the License. 127aec1d6eScindi * 137aec1d6eScindi * When distributing Covered Code, include this CDDL HEADER in each 147aec1d6eScindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157aec1d6eScindi * If applicable, add the following below this CDDL HEADER, with the 167aec1d6eScindi * fields enclosed by brackets "[]" replaced with your own identifying 177aec1d6eScindi * information: Portions Copyright [yyyy] [name of copyright owner] 187aec1d6eScindi * 197aec1d6eScindi * CDDL HEADER END 207aec1d6eScindi */ 217aec1d6eScindi 227aec1d6eScindi /* 238393544eSHyon Kim * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 247aec1d6eScindi */ 257aec1d6eScindi 267aec1d6eScindi #ifndef _LIBTOPO_H 277aec1d6eScindi #define _LIBTOPO_H 287aec1d6eScindi 297aec1d6eScindi #include <sys/nvpair.h> 300eb822a1Scindi #include <stdio.h> 31c93c462eSCheng Sean Ye #include <libdevinfo.h> 327aec1d6eScindi 337aec1d6eScindi #ifdef __cplusplus 347aec1d6eScindi extern "C" { 357aec1d6eScindi #endif 367aec1d6eScindi 377aec1d6eScindi #define TOPO_VERSION 1 /* Library ABI Interface Version */ 387aec1d6eScindi 397aec1d6eScindi typedef struct topo_hdl topo_hdl_t; 407aec1d6eScindi typedef struct topo_node tnode_t; 417aec1d6eScindi typedef struct topo_walk topo_walk_t; 427aec1d6eScindi typedef int32_t topo_instance_t; 437aec1d6eScindi typedef uint32_t topo_version_t; 447aec1d6eScindi 45825ba0f2Srobj typedef struct topo_list { 46825ba0f2Srobj struct topo_list *l_prev; 47825ba0f2Srobj struct topo_list *l_next; 48825ba0f2Srobj } topo_list_t; 49825ba0f2Srobj 50825ba0f2Srobj typedef struct topo_faclist { 51825ba0f2Srobj topo_list_t tf_list; 52825ba0f2Srobj tnode_t *tf_node; 53825ba0f2Srobj } topo_faclist_t; 54825ba0f2Srobj 557aec1d6eScindi /* 56c40d7343Scindi * The following functions, error codes and data structures are private 57c40d7343Scindi * to libtopo snapshot consumers and enumerator modules. 587aec1d6eScindi */ 597aec1d6eScindi extern topo_hdl_t *topo_open(int, const char *, int *); 607aec1d6eScindi extern void topo_close(topo_hdl_t *); 617aec1d6eScindi extern char *topo_snap_hold(topo_hdl_t *, const char *, int *); 627aec1d6eScindi extern void topo_snap_release(topo_hdl_t *); 630eb822a1Scindi 640eb822a1Scindi /* 650eb822a1Scindi * Snapshot walker support 660eb822a1Scindi */ 670eb822a1Scindi typedef int (*topo_walk_cb_t)(topo_hdl_t *, tnode_t *, void *); 680eb822a1Scindi 697aec1d6eScindi extern topo_walk_t *topo_walk_init(topo_hdl_t *, const char *, topo_walk_cb_t, 707aec1d6eScindi void *, int *); 717aec1d6eScindi extern int topo_walk_step(topo_walk_t *, int); 727aec1d6eScindi extern void topo_walk_fini(topo_walk_t *); 73c93c462eSCheng Sean Ye extern di_node_t topo_hdl_devinfo(topo_hdl_t *); 74c93c462eSCheng Sean Ye extern di_prom_handle_t topo_hdl_prominfo(topo_hdl_t *); 757aec1d6eScindi 76c40d7343Scindi /* 77c40d7343Scindi * Walk status returned from walker 78c40d7343Scindi */ 797aec1d6eScindi #define TOPO_WALK_ERR -1 807aec1d6eScindi #define TOPO_WALK_NEXT 0 817aec1d6eScindi #define TOPO_WALK_TERMINATE 1 827aec1d6eScindi 83c40d7343Scindi /* 84c40d7343Scindi * Types of walks: depth-first (child) or breadth-first (sibling) 85c40d7343Scindi */ 867aec1d6eScindi #define TOPO_WALK_CHILD 0x0001 877aec1d6eScindi #define TOPO_WALK_SIBLING 0x0002 887aec1d6eScindi 890eb822a1Scindi /* 900eb822a1Scindi * FMRI helper routines 910eb822a1Scindi */ 927aec1d6eScindi extern int topo_fmri_present(topo_hdl_t *, nvlist_t *, int *); 9325c6ff4bSstephh extern int topo_fmri_replaced(topo_hdl_t *, nvlist_t *, int *); 947aec1d6eScindi extern int topo_fmri_contains(topo_hdl_t *, nvlist_t *, nvlist_t *, int *); 95dd566498Svn83148 extern int topo_fmri_expand(topo_hdl_t *, nvlist_t *, int *); 967aec1d6eScindi extern int topo_fmri_unusable(topo_hdl_t *, nvlist_t *, int *); 9725c6ff4bSstephh extern int topo_fmri_service_state(topo_hdl_t *, nvlist_t *, int *); 98e4b86885SCheng Sean Ye extern int topo_fmri_retire(topo_hdl_t *, nvlist_t *, int *); 99e4b86885SCheng Sean Ye extern int topo_fmri_unretire(topo_hdl_t *, nvlist_t *, int *); 1007aec1d6eScindi extern int topo_fmri_nvl2str(topo_hdl_t *, nvlist_t *, char **, int *); 1017aec1d6eScindi extern int topo_fmri_str2nvl(topo_hdl_t *, const char *, nvlist_t **, int *); 1027aec1d6eScindi extern int topo_fmri_asru(topo_hdl_t *, nvlist_t *, nvlist_t **, int *); 1037aec1d6eScindi extern int topo_fmri_fru(topo_hdl_t *, nvlist_t *, nvlist_t **, 1047aec1d6eScindi int *); 1059dd0f810Scindi extern int topo_fmri_label(topo_hdl_t *, nvlist_t *, char **, int *); 1062cb5535aSrobj extern int topo_fmri_serial(topo_hdl_t *, nvlist_t *, char **, int *); 1077aec1d6eScindi extern int topo_fmri_compare(topo_hdl_t *, nvlist_t *, nvlist_t *, int *); 108825ba0f2Srobj extern int topo_fmri_facility(topo_hdl_t *, nvlist_t *, const char *, 109825ba0f2Srobj uint32_t, topo_walk_cb_t, void *, int *); 1107aec1d6eScindi 1117aec1d6eScindi /* 112069f55e2SEric Schrock * Consolidation private utility functions 113940d71d2Seschrock */ 114940d71d2Seschrock extern ulong_t topo_fmri_strhash(topo_hdl_t *, const char *); 115069f55e2SEric Schrock extern ulong_t topo_fmri_strhash_noauth(topo_hdl_t *, const char *); 116940d71d2Seschrock extern boolean_t topo_fmri_strcmp(topo_hdl_t *, const char *, const char *); 117069f55e2SEric Schrock extern boolean_t topo_fmri_strcmp_noauth(topo_hdl_t *, const char *, 118069f55e2SEric Schrock const char *); 119940d71d2Seschrock 120940d71d2Seschrock /* 1217aec1d6eScindi * Topo node utilities: callable from topo_walk_step() callback or module 1227aec1d6eScindi * enumeration, topo_mod_enumerate() 1237aec1d6eScindi */ 1247aec1d6eScindi extern char *topo_node_name(tnode_t *); 1257aec1d6eScindi extern topo_instance_t topo_node_instance(tnode_t *); 1264557a2a1Srobj extern tnode_t *topo_node_parent(tnode_t *); 1277aec1d6eScindi extern void *topo_node_private(tnode_t *); 128825ba0f2Srobj extern int topo_node_flags(tnode_t *); 1297aec1d6eScindi extern int topo_node_asru(tnode_t *, nvlist_t **, nvlist_t *, int *); 1307aec1d6eScindi extern int topo_node_fru(tnode_t *, nvlist_t **, nvlist_t *, int *); 1317aec1d6eScindi extern int topo_node_resource(tnode_t *, nvlist_t **, int *); 1327aec1d6eScindi extern int topo_node_label(tnode_t *, char **, int *); 133e4b86885SCheng Sean Ye extern tnode_t *topo_node_lookup(tnode_t *, const char *, topo_instance_t); 1347aec1d6eScindi extern int topo_method_invoke(tnode_t *node, const char *, topo_version_t, 1357aec1d6eScindi nvlist_t *, nvlist_t **, int *); 136825ba0f2Srobj extern boolean_t topo_method_supported(tnode_t *, const char *, 137825ba0f2Srobj topo_version_t); 138825ba0f2Srobj extern int topo_node_facility(topo_hdl_t *, tnode_t *, const char *, 139825ba0f2Srobj uint32_t, topo_faclist_t *, int *); 140*1410cb93SJoshua M. Clulow extern int topo_node_child_walk(topo_hdl_t *, tnode_t *, topo_walk_cb_t, 141*1410cb93SJoshua M. Clulow void *, int *); 1427aec1d6eScindi 143825ba0f2Srobj /* 144825ba0f2Srobj * Node flags: denotes type of node 145825ba0f2Srobj */ 146825ba0f2Srobj #define TOPO_NODE_DEFAULT 0 147825ba0f2Srobj #define TOPO_NODE_FACILITY 1 148825ba0f2Srobj 149825ba0f2Srobj #define TOPO_FAC_TYPE_SENSOR "sensor" 150825ba0f2Srobj #define TOPO_FAC_TYPE_INDICATOR "indicator" 151825ba0f2Srobj 152825ba0f2Srobj /* 153825ba0f2Srobj * Topo property get functions 154825ba0f2Srobj */ 1557aec1d6eScindi extern int topo_prop_get_int32(tnode_t *, const char *, const char *, 1567aec1d6eScindi int32_t *, int *); 1577aec1d6eScindi extern int topo_prop_get_uint32(tnode_t *, const char *, const char *, 1587aec1d6eScindi uint32_t *, int *); 1597aec1d6eScindi extern int topo_prop_get_int64(tnode_t *, const char *, const char *, 1607aec1d6eScindi int64_t *, int *); 1617aec1d6eScindi extern int topo_prop_get_uint64(tnode_t *, const char *, const char *, 1627aec1d6eScindi uint64_t *, int *); 163825ba0f2Srobj extern int topo_prop_get_double(tnode_t *, const char *, const char *, 164825ba0f2Srobj double *, int *); 1657aec1d6eScindi extern int topo_prop_get_string(tnode_t *, const char *, const char *, 1667aec1d6eScindi char **, int *); 1677aec1d6eScindi extern int topo_prop_get_fmri(tnode_t *, const char *, const char *, 1687aec1d6eScindi nvlist_t **, int *); 1690eb822a1Scindi extern int topo_prop_get_int32_array(tnode_t *, const char *, const char *, 1700eb822a1Scindi int32_t **, uint_t *, int *); 1710eb822a1Scindi extern int topo_prop_get_uint32_array(tnode_t *, const char *, const char *, 1720eb822a1Scindi uint32_t **, uint_t *, int *); 1730eb822a1Scindi extern int topo_prop_get_int64_array(tnode_t *, const char *, const char *, 1740eb822a1Scindi int64_t **, uint_t *, int *); 1750eb822a1Scindi extern int topo_prop_get_uint64_array(tnode_t *, const char *, const char *, 1760eb822a1Scindi uint64_t **, uint_t *, int *); 1770eb822a1Scindi extern int topo_prop_get_string_array(tnode_t *, const char *, const char *, 1780eb822a1Scindi char ***, uint_t *, int *); 1790eb822a1Scindi extern int topo_prop_get_fmri_array(tnode_t *, const char *, const char *, 1800eb822a1Scindi nvlist_t ***, uint_t *, int *); 1817aec1d6eScindi 182825ba0f2Srobj /* 183825ba0f2Srobj * Topo property set functions 184825ba0f2Srobj */ 185825ba0f2Srobj extern int topo_prop_set_int32(tnode_t *, const char *, const char *, int, 186825ba0f2Srobj int32_t, int *); 187825ba0f2Srobj extern int topo_prop_set_uint32(tnode_t *, const char *, const char *, int, 188825ba0f2Srobj uint32_t, int *); 189825ba0f2Srobj extern int topo_prop_set_int64(tnode_t *, const char *, const char *, 190825ba0f2Srobj int, int64_t, int *); 191825ba0f2Srobj extern int topo_prop_set_uint64(tnode_t *, const char *, const char *, 192825ba0f2Srobj int, uint64_t, int *); 193825ba0f2Srobj extern int topo_prop_set_double(tnode_t *, const char *, const char *, 194825ba0f2Srobj int, double, int *); 195825ba0f2Srobj extern int topo_prop_set_string(tnode_t *, const char *, const char *, 196825ba0f2Srobj int, const char *, int *); 197825ba0f2Srobj extern int topo_prop_set_fmri(tnode_t *, const char *, const char *, 198825ba0f2Srobj int, const nvlist_t *, int *); 199825ba0f2Srobj extern int topo_prop_set_int32_array(tnode_t *, const char *, const char *, int, 200825ba0f2Srobj int32_t *, uint_t, int *); 201825ba0f2Srobj extern int topo_prop_set_uint32_array(tnode_t *, const char *, const char *, 202825ba0f2Srobj int, uint32_t *, uint_t, int *); 203825ba0f2Srobj extern int topo_prop_set_int64_array(tnode_t *, const char *, const char *, 204825ba0f2Srobj int, int64_t *, uint_t, int *); 205825ba0f2Srobj extern int topo_prop_set_uint64_array(tnode_t *, const char *, const char *, 206825ba0f2Srobj int, uint64_t *, uint_t, int *); 207825ba0f2Srobj extern int topo_prop_set_string_array(tnode_t *, const char *, const char *, 208825ba0f2Srobj int, const char **, uint_t, int *); 209825ba0f2Srobj extern int topo_prop_set_fmri_array(tnode_t *, const char *, const char *, 210825ba0f2Srobj int, const nvlist_t **, uint_t, int *); 211825ba0f2Srobj 2120eb822a1Scindi #define TOPO_PROP_IMMUTABLE 0 213e5dcf7beSRobert Johnston #define TOPO_PROP_MUTABLE 0x01 214e5dcf7beSRobert Johnston #define TOPO_PROP_NONVOLATILE 0x02 2157aec1d6eScindi 2167aec1d6eScindi /* Protocol property group and property names */ 2177aec1d6eScindi #define TOPO_PGROUP_PROTOCOL "protocol" /* Required property group */ 2187aec1d6eScindi #define TOPO_PROP_RESOURCE "resource" /* resource FMRI */ 2197aec1d6eScindi #define TOPO_PROP_ASRU "ASRU" /* ASRU FMRI */ 2207aec1d6eScindi #define TOPO_PROP_FRU "FRU" /* FRU FMRI */ 2217aec1d6eScindi #define TOPO_PROP_MOD "module" /* software module FMRI */ 2227aec1d6eScindi #define TOPO_PROP_PKG "package" /* software package FMRI */ 2237aec1d6eScindi #define TOPO_PROP_LABEL "label" /* property LABEL */ 2247aec1d6eScindi 225825ba0f2Srobj #define TOPO_METH_FAC_ENUM "fac_enum" 226825ba0f2Srobj 2277aec1d6eScindi /* 2287aec1d6eScindi * System property group 2297aec1d6eScindi */ 2307aec1d6eScindi #define TOPO_PGROUP_SYSTEM "system" 2317aec1d6eScindi #define TOPO_PROP_ISA "isa" 2327aec1d6eScindi #define TOPO_PROP_MACHINE "machine" 2337aec1d6eScindi 23488045cffSRobert Johnston #define TOPO_PGROUP_IPMI "ipmi" 23588045cffSRobert Johnston 236c40d7343Scindi /* 237c40d7343Scindi * These enum definitions are used to define a set of error tags associated with 238c40d7343Scindi * libtopo error conditions occuring during the adminstration of 239c40d7343Scindi * properties, invocation of methods and fmri-based queries. The shell script 240c40d7343Scindi * mkerror.sh is used to parse this file and create a corresponding topo_error.c 241c40d7343Scindi * source file. 242c40d7343Scindi * 243c40d7343Scindi * If you do something other than add a new error tag here, you may need to 244c40d7343Scindi * update the mkerror shell script as it is based upon simple regexps. 245c40d7343Scindi */ 246c40d7343Scindi typedef enum topo_prop_errno { 247c40d7343Scindi ETOPO_PROP_UNKNOWN = 3000, /* unknown topo prop error */ 248c40d7343Scindi ETOPO_PROP_NOENT, /* undefined property or property group */ 249c40d7343Scindi ETOPO_PROP_DEFD, /* static property already defined */ 250c40d7343Scindi ETOPO_PROP_NOMEM, /* memory limit exceeded during property allocation */ 251c40d7343Scindi ETOPO_PROP_TYPE, /* invalid property type */ 252c40d7343Scindi ETOPO_PROP_NAME, /* invalid property name */ 253c40d7343Scindi ETOPO_PROP_NOINHERIT, /* can not inherit property */ 254c40d7343Scindi ETOPO_PROP_NVL, /* malformed property nvlist */ 255c40d7343Scindi ETOPO_PROP_METHOD, /* get property method failed */ 256c40d7343Scindi ETOPO_PROP_END /* end of prop errno list (to ease auto-merge) */ 257c40d7343Scindi } topo_prop_errno_t; 258c40d7343Scindi 259c40d7343Scindi typedef enum topo_method_errno { 260c40d7343Scindi ETOPO_METHOD_UNKNOWN = 3100, /* unknown topo method error */ 261c40d7343Scindi ETOPO_METHOD_INVAL, /* invalid method registration */ 262c40d7343Scindi ETOPO_METHOD_NOTSUP, /* method not supported */ 263c40d7343Scindi ETOPO_METHOD_FAIL, /* method failed */ 264c40d7343Scindi ETOPO_METHOD_VEROLD, /* app is compiled to use obsolete method */ 265c40d7343Scindi ETOPO_METHOD_VERNEW, /* app is compiled to use obsolete method */ 266c40d7343Scindi ETOPO_METHOD_NOMEM, /* memory limit exceeded during method op */ 267c40d7343Scindi ETOPO_METHOD_DEFD, /* method op already defined */ 268c40d7343Scindi ETOPO_METHOD_END /* end of method errno list */ 269c40d7343Scindi } topo_method_errno_t; 270c40d7343Scindi 271c40d7343Scindi typedef enum topo_fmri_errno { 272c40d7343Scindi ETOPO_FMRI_UNKNOWN = 3200, /* unknown topo fmri error */ 273c40d7343Scindi ETOPO_FMRI_NVL, /* nvlist allocation failure for FMRI */ 274c40d7343Scindi ETOPO_FMRI_VERSION, /* invalid FMRI scheme version */ 275c40d7343Scindi ETOPO_FMRI_MALFORM, /* malformed FMRI */ 276c40d7343Scindi ETOPO_FMRI_NOMEM, /* memory limit exceeded */ 277c40d7343Scindi ETOPO_FMRI_END /* end of fmri errno list */ 278c40d7343Scindi } topo_fmri_errno_t; 279c40d7343Scindi 280c40d7343Scindi typedef enum topo_hdl_errno { 281c40d7343Scindi ETOPO_HDL_UNKNOWN = 3300, /* unknown topo handle error */ 282c40d7343Scindi ETOPO_HDL_ABIVER, /* handle opened with invalid ABI version */ 283c40d7343Scindi ETOPO_HDL_SNAP, /* snapshot already taken */ 284c40d7343Scindi ETOPO_HDL_INVAL, /* invalid argument specified */ 285c40d7343Scindi ETOPO_HDL_UUID, /* uuid already set */ 286c40d7343Scindi ETOPO_HDL_NOMEM, /* memory limit exceeded */ 287c40d7343Scindi ETOPO_HDL_END /* end of handle errno list */ 288c40d7343Scindi } topo_hdl_errno_t; 289c40d7343Scindi 290c40d7343Scindi extern const char *topo_strerror(int); 291c40d7343Scindi extern void topo_hdl_strfree(topo_hdl_t *, char *); 292c40d7343Scindi extern void topo_debug_set(topo_hdl_t *, const char *, const char *); 293c40d7343Scindi 294c40d7343Scindi /* 295c40d7343Scindi * The following functions and data structures to support property 296c40d7343Scindi * observability are private to the fmtopo command. 297c40d7343Scindi */ 298c40d7343Scindi 299c40d7343Scindi /* 300c40d7343Scindi * Each topology node advertises the name and data stability of each of its 301c40d7343Scindi * modules and properties. (see attributes(5)). 302c40d7343Scindi */ 303c40d7343Scindi 304c40d7343Scindi /* 305c40d7343Scindi * Topo stability attributes 306c40d7343Scindi */ 307c40d7343Scindi typedef enum topo_stability { 308c40d7343Scindi TOPO_STABILITY_UNKNOWN = 0, /* private to libtopo */ 309c40d7343Scindi TOPO_STABILITY_INTERNAL, /* private to libtopo */ 310c40d7343Scindi TOPO_STABILITY_PRIVATE, /* private to Sun */ 311c40d7343Scindi TOPO_STABILITY_OBSOLETE, /* scheduled for removal */ 312c40d7343Scindi TOPO_STABILITY_EXTERNAL, /* not controlled by Sun */ 313c40d7343Scindi TOPO_STABILITY_UNSTABLE, /* new or rapidly changing */ 314c40d7343Scindi TOPO_STABILITY_EVOLVING, /* less rapidly changing */ 315c40d7343Scindi TOPO_STABILITY_STABLE, /* mature interface from Sun */ 316c40d7343Scindi TOPO_STABILITY_STANDARD /* industry standard */ 317c40d7343Scindi } topo_stability_t; 318c40d7343Scindi 319c40d7343Scindi #define TOPO_STABILITY_MAX TOPO_STABILITY_STANDARD /* max valid stab */ 320c40d7343Scindi 321c40d7343Scindi typedef struct topo_pgroup_info { 322c40d7343Scindi const char *tpi_name; /* property group name */ 323c40d7343Scindi topo_stability_t tpi_namestab; /* stability of group name */ 324c40d7343Scindi topo_stability_t tpi_datastab; /* stability of all property values */ 325c40d7343Scindi topo_version_t tpi_version; /* version of pgroup definition */ 326c40d7343Scindi } topo_pgroup_info_t; 327c40d7343Scindi 328c40d7343Scindi extern topo_stability_t topo_name2stability(const char *); 329c40d7343Scindi extern const char *topo_stability2name(topo_stability_t); 330c40d7343Scindi extern void topo_pgroup_destroy(tnode_t *, const char *); 331c40d7343Scindi extern topo_pgroup_info_t *topo_pgroup_info(tnode_t *, const char *, int *); 332c40d7343Scindi 333c40d7343Scindi typedef enum { 334c40d7343Scindi TOPO_TYPE_INVALID = 0, 335c40d7343Scindi TOPO_TYPE_BOOLEAN, /* boolean */ 336c40d7343Scindi TOPO_TYPE_INT32, /* int32_t */ 337c40d7343Scindi TOPO_TYPE_UINT32, /* uint32_t */ 338c40d7343Scindi TOPO_TYPE_INT64, /* int64_t */ 339c40d7343Scindi TOPO_TYPE_UINT64, /* uint64_t */ 340c40d7343Scindi TOPO_TYPE_STRING, /* const char* */ 341c40d7343Scindi TOPO_TYPE_TIME, /* uint64_t */ 342c40d7343Scindi TOPO_TYPE_SIZE, /* uint64_t */ 343c40d7343Scindi TOPO_TYPE_FMRI, /* nvlist_t */ 344c40d7343Scindi TOPO_TYPE_INT32_ARRAY, /* array of int32_t */ 345c40d7343Scindi TOPO_TYPE_UINT32_ARRAY, /* array of uint32_t */ 346c40d7343Scindi TOPO_TYPE_INT64_ARRAY, /* array of int64_t */ 347c40d7343Scindi TOPO_TYPE_UINT64_ARRAY, /* array of uint64_t */ 348c40d7343Scindi TOPO_TYPE_STRING_ARRAY, /* array of const char* */ 349825ba0f2Srobj TOPO_TYPE_FMRI_ARRAY, /* array of nvlist_t */ 350825ba0f2Srobj TOPO_TYPE_DOUBLE /* double */ 351c40d7343Scindi } topo_type_t; 352c40d7343Scindi 353c40d7343Scindi extern nvlist_t *topo_prop_getprops(tnode_t *, int *err); 354c40d7343Scindi extern int topo_prop_getprop(tnode_t *, const char *, const char *, 355c40d7343Scindi nvlist_t *, nvlist_t **, int *); 356c40d7343Scindi extern int topo_prop_getpgrp(tnode_t *, const char *, nvlist_t **, int *); 357c40d7343Scindi extern int topo_prop_setprop(tnode_t *, const char *, nvlist_t *, 358c40d7343Scindi int, nvlist_t *, int *); 359c40d7343Scindi extern int topo_fmri_getprop(topo_hdl_t *, nvlist_t *, const char *, 360c40d7343Scindi const char *, nvlist_t *, nvlist_t **, int *); 361c40d7343Scindi extern int topo_fmri_getpgrp(topo_hdl_t *, nvlist_t *, const char *, 362c40d7343Scindi nvlist_t **, int *); 363c40d7343Scindi extern int topo_fmri_setprop(topo_hdl_t *, nvlist_t *, const char *, 364c40d7343Scindi nvlist_t *, int, nvlist_t *, int *); 365c40d7343Scindi 3660eb822a1Scindi /* Property node NVL names used in topo_prop_getprops */ 3677aec1d6eScindi #define TOPO_PROP_GROUP "property-group" 3687aec1d6eScindi #define TOPO_PROP_GROUP_NAME "property-group-name" 3690eb822a1Scindi #define TOPO_PROP_GROUP_DSTAB "property-group-data-stability" 3700eb822a1Scindi #define TOPO_PROP_GROUP_NSTAB "property-group-name-stability" 3710eb822a1Scindi #define TOPO_PROP_GROUP_VERSION "property-group-version" 3727aec1d6eScindi #define TOPO_PROP_VAL "property" 3737aec1d6eScindi #define TOPO_PROP_VAL_NAME "property-name" 3747aec1d6eScindi #define TOPO_PROP_VAL_VAL "property-value" 3750eb822a1Scindi #define TOPO_PROP_VAL_TYPE "property-type" 376c40d7343Scindi #define TOPO_PROP_FLAG "property-flag" 3770eb822a1Scindi 3780eb822a1Scindi /* 379c40d7343Scindi * ARGS list used in topo property methods 3800eb822a1Scindi */ 381c40d7343Scindi #define TOPO_PROP_ARGS "args" 382c40d7343Scindi #define TOPO_PROP_PARGS "private-args" 3837aec1d6eScindi 384c40d7343Scindi extern int topo_xml_print(topo_hdl_t *, FILE *, const char *scheme, int *); 385dd566498Svn83148 3867aec1d6eScindi extern void *topo_hdl_alloc(topo_hdl_t *, size_t); 3877aec1d6eScindi extern void *topo_hdl_zalloc(topo_hdl_t *, size_t); 3887aec1d6eScindi extern void topo_hdl_free(topo_hdl_t *, void *, size_t); 3897aec1d6eScindi extern int topo_hdl_nvalloc(topo_hdl_t *, nvlist_t **, uint_t); 3907aec1d6eScindi extern int topo_hdl_nvdup(topo_hdl_t *, nvlist_t *, nvlist_t **); 3917aec1d6eScindi extern char *topo_hdl_strdup(topo_hdl_t *, const char *); 3927aec1d6eScindi 393825ba0f2Srobj /* 394825ba0f2Srobj * Interfaces for converting sensor/indicator types, units, states, etc to 395825ba0f2Srobj * a string 396825ba0f2Srobj */ 397825ba0f2Srobj void topo_sensor_type_name(uint32_t type, char *buf, size_t len); 398825ba0f2Srobj void topo_sensor_units_name(uint8_t type, char *buf, size_t len); 399825ba0f2Srobj void topo_led_type_name(uint8_t type, char *buf, size_t len); 400825ba0f2Srobj void topo_led_state_name(uint8_t type, char *buf, size_t len); 401825ba0f2Srobj void topo_sensor_state_name(uint32_t sensor_type, uint8_t state, char *buf, 402825ba0f2Srobj size_t len); 403825ba0f2Srobj 404825ba0f2Srobj /* 405825ba0f2Srobj * Defines for standard properties for sensors and indicators 406825ba0f2Srobj */ 407825ba0f2Srobj #define TOPO_PGROUP_FACILITY "facility" 408825ba0f2Srobj 409825ba0f2Srobj #define TOPO_SENSOR_READING "reading" 410825ba0f2Srobj #define TOPO_SENSOR_STATE "state" 411825ba0f2Srobj #define TOPO_SENSOR_CLASS "sensor-class" 412825ba0f2Srobj #define TOPO_FACILITY_TYPE "type" 413825ba0f2Srobj #define TOPO_SENSOR_UNITS "units" 414825ba0f2Srobj #define TOPO_LED_MODE "mode" 415825ba0f2Srobj 416825ba0f2Srobj /* 417825ba0f2Srobj * Sensor Classes 418825ba0f2Srobj * 419825ba0f2Srobj * The "sensor-class" property in the "facility" propgroup on 420825ba0f2Srobj * facility nodes of type "sensor" should be set to one of these 421825ba0f2Srobj * two values. 422825ba0f2Srobj * 423825ba0f2Srobj * Threshold sensors provide an analog sensor reading via the 424825ba0f2Srobj * "reading" property in the facility propgroup. They will also 425825ba0f2Srobj * provide one or more discrete states via the "state" property 426825ba0f2Srobj * in the facility propgroup. 427825ba0f2Srobj * 428825ba0f2Srobj * Discrete sensors will not provide an analog reading by will 429825ba0f2Srobj * provide one or more discrete states via the "state" property 430825ba0f2Srobj * in the facility propgroup. 431825ba0f2Srobj */ 432825ba0f2Srobj #define TOPO_SENSOR_CLASS_THRESHOLD "threshold" 433825ba0f2Srobj #define TOPO_SENSOR_CLASS_DISCRETE "discrete" 434825ba0f2Srobj 435825ba0f2Srobj /* 436825ba0f2Srobj * Sensor unit types. We're using the unit types and corresponding 437825ba0f2Srobj * codes described in the IPMI 2.0 spec as a reference as it seems to be a 438825ba0f2Srobj * reasonably comprehensive list. This also simplifies the IPMI provider code 439825ba0f2Srobj * since the unit type codes will map exactly to what libtopo uses (so no 440825ba0f2Srobj * conversion necessary). 441825ba0f2Srobj */ 442825ba0f2Srobj typedef enum topo_sensor_unit { 443825ba0f2Srobj TOPO_SENSOR_UNITS_UNSPECIFIED = 0, 444825ba0f2Srobj TOPO_SENSOR_UNITS_DEGREES_C, 445825ba0f2Srobj TOPO_SENSOR_UNITS_DEGREES_F, 446825ba0f2Srobj TOPO_SENSOR_UNITS_DEGREES_K, 447825ba0f2Srobj TOPO_SENSOR_UNITS_VOLTS, 448825ba0f2Srobj TOPO_SENSOR_UNITS_AMPS, 449825ba0f2Srobj TOPO_SENSOR_UNITS_WATTS, 450825ba0f2Srobj TOPO_SENSOR_UNITS_JOULES, 451825ba0f2Srobj TOPO_SENSOR_UNITS_COULOMBS, 452825ba0f2Srobj TOPO_SENSOR_UNITS_VA, 453825ba0f2Srobj TOPO_SENSOR_UNITS_NITS, 454825ba0f2Srobj TOPO_SENSOR_UNITS_LUMEN, 455825ba0f2Srobj TOPO_SENSOR_UNITS_LUX, 456825ba0f2Srobj TOPO_SENSOR_UNITS_CANDELA, 457825ba0f2Srobj TOPO_SENSOR_UNITS_KPA, 458825ba0f2Srobj TOPO_SENSOR_UNITS_PSI, 459825ba0f2Srobj 460825ba0f2Srobj TOPO_SENSOR_UNITS_NEWTON, 461825ba0f2Srobj TOPO_SENSOR_UNITS_CFM, 462825ba0f2Srobj TOPO_SENSOR_UNITS_RPM, 463825ba0f2Srobj TOPO_SENSOR_UNITS_HZ, 464825ba0f2Srobj TOPO_SENSOR_UNITS_MICROSEC, 465825ba0f2Srobj TOPO_SENSOR_UNITS_MILLISEC, 466825ba0f2Srobj TOPO_SENSOR_UNITS_SECS, 467825ba0f2Srobj TOPO_SENSOR_UNITS_MIN, 468825ba0f2Srobj TOPO_SENSOR_UNITS_HOUR, 469825ba0f2Srobj TOPO_SENSOR_UNITS_DAY, 470825ba0f2Srobj TOPO_SENSOR_UNITS_WEEK, 471825ba0f2Srobj TOPO_SENSOR_UNITS_MIL, 472825ba0f2Srobj TOPO_SENSOR_UNITS_INCHES, 473825ba0f2Srobj TOPO_SENSOR_UNITS_FEET, 474825ba0f2Srobj TOPO_SENSOR_UNITS_CUB_INCH, 475825ba0f2Srobj TOPO_SENSOR_UNITS_CUB_FEET, 476825ba0f2Srobj 477825ba0f2Srobj TOPO_SENSOR_UNITS_MM, 478825ba0f2Srobj TOPO_SENSOR_UNITS_CM, 479825ba0f2Srobj TOPO_SENSOR_UNITS_METERS, 480825ba0f2Srobj TOPO_SENSOR_UNITS_CUB_CM, 481825ba0f2Srobj TOPO_SENSOR_UNITS_CUB_METER, 482825ba0f2Srobj TOPO_SENSOR_UNITS_LITERS, 483825ba0f2Srobj TOPO_SENSOR_UNITS_FLUID_OUNCE, 484825ba0f2Srobj TOPO_SENSOR_UNITS_RADIANS, 485825ba0f2Srobj TOPO_SENSOR_UNITS_STERADIANS, 486825ba0f2Srobj TOPO_SENSOR_UNITS_REVOLUTIONS, 487825ba0f2Srobj TOPO_SENSOR_UNITS_CYCLES, 488825ba0f2Srobj TOPO_SENSOR_UNITS_GRAVITIES, 489825ba0f2Srobj TOPO_SENSOR_UNITS_OUNCE, 490825ba0f2Srobj TOPO_SENSOR_UNITS_POUND, 491825ba0f2Srobj TOPO_SENSOR_UNITS_FOOT_POUND, 492825ba0f2Srobj TOPO_SENSOR_UNITS_OZ_INCH, 493825ba0f2Srobj 494825ba0f2Srobj TOPO_SENSOR_UNITS_GAUSS, 495825ba0f2Srobj TOPO_SENSOR_UNITS_GILBERTS, 496825ba0f2Srobj TOPO_SENSOR_UNITS_HENRY, 497825ba0f2Srobj TOPO_SENSOR_UNITS_MILHENRY, 498825ba0f2Srobj TOPO_SENSOR_UNITS_FARAD, 499825ba0f2Srobj TOPO_SENSOR_UNITS_MICROFARAD, 500825ba0f2Srobj TOPO_SENSOR_UNITS_OHMS, 501825ba0f2Srobj TOPO_SENSOR_UNITS_SIEMENS, 502825ba0f2Srobj TOPO_SENSOR_UNITS_MOLE, 503825ba0f2Srobj TOPO_SENSOR_UNITS_BECQUEREL, 504825ba0f2Srobj TOPO_SENSOR_UNITS_PPM, 505825ba0f2Srobj TOPO_SENSOR_UNITS_RESERVED1, 506825ba0f2Srobj TOPO_SENSOR_UNITS_DECIBELS, 507825ba0f2Srobj TOPO_SENSOR_UNITS_DBA, 508825ba0f2Srobj TOPO_SENSOR_UNITS_DBC, 509825ba0f2Srobj TOPO_SENSOR_UNITS_GRAY, 510825ba0f2Srobj 511825ba0f2Srobj TOPO_SENSOR_UNITS_SIEVERT, 512825ba0f2Srobj TOPO_SENSOR_UNITS_COLOR_TEMP_K, 513825ba0f2Srobj TOPO_SENSOR_UNITS_BIT, 514825ba0f2Srobj TOPO_SENSOR_UNITS_KILOBIT, 515825ba0f2Srobj TOPO_SENSOR_UNITS_MEGABIT, 516825ba0f2Srobj TOPO_SENSOR_UNITS_GIGABIT, 517825ba0f2Srobj TOPO_SENSOR_UNITS_BYTE, 518825ba0f2Srobj TOPO_SENSOR_UNITS_KILOBYTE, 519825ba0f2Srobj TOPO_SENSOR_UNITS_MEGABYTE, 520825ba0f2Srobj TOPO_SENSOR_UNITS_GIGABYTE, 521825ba0f2Srobj TOPO_SENSOR_UNITS_WORD, 522825ba0f2Srobj TOPO_SENSOR_UNITS_DWORD, 523825ba0f2Srobj TOPO_SENSOR_UNITS_QWORD, 524825ba0f2Srobj TOPO_SENSOR_UNITS_MEMLINE, 525825ba0f2Srobj TOPO_SENSOR_UNITS_HIT, 526825ba0f2Srobj TOPO_SENSOR_UNITS_MISS, 527825ba0f2Srobj 528825ba0f2Srobj TOPO_SENSOR_UNITS_RETRY, 529825ba0f2Srobj TOPO_SENSOR_UNITS_RESET, 530825ba0f2Srobj TOPO_SENSOR_UNITS_OVERFLOW, 531825ba0f2Srobj TOPO_SENSOR_UNITS_UNDERRUN, 532825ba0f2Srobj TOPO_SENSOR_UNITS_COLLISION, 533825ba0f2Srobj TOPO_SENSOR_UNITS_PACKETS, 534825ba0f2Srobj TOPO_SENSOR_UNITS_MESSAGES, 535825ba0f2Srobj TOPO_SENSOR_UNITS_CHARACTERS, 536825ba0f2Srobj TOPO_SENSOR_UNITS_ERROR, 537825ba0f2Srobj TOPO_SENSOR_UNITS_CE, 538825ba0f2Srobj TOPO_SENSOR_UNITS_UE, 539825ba0f2Srobj TOPO_SENSOR_UNITS_FATAL_ERROR, 540825ba0f2Srobj TOPO_SENSOR_UNITS_GRAMS 541825ba0f2Srobj } topo_sensor_unit_t; 542825ba0f2Srobj 543825ba0f2Srobj /* 544e5dcf7beSRobert Johnston * These defines are used by the topo_method_sensor_failure to indicate 545e5dcf7beSRobert Johnston * whether the source of a sensor failure is believed to be the result of an 546e5dcf7beSRobert Johnston * internal failure, external condition or unknown 547e5dcf7beSRobert Johnston */ 548e5dcf7beSRobert Johnston #define TOPO_SENSOR_ERRSRC_UNKNOWN 0 549e5dcf7beSRobert Johnston #define TOPO_SENSOR_ERRSRC_INTERNAL 1 550e5dcf7beSRobert Johnston #define TOPO_SENSOR_ERRSRC_EXTERNAL 2 551e5dcf7beSRobert Johnston 552e5dcf7beSRobert Johnston /* 553825ba0f2Srobj * Sensor Types amd the associated sensor-type-specific states 554825ba0f2Srobj * 555825ba0f2Srobj * These are used to decode the type and state properties in the facility 556825ba0f2Srobj * propgroup on facility nodes of type sensor. 557825ba0f2Srobj * 558825ba0f2Srobj * Again we're basically using the same defines as for IPMI as it's serves 559825ba0f2Srobj * as a good starting point and simplifies the IPMI provider code. Of course 560825ba0f2Srobj * other facility providers will need to convert from their native codes 561825ba0f2Srobj * to the topo code when they set the type and state properties. 562825ba0f2Srobj */ 563825ba0f2Srobj #define TOPO_SENSOR_TYPE_RESERVED 0x0000 564825ba0f2Srobj #define TOPO_SENSOR_TYPE_TEMP 0x0001 565825ba0f2Srobj #define TOPO_SENSOR_TYPE_VOLTAGE 0x0002 566825ba0f2Srobj #define TOPO_SENSOR_TYPE_CURRENT 0x0003 567825ba0f2Srobj #define TOPO_SENSOR_TYPE_FAN 0x0004 568825ba0f2Srobj #define TOPO_SENSOR_TYPE_PHYSICAL 0x0005 569825ba0f2Srobj 570825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_GENERAL 0x0001 571825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_BAY 0x0002 572825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_CARD 0x0004 573825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_PROCESSOR 0x0008 574825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_LAN 0x0010 575825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_DOCK 0x0020 576825ba0f2Srobj #define TOPO_SENSOR_STATE_PHYSICAL_FAN 0x0040 577825ba0f2Srobj 578825ba0f2Srobj #define TOPO_SENSOR_TYPE_PLATFORM 0x0006 579825ba0f2Srobj 580825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_SECURE 0x0001 581825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_USER_PASS 0x0002 582825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_SETUP_PASS 0x0004 583825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_NETWORK_PASS 0x0008 584825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_OTHER_PASS 0x0010 585825ba0f2Srobj #define TOPO_SENSOR_STATE_PLATFORM_OUT_OF_BAND 0x0020 586825ba0f2Srobj 587825ba0f2Srobj #define TOPO_SENSOR_TYPE_PROCESSOR 0x0007 588825ba0f2Srobj 589825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_IERR 0x0001 590825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_THERMAL 0x0002 591825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_FRB1 0x0004 592825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_FRB2 0x0008 593825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_FRB3 0x0010 594825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_CONFIG 0x0020 595825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_SMBIOS 0x0040 596825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_PRESENT 0x0080 597825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_DISABLED 0x0100 598825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_TERMINATOR 0x0200 599825ba0f2Srobj #define TOPO_SENSOR_STATE_PROCESSOR_THROTTLED 0x0400 600825ba0f2Srobj 601825ba0f2Srobj #define TOPO_SENSOR_TYPE_POWER_SUPPLY 0x0008 602825ba0f2Srobj 603825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_PRESENT 0x0001 604825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_FAILURE 0x0002 605825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_PREDFAIL 0x0004 606825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_LOST 0x0008 607825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_RANGE 0x0010 608825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_INPUT_RANGE_PRES 0x0020 609825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_SUPPLY_CONFIG_ERR 0x0040 610825ba0f2Srobj 611825ba0f2Srobj #define TOPO_SENSOR_TYPE_POWER_UNIT 0x0009 612825ba0f2Srobj 613825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_OFF 0x0001 614825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_CYCLE 0x0002 615825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_240_DOWN 0x0004 616825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_INTERLOCK_DOWN 0x0008 617825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_AC_LOST 0x0010 618825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_SOFT_FAILURE 0x0020 619825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_FAIL 0x0040 620825ba0f2Srobj #define TOPO_SENSOR_STATE_POWER_UNIT_PREDFAIL 0x0080 621825ba0f2Srobj 622825ba0f2Srobj #define TOPO_SENSOR_TYPE_COOLING 0x000A 623825ba0f2Srobj #define TOPO_SENSOR_TYPE_OTHER 0x000B 624825ba0f2Srobj 625825ba0f2Srobj #define TOPO_SENSOR_TYPE_MEMORY 0x000C 626825ba0f2Srobj 627825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_CE 0x0001 628825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_UE 0x0002 629825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_PARITY 0x0004 630825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_SCRUB_FAIL 0x0008 631825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_DISABLED 0x0010 632825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_CE_LOG_LIMIT 0x0020 633825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_PRESENT 0x0040 634825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_CONFIG_ERR 0x0080 635825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_SPARE 0x0100 636825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_THROTTLED 0x0200 637825ba0f2Srobj #define TOPO_SENSOR_STATE_MEMORY_OVERTEMP 0x0400 638825ba0f2Srobj 639825ba0f2Srobj #define TOPO_SENSOR_TYPE_BAY 0x000D 640825ba0f2Srobj 641825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_PRESENT 0x0001 642825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_FAULT 0x0002 643825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_PREDFAIL 0x0004 644825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_SPARE 0x0008 645825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_CHECK 0x0010 646825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_CRITICAL 0x0020 647825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_FAILED 0x0040 648825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_REBUILDING 0x0080 649825ba0f2Srobj #define TOPO_SENSOR_STATE_BAY_ABORTED 0x0100 650825ba0f2Srobj 651825ba0f2Srobj #define TOPO_SENSOR_TYPE_POST_RESIZE 0x000E 652825ba0f2Srobj 653825ba0f2Srobj #define TOPO_SENSOR_TYPE_FIRMWARE 0x000F 654825ba0f2Srobj 655825ba0f2Srobj #define TOPO_SENSOR_STATE_FIRMWARE_ERROR 0x0001 656825ba0f2Srobj #define TOPO_SENSOR_STATE_FIRMWARE_HANG 0x0002 657825ba0f2Srobj #define TOPO_SENSOR_STATE_FIRMWARE_PROGRESS 0x0004 658825ba0f2Srobj 659825ba0f2Srobj #define TOPO_SENSOR_TYPE_EVENT_LOG 0x0010 660825ba0f2Srobj 661825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_CE 0x0001 662825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_TYPE 0x0002 663825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_RESET 0x0004 664825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_ALL 0x0008 665825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_FULL 0x0010 666825ba0f2Srobj #define TOPO_SENSOR_STATE_EVENT_LOG_ALMOST_FULL 0x0020 667825ba0f2Srobj 668825ba0f2Srobj #define TOPO_SENSOR_TYPE_WATCHDOG1 0x0011 669825ba0f2Srobj 670825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_BIOS_RESET 0x0001 671825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_OS_RESET 0x0002 672825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_OS_SHUTDOWN 0x0004 673825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_OS_PWR_DOWN 0x0008 674825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_OS_PWR_CYCLE 0x0010 675825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_OS_NMI_DIAG 0x0020 676825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_EXPIRED 0x0040 677825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG_PRE_TIMEOUT_INT 0x0080 678825ba0f2Srobj 679825ba0f2Srobj #define TOPO_SENSOR_TYPE_SYSTEM 0x0012 680825ba0f2Srobj 681825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_RECONF 0x0001 682825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_BOOT 0x0002 683825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_UNKNOWN_HW_FAILURE 0x0004 684825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_AUX_LOG_UPDATED 0x0008 685825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_PEF_ACTION 0x0010 686825ba0f2Srobj #define TOPO_SENSOR_STATE_SYSTEM_TIMETAMP_CLOCKSYNC 0x0020 687825ba0f2Srobj 688825ba0f2Srobj #define TOPO_SENSOR_TYPE_CRITICAL 0x0013 689825ba0f2Srobj 690825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_EXT_NMI 0x0001 691825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_BUS_TIMEOUT 0x0002 692825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_IO_NMI 0x0004 693825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_SW_NMI 0x0008 694825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_PCI_PERR 0x0010 695825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_PCI_SERR 0x0020 696825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_EISA_FAILSAFE 0x0040 697825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_BUS_CE 0x0080 698825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_BUS_UE 0x0100 699825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_FATAL_NMI 0x0200 700825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_BUS_FATAL_ERR 0x0400 701825ba0f2Srobj #define TOPO_SENSOR_STATE_CRITICAL_BUS_DEGRADED 0x0800 702825ba0f2Srobj 703825ba0f2Srobj #define TOPO_SENSOR_TYPE_BUTTON 0x0014 704825ba0f2Srobj 705825ba0f2Srobj #define TOPO_SENSOR_STATE_BUTTON_PWR 0x0001 706825ba0f2Srobj #define TOPO_SENSOR_STATE_BUTTON_SLEEP 0x0002 707825ba0f2Srobj #define TOPO_SENSOR_STATE_BUTTON_RESET 0x0004 708825ba0f2Srobj #define TOPO_SENSOR_STATE_BUTTON_FRU_LATCH 0x0008 709825ba0f2Srobj #define TOPO_SENSOR_STATE_BUTTON_FRU_SERVICE 0x0010 710825ba0f2Srobj 711825ba0f2Srobj #define TOPO_SENSOR_TYPE_MODULE 0x0015 712825ba0f2Srobj #define TOPO_SENSOR_TYPE_MICROCONTROLLER 0x0016 713825ba0f2Srobj #define TOPO_SENSOR_TYPE_CARD 0x0017 714825ba0f2Srobj #define TOPO_SENSOR_TYPE_CHASSIS 0x0018 715825ba0f2Srobj 716825ba0f2Srobj #define TOPO_SENSOR_TYPE_CHIPSET 0x0019 717825ba0f2Srobj 718825ba0f2Srobj #define TOPO_SENSOR_STATE_CHIPSET_PWR_CTL_FAIL 0x0001 719825ba0f2Srobj 720825ba0f2Srobj #define TOPO_SENSOR_TYPE_FRU 0x001A 721825ba0f2Srobj 722825ba0f2Srobj #define TOPO_SENSOR_TYPE_CABLE 0x001B 723825ba0f2Srobj 724825ba0f2Srobj #define TOPO_SENSOR_STATE_CABLE_CONNECTED 0x0001 725825ba0f2Srobj #define TOPO_SENSOR_STATE_CABLE_CONFIG_ERR 0x0002 726825ba0f2Srobj 727825ba0f2Srobj #define TOPO_SENSOR_TYPE_TERMINATOR 0x001C 728825ba0f2Srobj 729825ba0f2Srobj #define TOPO_SENSOR_TYPE_BOOT_STATE 0x001D 730825ba0f2Srobj 731825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_PWR_UP 0x0001 732825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_HARD_RESET 0x0002 733825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_BIOS_WARM_RESET 0x0004 734825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_PXE_BOOT 0x0008 735825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_DIAG_BOOT 0x0010 736825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_OS_HARD_RESET 0x0020 737825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_OS_WARM_RESET 0x0040 738825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_STATE_SYS_RESTART 0x0080 739825ba0f2Srobj 740825ba0f2Srobj #define TOPO_SENSOR_TYPE_BOOT_ERROR 0x001E 741825ba0f2Srobj 742825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_ERROR_NOMEDIA 0x0001 743825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_ERROR_NON_BOOTABLE_DISK 0x0002 744825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_ERROR_NO_PXE_SERVER 0x0004 745825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_ERROR_INV_BOOT_SECT 0x0008 746825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_ERROR_USR_SELECT_TIMEOUT 0x0010 747825ba0f2Srobj 748825ba0f2Srobj #define TOPO_SENSOR_TYPE_BOOT_OS 0x001F 749825ba0f2Srobj 750825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_A_DRV_BOOT_COMPLETE 0x0001 751825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_C_DRV_BOOT_COMPLETE 0x0002 752825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_PXE_BOOT_COMPLETE 0x0004 753825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_DIAG_BOOT_COMPLETE 0x0008 754825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_CDROM_BOOT_COMPLETE 0x0010 755825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_ROM_BOOT_COMPLETE 0x0020 756825ba0f2Srobj #define TOPO_SENSOR_STATE_BOOT_OS_UNSPEC_BOOT_COMPLETE 0x0040 757825ba0f2Srobj 758825ba0f2Srobj #define TOPO_SENSOR_TYPE_OS_SHUTDOWN 0x0020 759825ba0f2Srobj 760825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_SHUTDOWN_LOADING 0x0001 761825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_SHUTDOWN_CRASH 0x0002 762825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_STOP_GRACEFUL 0x0004 763825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_SHUTDOWN_GRACEFUL 0x0008 764825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_SHUTDOWN_PEF 0x0010 765825ba0f2Srobj #define TOPO_SENSOR_STATE_OS_SHUTDOWN_BMC 0x0020 766825ba0f2Srobj 767825ba0f2Srobj #define TOPO_SENSOR_TYPE_SLOT 0x0021 768825ba0f2Srobj 769825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_FAULT_ASSERTED 0x0001 770825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_IDENTIFY_ASSERTED 0x0002 771825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_CONNECTED 0x0004 772825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_INSTALL_READY 0x0008 773825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_REMOVE_READY 0x0010 774825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_PWR_OFF 0x0020 775825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_REMOVED 0x0040 776825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_INTERLOCK_ASSERTED 0x0080 777825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_DISABLED 0x0100 778825ba0f2Srobj #define TOPO_SENSOR_STATE_SLOT_SPARE_DEVICE 0x0200 779825ba0f2Srobj 780825ba0f2Srobj #define TOPO_SENSOR_TYPE_ACPI 0x0022 781825ba0f2Srobj 782825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S0_G0 0x0001 783825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S1 0x0002 784825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S2 0x0004 785825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S3 0x0008 786825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S4 0x0010 787825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S5_G2_SOFT_OFF 0x0020 788825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S4_S5_SOFT_OFF 0x0040 789825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSATTE_G3_MECH_OFF 0x0080 790825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S1_S2_S3_SLEEP 0x0100 791825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_G1_SLEEP 0x0200 792825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_S5_OVERRIDE 0x0400 793825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_LEGACY_ON 0x0800 794825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_LEGACY_OFF 0x1000 795825ba0f2Srobj #define TOPO_SENSOR_STATE_ACPI_PSTATE_UNKNOWN 0x2000 796825ba0f2Srobj 797825ba0f2Srobj #define TOPO_SENSOR_TYPE_WATCHDOG2 0x0023 798825ba0f2Srobj 799825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_EXPIRED 0x0001 800825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_HARD_RESET 0x0002 801825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_PWR_DOWN 0x0004 802825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_PWR_CYCLE 0x0008 803825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED1 0x0010 804825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED2 0x0020 805825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED3 0x0040 806825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_RESERVED4 0x0080 807825ba0f2Srobj #define TOPO_SENSOR_STATE_WATCHDOG2_TIMEOUT_INT 0x0100 808825ba0f2Srobj 809825ba0f2Srobj #define TOPO_SENSOR_TYPE_ALERT 0x0024 810825ba0f2Srobj 811825ba0f2Srobj #define TOPO_SENSOR_STATE_ALERT_PLAT_PAGE 0x0001 812825ba0f2Srobj #define TOPO_SENSOR_STATE_ALERT_PLAT_LAN_ALERT 0x0002 813825ba0f2Srobj #define TOPO_SENSOR_STATE_ALERT_PLAT_EVT_TRAP 0x0004 814825ba0f2Srobj #define TOPO_SENSOR_STATE_ALERT_PLAT_SNMP_TRAP 0x0008 815825ba0f2Srobj 816825ba0f2Srobj #define TOPO_SENSOR_TYPE_PRESENCE 0x0025 817825ba0f2Srobj 818825ba0f2Srobj #define TOPO_SENSOR_STATE_PRESENCE_PRESENT 0x0001 819825ba0f2Srobj #define TOPO_SENSOR_STATE_PRESENCE_ABSENT 0x0002 820825ba0f2Srobj #define TOPO_SENSOR_STATE_PRESENCE_DISABLED 0x0004 821825ba0f2Srobj 822825ba0f2Srobj #define TOPO_SENSOR_TYPE_ASIC 0x0026 823825ba0f2Srobj 824825ba0f2Srobj #define TOPO_SENSOR_TYPE_LAN 0x0027 825825ba0f2Srobj 826825ba0f2Srobj #define TOPO_SENSOR_STATE_LAN_HEARTBEAT_LOST 0x0001 827825ba0f2Srobj #define TOPO_SENSOR_STATE_LAN_HEARTBEAT 0x0002 828825ba0f2Srobj 829825ba0f2Srobj #define TOPO_SENSOR_TYPE_HEALTH 0x0028 830825ba0f2Srobj 831825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_SENSOR_ACC_DEGRADED 0x0001 832825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_CNTLR_ACC_DEGRADED 0x0002 833825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_CNTLR_OFFLINE 0x0004 834825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_CNTLR_UNAVAIL 0x0008 835825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_SENSOR_FAILURE 0x0010 836825ba0f2Srobj #define TOPO_SENSOR_STATE_HEALTH_FRU_FAILURE 0x0020 837825ba0f2Srobj 838825ba0f2Srobj #define TOPO_SENSOR_TYPE_BATTERY 0x0029 839825ba0f2Srobj 840825ba0f2Srobj #define TOPO_SENSOR_STATE_BATTERY_LOW 0x0001 841825ba0f2Srobj #define TOPO_SENSOR_STATE_BATTERY_FAILED 0x0002 842825ba0f2Srobj #define TOPO_SENSOR_STATE_BATTERY_PRESENCE 0x0004 843825ba0f2Srobj 844825ba0f2Srobj #define TOPO_SENSOR_TYPE_AUDIT 0x002A 845825ba0f2Srobj 846825ba0f2Srobj #define TOPO_SENSOR_STATE_AUDIT_SESSION_ACTIVATED 0x0001 847825ba0f2Srobj #define TOPO_SENSOR_STATE_AUDIT_SESSION_DEACTIVATED 0x0002 848825ba0f2Srobj 849825ba0f2Srobj #define TOPO_SENSOR_TYPE_VERSION 0x002B 850825ba0f2Srobj 851825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_HW_CHANGE 0x0001 852825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_SW_CHANGE 0x0002 853825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_HW_INCOMPATIBLE 0x0004 854825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_SW_INCOMPATIBLE 0x0008 855825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_HW_INVAL 0x0010 856825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_SW_INVAL 0x0020 857825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_HW_CHANGE_SUCCESS 0x0040 858825ba0f2Srobj #define TOPO_SENSOR_STATE_VERSION_SW_CHANGE_SUCCESS 0x0080 859825ba0f2Srobj 860825ba0f2Srobj #define TOPO_SENSOR_TYPE_FRU_STATE 0x002C 861825ba0f2Srobj 862825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_NOT_INSTALLED 0x0001 863825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_INACTIVE 0x0002 864825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_ACT_REQ 0x0004 865825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_ACT_INPROGRESS 0x0008 866825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_ACTIVE 0x0010 867825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_DEACT_REQ 0x0020 868825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_DEACT_INPROGRESS 0x0040 869825ba0f2Srobj #define TOPO_SENSOR_STATE_FRU_STATE_COMM_LOST 0x0080 870825ba0f2Srobj 871825ba0f2Srobj /* 872825ba0f2Srobj * We simplify the IPMI sensor type code defines by combining the generic 873825ba0f2Srobj * and sensor-specific codes into a single range. Because there's overlap 874825ba0f2Srobj * between the two ranges we offset the generic type codes by 0x0100 875825ba0f2Srobj * which allows ample room in the hole for future expansion of the table to 876825ba0f2Srobj * accomodate either additions to the IPMI spec or to support new sensor types 877825ba0f2Srobj * for alternate provider modules. 878825ba0f2Srobj */ 879825ba0f2Srobj #define TOPO_SENSOR_TYPE_THRESHOLD_STATE 0x0101 880825ba0f2Srobj 8810b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_LOWER_NONCRIT 0x0001 8820b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_LOWER_CRIT 0x0002 8830b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_LOWER_NONREC 0x0004 8840b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_UPPER_NONCRIT 0x0008 8850b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_UPPER_CRIT 0x0010 8860b1b4412SEric Schrock #define TOPO_SENSOR_STATE_THRESH_UPPER_NONREC 0x0020 887825ba0f2Srobj 888825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_USAGE 0x0102 889825ba0f2Srobj 890825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_USAGE_IDLE 0x0001 891825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_USAGE_ACTIVE 0x0002 892825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_USAGE_BUSY 0x0004 893825ba0f2Srobj 894825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_STATE 0x0103 895825ba0f2Srobj 896825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATE_DEASSERTED 0x0001 897825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATE_ASSERTED 0x0002 898825ba0f2Srobj 899825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_PREDFAIL 0x0104 900825ba0f2Srobj 901825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PREDFAIL_DEASSERTED 0x0001 902825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PREDFAIL_ASSERTED 0x0002 903825ba0f2Srobj 904825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_LIMIT 0x0105 905825ba0f2Srobj 906825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_LIMIT_NOT_EXCEEDED 0x0001 907825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_LIMIT_EXCEEDED 0x0002 908825ba0f2Srobj 909825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_PERFORMANCE 0x0106 910825ba0f2Srobj 911825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PERFORMANCE_MET 0x0001 912825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PERFORMANCE_LAGS 0x0002 913825ba0f2Srobj 914825ba0f2Srobj #define TOPO_SENSOR_TYPE_SEVERITY 0x0107 915825ba0f2Srobj 916825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_OK 0x0001 917825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_NONCRIT_GOING_HIGH 0x0002 918825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_CRIT_GOING_HIGH 0x0004 919825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_NONREC_GOING_HIGH 0x0008 920825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_NONCRIT_GOING_LOW 0x0010 921825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_CRIT_GOING_LOW 0x0020 922825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_NONREC_GOING_LOW 0x0020 923825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_MONITOR 0x0040 924825ba0f2Srobj #define TOPO_SENSOR_STATE_SEVERITY_INFORMATIONAL 0x0080 925825ba0f2Srobj 926825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_PRESENCE 0x0108 927825ba0f2Srobj 928825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PRESENCE_DEASSERTED 0x0001 929825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_PRESENCE_ASSERTED 0x0002 930825ba0f2Srobj 931825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_AVAILABILITY 0x0109 932825ba0f2Srobj 933825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_AVAIL_DEASSERTED 0x0001 934825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_AVAIL_ASSERTED 0x0002 935825ba0f2Srobj 936825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_STATUS 0x010A 937825ba0f2Srobj 938825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_RUNNING 0x0001 939825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_IN_TEST 0x0002 940825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_POWER_OFF 0x0004 941825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_ONLINE 0x0008 942825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_OFFLINE 0x0010 943825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_OFF_DUTY 0x0020 944825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_DEGRADED 0x0040 945825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_POWER_SAVE 0x0080 946825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_STATUS_INSTALL_ERR 0x0100 947825ba0f2Srobj 948825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_REDUNDANCY 0x010B 949825ba0f2Srobj 950825ba0f2Srobj /* 951825ba0f2Srobj * ACPI power state 952825ba0f2Srobj */ 953825ba0f2Srobj #define TOPO_SENSOR_TYPE_GENERIC_ACPI 0x010C 954825ba0f2Srobj 955825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_ACPI_D0 0x0001 956825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_ACPI_D1 0x0002 957825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_ACPI_D2 0x0004 958825ba0f2Srobj #define TOPO_SENSOR_STATE_GENERIC_ACPI_D3 0x0008 959825ba0f2Srobj 960825ba0f2Srobj /* 961e5dcf7beSRobert Johnston * These sensor types don't exist in the IPMI spec, but allow consumers to 962e5dcf7beSRobert Johnston * associate discrete sensors with component failure. The 'ok' sensor is the 963e5dcf7beSRobert Johnston * inverse of the 'failure' sensor. Note that the values intentionally mimic 964e5dcf7beSRobert Johnston * TOPO_SENSOR_TYPE_GENERIC_STATE, so that you can use existing IPMI sensors 965e5dcf7beSRobert Johnston * but just change the type to get semantically meaningful behavior. 966e5dcf7beSRobert Johnston */ 967e5dcf7beSRobert Johnston #define TOPO_SENSOR_TYPE_GENERIC_FAILURE 0x010D 968e5dcf7beSRobert Johnston 969e5dcf7beSRobert Johnston #define TOPO_SENSOR_STATE_GENERIC_FAIL_DEASSERTED 0x0001 970e5dcf7beSRobert Johnston #define TOPO_SENSOR_STATE_GENERIC_FAIL_NONRECOV 0x0002 971e5dcf7beSRobert Johnston #define TOPO_SENSOR_STATE_GENERIC_FAIL_CRITICAL 0x0004 972e5dcf7beSRobert Johnston 973e5dcf7beSRobert Johnston #define TOPO_SENSOR_TYPE_GENERIC_OK 0x010E 974e5dcf7beSRobert Johnston 975e5dcf7beSRobert Johnston #define TOPO_SENSOR_STATE_GENERIC_OK_DEASSERTED 0x0001 976e5dcf7beSRobert Johnston #define TOPO_SENSOR_STATE_GENERIC_OK_ASSERTED 0x0002 977e5dcf7beSRobert Johnston 978e5dcf7beSRobert Johnston /* 979825ba0f2Srobj * Indicator modes and types 980825ba0f2Srobj */ 981825ba0f2Srobj typedef enum topo_led_state { 982825ba0f2Srobj TOPO_LED_STATE_OFF = 0, 983825ba0f2Srobj TOPO_LED_STATE_ON 984825ba0f2Srobj } topo_led_state_t; 985825ba0f2Srobj 986e5dcf7beSRobert Johnston #define TOPO_FAC_TYPE_ANY 0xFFFFFFFF 987e5dcf7beSRobert Johnston 988825ba0f2Srobj /* 989825ba0f2Srobj * This list is limited to the set of LED's that we're likely to manage through 990825ba0f2Srobj * FMA. Thus is does not include things like power or activity LED's 991825ba0f2Srobj */ 992825ba0f2Srobj typedef enum topo_led_type { 993825ba0f2Srobj TOPO_LED_TYPE_SERVICE = 0, 994825ba0f2Srobj TOPO_LED_TYPE_LOCATE, 995825ba0f2Srobj TOPO_LED_TYPE_OK2RM, 996825ba0f2Srobj TOPO_LED_TYPE_PRESENT 997825ba0f2Srobj } topo_led_type_t; 998825ba0f2Srobj 999825ba0f2Srobj 10007aec1d6eScindi #ifdef __cplusplus 10017aec1d6eScindi } 10027aec1d6eScindi #endif 10037aec1d6eScindi 10047aec1d6eScindi #endif /* _LIBTOPO_H */ 1005