diff options
author | 2006-10-11 13:06:35 +0000 | |
---|---|---|
committer | 2006-10-11 13:06:35 +0000 | |
commit | ee8d01dfeb121249ee4a8b4c8766dce4d40f820c (patch) | |
tree | 3c1634d20066ff49d7b5cc165c24468eb2f5e396 | |
parent | a little macro cleanup; (diff) | |
download | wireguard-openbsd-ee8d01dfeb121249ee4a8b4c8766dce4d40f820c.tar.xz wireguard-openbsd-ee8d01dfeb121249ee4a8b4c8766dce4d40f820c.zip |
Make the timedelta sensor appear right when a device is plugged-in, with a
status of SENSOR_S_UNKNOWN. Do not set the SENSOR_FINVALID bit, sysctl
hw.sensors does not list sensors with this flags set and we want to the sensor
when the device is present.
ok henning
-rw-r--r-- | sys/dev/usb/udcf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c index 7a0f78045a5..9e9070fe9c2 100644 --- a/sys/dev/usb/udcf.c +++ b/sys/dev/usb/udcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udcf.c,v 1.16 2006/06/23 06:27:11 miod Exp $ */ +/* $OpenBSD: udcf.c,v 1.17 2006/10/11 13:06:35 mbalmer Exp $ */ /* * Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org> @@ -178,7 +178,9 @@ USB_ATTACH(udcf) sizeof(sc->sc_sensor.device)); sc->sc_sensor.type = SENSOR_TIMEDELTA; sc->sc_sensor.status = SENSOR_S_UNKNOWN; - sc->sc_sensor.flags = SENSOR_FINVALID; + sc->sc_sensor.value = 0LL; + sc->sc_sensor.flags = 0; + strlcpy(sc->sc_sensor.desc, "Unknown", sizeof(sc->sc_sensor.desc)); sensor_add(&sc->sc_sensor); /* Prepare the USB request to probe the value */ @@ -402,7 +404,6 @@ udcf_probe(void *xsc) clockname[CLOCK_HBG] : clockname[CLOCK_DCF77], sizeof(sc->sc_sensor.desc)); - sc->sc_sensor.flags &= ~SENSOR_FINVALID; } sc->sc_sensor.status = SENSOR_S_OK; |