summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2005-10-19 22:01:09 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2005-10-19 22:01:09 +0000
commita8d6988ccf3a13482fdf1554583df4214ca7839f (patch)
treee449a34abc2323e79e5a0912226480517c6f9d69 /sys/dev
parentc8bf008bd0a8f85a317592a5e972fbc7e5a8a1ab (diff)
Changed order of reading sensor vs sensor status, failed sensors had invalid
reading ok marco@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ipmi.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index a55b1d6cf97..836dad7e03b 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.9 2005/10/19 21:52:30 jordan Exp $ */
+/* $OpenBSD: ipmi.c,v 1.10 2005/10/19 22:01:08 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -1254,6 +1254,25 @@ ipmi_sensor_status(struct ipmi_softc *sc, struct ipmi_sensor *psensor,
if (etype == 0x6F)
etype = (etype << 8) + psensor->stype;
+ /* Get reading of sensor */
+ switch (psensor->i_sensor.type) {
+ case SENSOR_TEMP:
+ psensor->i_sensor.value = ipmi_convert(reading[0], s1, 6);
+ psensor->i_sensor.value += 273150000;
+ break;
+
+ case SENSOR_VOLTS_DC:
+ psensor->i_sensor.value = ipmi_convert(reading[0], s1, 6);
+ break;
+
+ case SENSOR_FANRPM:
+ psensor->i_sensor.value = ipmi_convert(reading[0], s1, 0);
+ break;
+ default:
+ break;
+ }
+
+ /* Return Sensor Status */
switch(etype) {
case 0x01: /* threshold */
data[0] = psensor->i_num;
@@ -1301,24 +1320,6 @@ ipmi_sensor_status(struct ipmi_softc *sc, struct ipmi_sensor *psensor,
break;
}
- /* Get reading of sensor */
- switch (psensor->i_sensor.type) {
- case SENSOR_TEMP:
- psensor->i_sensor.value = ipmi_convert(reading[0], s1, 6);
- psensor->i_sensor.value += 273150000;
- break;
-
- case SENSOR_VOLTS_DC:
- psensor->i_sensor.value = ipmi_convert(reading[0], s1, 6);
- break;
-
- case SENSOR_FANRPM:
- psensor->i_sensor.value = ipmi_convert(reading[0], s1, 0);
- break;
- default:
- break;
- }
-
return (SENSOR_S_OK);
}