X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/515267540ed9d5c473e85acc6507deef64743ae1..39b5d600dedf02a61b8b1213f9fdaaee4b8292e0:/sys/dev/misc/pps/pps.c diff --git a/sys/dev/misc/pps/pps.c b/sys/dev/misc/pps/pps.c index 555c2d0008..f92b6cfa60 100644 --- a/sys/dev/misc/pps/pps.c +++ b/sys/dev/misc/pps/pps.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/dev/ppbus/pps.c,v 1.24.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.10 2004/05/20 21:44:00 dillon Exp $ + * $DragonFly: src/sys/dev/misc/pps/pps.c,v 1.14 2005/10/28 03:25:50 dillon Exp $ * * This driver implements a draft-mogul-pps-api-02.txt PPS source. * @@ -79,13 +79,6 @@ static struct cdevsw pps_cdevsw = { /* psize */ nopsize }; -static void -ppsidentify(driver_t *driver, device_t parent) -{ - - BUS_ADD_CHILD(parent, 0, PPS_NAME, 0); -} - static int ppsprobe(device_t ppsdev) { @@ -144,8 +137,8 @@ ppsopen(dev_t dev, int flags, int fmt, struct thread *td) /* attach the interrupt handler */ if ((error = BUS_SETUP_INTR(ppbus, ppsdev, sc->intr_resource, - INTR_TYPE_TTY, ppsintr, ppsdev, - &sc->intr_cookie))) { + 0, ppsintr, ppsdev, + &sc->intr_cookie, NULL))) { ppb_release_bus(ppbus, ppsdev); return (error); } @@ -185,7 +178,7 @@ ppsintr(void *arg) struct pps_data *sc = DEVTOSOFTC(ppsdev); sysclock_t count; - count = cputimer_count(); + count = sys_cputimer->count(); if (!(ppb_rstr(ppbus) & nACK)) return; if (sc->pps.ppsparam.mode & PPS_ECHOASSERT) @@ -204,9 +197,13 @@ ppsioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td) return (pps_ioctl(cmd, data, &sc->pps)); } +/* + * Becuase pps is a static device under any attached ppbus, and not scanned + * by the ppbus, we need an identify function to create the device. + */ static device_method_t pps_methods[] = { /* device interface */ - DEVMETHOD(device_identify, ppsidentify), + DEVMETHOD(device_identify, bus_generic_identify), DEVMETHOD(device_probe, ppsprobe), DEVMETHOD(device_attach, ppsattach),