summaryrefslogtreecommitdiff
path: root/sys/dev/usb/udcf.c
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2006-06-04 09:52:41 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2006-06-04 09:52:41 +0000
commit66ef516e5404c5db094b9fa2607166e65bd43556 (patch)
tree5b4375dce03898971f46b93fe626d01542a7bfc1 /sys/dev/usb/udcf.c
parent2207e6f02f1e44b1fb340dc5f884b6706e793a86 (diff)
- ntpd no longer needs the NTP identifier as part of a timedelta sensor
description. - create the timedelta sensors as early as possible, but mark them invalid as long as there is no real data. - update docs accordingly
Diffstat (limited to 'sys/dev/usb/udcf.c')
-rw-r--r--sys/dev/usb/udcf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c
index 9af2454d6a5..0105b07df58 100644
--- a/sys/dev/usb/udcf.c
+++ b/sys/dev/usb/udcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udcf.c,v 1.9 2006/05/28 18:52:16 mbalmer Exp $ */
+/* $OpenBSD: udcf.c,v 1.10 2006/06/04 09:52:40 mbalmer Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -56,8 +56,8 @@ int udcfdebug = 0;
#define CLOCK_HBG 1
static const char *clockname[2] = {
- "DCF DCF77",
- "HBG HBG" };
+ "DCF77",
+ "HBG" };
struct udcf_softc {
USBBASEDEVICE sc_dev; /* base device */
@@ -179,6 +179,8 @@ 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;
+ sensor_add(&sc->sc_sensor);
/* Prepare the USB request to probe the value */
@@ -290,8 +292,7 @@ USB_DETACH(udcf)
/* Unregister the clock with the kernel */
- if (sc->sc_sensor.status != SENSOR_S_UNKNOWN)
- sensor_del(&sc->sc_sensor);
+ sensor_del(&sc->sc_sensor);
usb_rem_task(sc->sc_udev, &sc->sc_task);
usb_rem_task(sc->sc_udev, &sc->sc_bv_task);
@@ -409,9 +410,7 @@ udcf_probe(void *xsc)
clockname[CLOCK_HBG] :
clockname[CLOCK_DCF77],
sizeof(sc->sc_sensor.desc));
- DPRINTF(("add timedelta sensor for %s\n",
- sc->sc_sensor.desc));
- sensor_add(&sc->sc_sensor);
+ sc->sc_sensor.flags &= ~SENSOR_FINVALID;
}
sc->sc_sensor.status = SENSOR_S_OK;