summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2005-08-03 14:53:40 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2005-08-03 14:53:40 +0000
commit45b8c7e0a6241c8b459ae95e38165a304a6557b8 (patch)
treef7d333e155e167b1d8cdf4b6cd86352068d8dce8 /sys
parent3148a1f1051c1848a96e84280a1ff8edb23bcdbf (diff)
extend the sensors framework to allow it to report the state of the
sensor, not just its value. ok henning@ marco@ deraadt@ beck@ fixes and tweaks grange@
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/sensors.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/sys/sensors.h b/sys/sys/sensors.h
index 0c68887c0aa..48d37af9394 100644
--- a/sys/sys/sensors.h
+++ b/sys/sys/sensors.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.h,v 1.5 2005/04/08 05:01:47 jolan Exp $ */
+/* $OpenBSD: sensors.h,v 1.6 2005/08/03 14:53:39 dlg Exp $ */
/*
* Copyright (c) 2003, 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -43,6 +43,15 @@ enum sensor_type {
SENSOR_INTEGER /* generic integer value */
};
+/* Sensor states */
+enum sensor_status {
+ SENSOR_S_UNSPEC, /* status is unspecified */
+ SENSOR_S_OK, /* status is ok */
+ SENSOR_S_WARN, /* status is warning */
+ SENSOR_S_CRIT, /* status is critical */
+ SENSOR_S_UNKNOWN /* status is unknown */
+};
+
/* Sensor data */
struct sensor {
SLIST_ENTRY(sensor) list;
@@ -52,8 +61,10 @@ struct sensor {
char desc[32]; /* sensor description */
int64_t value; /* current value */
u_int rfact; /* resistor factor */
+ enum sensor_status status; /* sensor status */
int flags; /* sensor flags */
#define SENSOR_FINVALID 0x0001 /* sensor is invalid */
+#define SENSOR_FUNKNOWN 0x0002 /* sensor value is unknown */
};
SLIST_HEAD(sensors_head, sensor);