envmon.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ENVMON_H
#define _SYS_ENVMON_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* environmental monitoring ioctls
*
* there are two types of environmental monitor:
* sensors - these provide a value for the environmental property
* indicators - these provide a status of "within range" or "out of range"
*
* for any given environmental property, a particular platform is likely
* to support either a sensor or an indicator
*
* a reserved value is used to signify that a particular sensor value is
* not available
*/
/* reserved values to signify "value unavailable" */
/*
* The ability of a sensor or indicator to deliver a value is encapsulated
* in the sensor_status field.
* The following sensor_status bit fields are defined
*/
#define ENVMON_SENSOR_OK 0 /* this one's a value */
#define ENVMON_NOT_PRESENT 1
/*
* Some drivers may implement the older lomv interface in addition to
* the ioctls defined here. To avoid a clash with values from older
* interfaces, ioctls defined here start high in the available range.
*/
#define ENVMON_BASE 200
#define ENVMONIOCGETALARM \
/* field length for text identifiers */
#define ENVMON_MAXNAMELEN 32
typedef struct {
char name[ENVMON_MAXNAMELEN];
/*
* Some structures include threshold fields.
* Where a particular threshold is not defined for a given sensor,
* the reserved value ENVMON_VAL_UNAVAILABLE is returned.
*/
typedef struct {
/*
* id identifies the fru to be accessed.
* next_id returns the id for the next component of the type implied by
* the ioctl command. If there are no more frus in this sequence,
* next_id is set to an empty string.
* If id is set to an empty string on entry, next_id returns the first id.
* In this case, sensor_status will be returned as ENVMON_NOT_PRESENT.
*/
typedef struct {
typedef struct {
typedef struct {
char units[ENVMON_MAXNAMELEN];
} envmon_fan_t;
/*
* Values for led_state
*/
#define ENVMON_LED_OFF 0
#define ENVMON_LED_ON 1
#define ENVMON_LED_BLINKING 2
#define ENVMON_LED_FLASHING 3
/*
* Values for the hue of the leds
*/
#define ENVMON_LED_CLR_ANY 0
#define ENVMON_LED_CLR_WHITE 1
#define ENVMON_LED_CLR_BLUE 2
#define ENVMON_LED_CLR_GREEN 3
#define ENVMON_LED_CLR_AMBER 4
#define ENVMON_LED_CLR_RED 5
typedef struct {
typedef struct {
/*
* Values for alarm_state
*/
#define ENVMON_ALARM_OFF 0
#define ENVMON_ALARM_ON 1
typedef struct {
typedef struct {
/*
* Values for fru_status
*/
#define ENVMON_FRU_NOT_PRESENT 0
#define ENVMON_FRU_PRESENT 1
#define ENVMON_FRU_FAULT 2
typedef struct {
} envmon_hpu_t;
/*
* env_sysinto_t is used to return limits on various item types
*/
typedef struct {
/*
* envmon_keysw_t is used to return the current value of the
* keyswitch (if fitted)
*/
typedef enum envmon_keysw_pos {
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ENVMON_H */