summaryrefslogtreecommitdiff
path: root/sys/dev/ipmi.c
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2016-01-11 12:52:25 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2016-01-11 12:52:25 +0000
commit7cb87dd12e66a912d6a822dcf862408820fec278 (patch)
treeeeb2ea352140948901150fbe825fd6fb96740cd6 /sys/dev/ipmi.c
parentc6f4754f32e80b08533addb16e24ca9b7056ec6d (diff)
Read values from disabled sensors if possible. From jmatthew@.
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r--sys/dev/ipmi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 9b8f26f96ec..a6656079be7 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.81 2016/01/10 14:44:09 uebayasi Exp $ */
+/* $OpenBSD: ipmi.c,v 1.82 2016/01/11 12:52:24 uebayasi Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -112,6 +112,7 @@ int ipmi_enabled = 0;
#define IPMI_ENTITY_PWRSUPPLY 0x0A
#define IPMI_INVALID_SENSOR (1L << 5)
+#define IPMI_DISABLED_SENSOR (1L << 6)
#define IPMI_SDR_TYPEFULL 1
#define IPMI_SDR_TYPECOMPACT 2
@@ -1383,10 +1384,9 @@ read_sensor(struct ipmi_softc *sc, struct ipmi_sensor *psensor)
dbg_printf(10, "values=%.2x %.2x %.2x %.2x %s\n",
data[0],data[1],data[2],data[3], psensor->i_sensor.desc);
psensor->i_sensor.flags &= ~SENSOR_FINVALID;
- if (data[1] & IPMI_INVALID_SENSOR) {
- /* Check if sensor is valid */
+ if ((data[1] & IPMI_INVALID_SENSOR) ||
+ ((data[1] & IPMI_DISABLED_SENSOR) == 0 && data[0] == 0))
psensor->i_sensor.flags |= SENSOR_FINVALID;
- }
psensor->i_sensor.status = ipmi_sensor_status(sc, psensor, data);
rv = 0;
done: