From 9087698d52f0806334fbdd200f22d1567d189e13 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 15 Sep 2004 16:25:12 +0000 Subject: [PATCH] timeout/untimeout ==> callout_* --- sys/dev/raid/aac/aac.c | 17 +++++++++++------ sys/dev/raid/aac/aacvar.h | 3 ++- sys/dev/raid/amr/amr.c | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/dev/raid/aac/aac.c b/sys/dev/raid/aac/aac.c index 9f946da271..4bfacb189e 100644 --- a/sys/dev/raid/aac/aac.c +++ b/sys/dev/raid/aac/aac.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aac/aac.c,v 1.9.2.14 2003/04/08 13:22:08 scottl Exp $ - * $DragonFly: src/sys/dev/raid/aac/aac.c,v 1.15 2004/08/15 14:15:00 joerg Exp $ + * $DragonFly: src/sys/dev/raid/aac/aac.c,v 1.16 2004/09/15 16:23:51 joerg Exp $ */ /* @@ -76,7 +76,7 @@ static void aac_add_container(struct aac_softc *sc, static void aac_get_bus_info(struct aac_softc *sc); /* Command Processing */ -static void aac_timeout(struct aac_softc *sc); +static void aac_timeout(void *ssc); static int aac_start(struct aac_command *cm); static void aac_complete(void *context, int pending); static int aac_bio_command(struct aac_softc *sc, struct aac_command **cmp); @@ -230,6 +230,7 @@ aac_attach(struct aac_softc *sc) int error, unit; debug_called(1); + callout_init(&sc->aac_watchdog); /* * Initialise per-controller queues. @@ -381,7 +382,8 @@ aac_startup(void *arg) AAC_UNMASK_INTERRUPTS(sc); /* enable the timeout watchdog */ - timeout((timeout_t*)aac_timeout, sc, AAC_PERIODIC_INTERVAL * hz); + callout_reset(&sc->aac_watchdog, AAC_PERIODIC_INTERVAL * hz, + aac_timeout, sc); } /* @@ -488,6 +490,8 @@ aac_detach(device_t dev) sc = device_get_softc(dev); + callout_stop(&sc->aac_watchdog); + if (sc->aac_state & AAC_STATE_OPEN) return(EBUSY); @@ -1958,8 +1962,9 @@ out: * and complain about them. */ static void -aac_timeout(struct aac_softc *sc) +aac_timeout(void *xsc) { + struct aac_softc *sc = xsc; int s; struct aac_command *cm; time_t deadline; @@ -1999,8 +2004,8 @@ aac_timeout(struct aac_softc *sc) splx(s); /* reset the timer for next time */ - timeout((timeout_t*)aac_timeout, sc, AAC_PERIODIC_INTERVAL * hz); - return; + callout_reset(&sc->aac_watchdog, AAC_PERIODIC_INTERVAL * hz, + aac_timeout, sc); } /* diff --git a/sys/dev/raid/aac/aacvar.h b/sys/dev/raid/aac/aacvar.h index 38ebed3b93..30e40a07cc 100644 --- a/sys/dev/raid/aac/aacvar.h +++ b/sys/dev/raid/aac/aacvar.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.4.2.7 2003/04/08 13:22:08 scottl Exp $ - * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.6 2004/03/01 06:33:14 dillon Exp $ + * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.7 2004/09/15 16:23:51 joerg Exp $ */ /* @@ -278,6 +278,7 @@ struct aac_softc { /* bus connections */ device_t aac_dev; + struct callout aac_watchdog; struct resource *aac_regs_resource; /* register interface * window */ int aac_regs_rid; /* resource ID */ diff --git a/sys/dev/raid/amr/amr.c b/sys/dev/raid/amr/amr.c index 9fe79c810e..d5b419a146 100644 --- a/sys/dev/raid/amr/amr.c +++ b/sys/dev/raid/amr/amr.c @@ -53,7 +53,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/amr/amr.c,v 1.7.2.13 2003/01/15 13:41:18 emoore Exp $ - * $DragonFly: src/sys/dev/raid/amr/amr.c,v 1.12 2004/09/15 16:11:52 joerg Exp $ + * $DragonFly: src/sys/dev/raid/amr/amr.c,v 1.13 2004/09/15 16:25:12 joerg Exp $ */ /* @@ -336,7 +336,7 @@ amr_startup(void *arg) /* * Start the timeout routine. */ -/* sc->amr_timeout = timeout(amr_periodic, sc, hz);*/ +/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); */ return; } -- 2.41.0