diff --git a/sys/dev/acpi/aiboost.c b/sys/dev/acpi/aiboost.c index eef4a50cc29d..e1da41e3634f 100644 --- a/sys/dev/acpi/aiboost.c +++ b/sys/dev/acpi/aiboost.c @@ -1,4 +1,4 @@ -/* $NetBSD: aiboost.c,v 1.7 2007/07/01 20:45:10 xtraeme Exp $ */ +/* $NetBSD: aiboost.c,v 1.8 2007/07/02 10:06:58 xtraeme Exp $ */ /*- * Copyright (c) 2007 Juan Romero Pardines @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aiboost.c,v 1.7 2007/07/01 20:45:10 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aiboost.c,v 1.8 2007/07/02 10:06:58 xtraeme Exp $"); #include #include @@ -211,26 +211,32 @@ aiboost_refresh_sensors(struct aiboost_softc *sc, envsys_data_t *edata) case ENVSYS_STEMP: /* Temperatures */ val = aiboost_get_value(h, "RTMP", sc->sc_aitemp->elem[i].id); + if (val == -1) + edata->state = ENVSYS_SINVALID; /* envsys(9) wants mK... convert from Celsius. */ - sc->sc_data[i].value_cur = val * 100000 + 273150000; + edata->value_cur = val * 100000 + 273150000; DPRINTF(("%s: temp[%d] value_cur=%d val=%d j=%d\n", __func__, - i, sc->sc_data[i].value_cur, val, j)); + i, edata->value_cur, val, j)); break; case ENVSYS_SVOLTS_DC: /* Voltages */ j = i - sc->sc_aitemp->num; val = aiboost_get_value(h, "RVLT", sc->sc_aivolt->elem[j].id); + if (val == -1) + edata->state = ENVSYS_SINVALID; /* envsys(4) wants mV... */ - sc->sc_data[i].value_cur = val * 10000; - sc->sc_data[i].value_cur /= 10; + edata->value_cur = val * 10000; + edata->value_cur /= 10; DPRINTF(("%s: volt[%d] value_cur=%d val=%d j=%d\n", __func__, - i, sc->sc_data[i].value_cur, val, j)); + i, edata->value_cur, val, j)); break; case ENVSYS_SFANRPM: /* Fans */ j = i - (sc->sc_aitemp->num + sc->sc_aivolt->num); val = aiboost_get_value(h, "RFAN", sc->sc_aifan->elem[j].id); - sc->sc_data[i].value_cur = val; + if (val == -1) + edata->state = ENVSYS_SINVALID; + edata->value_cur = val; DPRINTF(("%s: fan[%d] val=%d j=%d\n", __func__, i, val, j)); break; }