diff options
77 files changed, 250 insertions, 274 deletions
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c index b68a2684272..a8baa8e4b49 100644 --- a/sys/arch/i386/i386/esm.c +++ b/sys/arch/i386/i386/esm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esm.c,v 1.47 2007/09/07 15:00:19 art Exp $ */ +/* $OpenBSD: esm.c,v 1.48 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -271,7 +271,7 @@ esm_attach(struct device *parent, struct device *self, void *aux) sc->sc_nextsensor = TAILQ_FIRST(&sc->sc_sensors); sc->sc_retries = 0; timeout_set(&sc->sc_timeout, esm_refresh, sc); - timeout_add(&sc->sc_timeout, hz); + timeout_add_sec(&sc->sc_timeout, 1); } } diff --git a/sys/arch/i386/i386/longrun.c b/sys/arch/i386/i386/longrun.c index 1ad14787a42..8c752df0e9b 100644 --- a/sys/arch/i386/i386/longrun.c +++ b/sys/arch/i386/i386/longrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: longrun.c,v 1.13 2007/05/25 20:32:29 krw Exp $ */ +/* $OpenBSD: longrun.c,v 1.14 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2003 Ted Unangst * Copyright (c) 2001 Tamotsu Hattori @@ -61,7 +61,7 @@ longrun_init(void) cpu_setperf = longrun_setperf; timeout_set(&longrun_timo, longrun_update, NULL); - timeout_add(&longrun_timo, hz); + timeout_add_sec(&longrun_timo, 1); } /* @@ -84,7 +84,7 @@ longrun_update(void *arg) cpuspeed = regs[0]; - timeout_add(&longrun_timo, hz); + timeout_add_sec(&longrun_timo, 1); } /* diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c index 0f4ed063e03..9c1c4f6b2d0 100644 --- a/sys/arch/i386/isa/pccom.c +++ b/sys/arch/i386/isa/pccom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccom.c,v 1.64 2008/04/12 10:47:22 kettenis Exp $ */ +/* $OpenBSD: pccom.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -704,7 +704,7 @@ comclose(dev_t dev, int flag, int mode, struct proc *p) /* tty device is waiting for carrier; drop dtr then re-raise */ CLR(sc->sc_mcr, MCR_DTR | MCR_RTS); bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr); - timeout_add(&sc->sc_dtr_tmo, hz * 2); + timeout_add_sec(&sc->sc_dtr_tmo, 2); } else { /* no one else waiting; turn off the uart */ compwroff(sc); @@ -1268,7 +1268,8 @@ comsoft(void) if (ISSET(lsr, LSR_OE)) { sc->sc_overflows++; if (sc->sc_errors++ == 0) - timeout_add(&sc->sc_diag_tmo, 60 * hz); + timeout_add_sec( + &sc->sc_diag_tmo, 60); } rxget = (rxget + 1) & RBUFMASK; c |= lsrmap[(lsr & (LSR_BI|LSR_FE|LSR_PE)) >> 2]; diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 8536885ffad..e1f3baab262 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.131 2008/08/14 17:41:20 jsing Exp $ */ +/* $OpenBSD: dsdt.c,v 1.132 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -500,7 +500,7 @@ acpi_poll(void *arg) dsdt_softc->sc_wakeup = 0; wakeup(dsdt_softc); - timeout_add(&dsdt_softc->sc_dev_timeout, 10 * hz); + timeout_add_sec(&dsdt_softc->sc_dev_timeout, 10); } void @@ -525,7 +525,7 @@ aml_register_notify(struct aml_node *node, const char *pnpid, SLIST_INSERT_HEAD(&aml_notify_list, pdata, link); if (poll && !acpi_poll_enabled) - timeout_add(&dsdt_softc->sc_dev_timeout, 10 * hz); + timeout_add_sec(&dsdt_softc->sc_dev_timeout, 10); } void diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index eeacfae4668..e300d4d920c 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.71 2008/06/27 06:03:08 ray Exp $ */ +/* $OpenBSD: wd.c,v 1.72 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -561,7 +561,7 @@ __wdstart(struct wd_softc *wd, struct buf *bp) disk_busy(&wd->sc_dk); switch (wdc_ata_bio(wd->drvp, &wd->sc_wdc_bio)) { case WDC_TRY_AGAIN: - timeout_add(&wd->sc_restart_timeout, hz); + timeout_add_sec(&wd->sc_restart_timeout, 1); break; case WDC_QUEUED: break; diff --git a/sys/dev/ic/aic6915.c b/sys/dev/ic/aic6915.c index 5a379f7fe45..d47d53230ac 100644 --- a/sys/dev/ic/aic6915.c +++ b/sys/dev/ic/aic6915.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6915.c,v 1.5 2008/06/26 05:42:15 ray Exp $ */ +/* $OpenBSD: aic6915.c,v 1.6 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $ */ /*- @@ -906,7 +906,7 @@ sf_tick(void *arg) sf_stats_update(sc); splx(s); - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); } /* @@ -1165,7 +1165,7 @@ sf_init(struct ifnet *ifp) GEC_TxDmaEn|GEC_RxDmaEn|GEC_TransmitEn|GEC_ReceiveEn); /* Start the on second clock. */ - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); /* * Note that the interface is now running. diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 667187803af..2cea0d57f97 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.30 2008/04/24 09:04:14 jakob Exp $ */ +/* $OpenBSD: ciss.c,v 1.31 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -339,7 +339,7 @@ ciss_attach(struct ciss_softc *sc) CISS_UNLOCK_SCRATCH(sc, lock); timeout_set(&sc->sc_hb, ciss_heartbeat, sc); - timeout_add(&sc->sc_hb, hz * 3); + timeout_add_sec(&sc->sc_hb, 3); /* map LDs */ if (ciss_ldmap(sc)) { @@ -985,7 +985,7 @@ ciss_heartbeat(void *v) else sc->heartbeat = hb; - timeout_add(&sc->sc_hb, hz * 3); + timeout_add_sec(&sc->sc_hb, 3); } void diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 49f7c6f1ab8..229f68720f4 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.91 2008/02/21 03:58:07 brad Exp $ */ +/* $OpenBSD: fxp.c,v 1.92 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -1049,7 +1049,7 @@ fxp_stats_update(void *arg) /* * Schedule another timeout one second from now. */ - timeout_add(&sc->stats_update_to, hz); + timeout_add_sec(&sc->stats_update_to, 1); } /* @@ -1437,7 +1437,7 @@ fxp_init(void *xsc) /* * Start stats updater. */ - timeout_add(&sc->stats_update_to, hz); + timeout_add_sec(&sc->stats_update_to, 1); } /* diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index 31a16ba0009..3d15faffa0d 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gem.c,v 1.77 2008/08/30 07:39:12 brad Exp $ */ +/* $OpenBSD: gem.c,v 1.78 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */ /* @@ -417,7 +417,7 @@ gem_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); } int @@ -815,7 +815,7 @@ gem_init(struct ifnet *ifp) bus_space_write_4(t, h, GEM_RX_KICK, GEM_NRXDESC-4); /* Start the one second timer. */ - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index 83fdfef9a4e..19853211493 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.49 2008/06/26 05:42:15 ray Exp $ */ +/* $OpenBSD: hme.c,v 1.50 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */ /*- @@ -342,7 +342,7 @@ hme_tick(arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); } void @@ -615,7 +615,7 @@ hme_init(sc) mii_mediachg(&sc->sc_mii); /* Start the one second timer. */ - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 8f29654f04f..c6f5330e32e 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.38 2008/08/31 17:21:57 miod Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.39 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -2846,5 +2846,5 @@ ncr53c9x_watch(arg) } } splx(s); - timeout_add(&sc->sc_watchdog, 60*hz); + timeout_add_sec(&sc->sc_watchdog, 60); } diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index ce6df5bd1ac..58ef989ddbc 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.17 2008/07/29 04:20:37 miod Exp $ */ +/* $OpenBSD: pckbc.c,v 1.18 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -532,7 +532,7 @@ pckbc_slot_enable(self, slot, on) if (slot == PCKBC_KBD_SLOT) { if (on) - timeout_add(&t->t_poll, hz); + timeout_add_sec(&t->t_poll, 1); else timeout_del(&t->t_poll); } @@ -885,7 +885,7 @@ pckbc_enqueue_cmd(self, slot, cmd, len, responselen, sync, respbuf) } else res = nc->status; } else - timeout_add(&t->t_cleanup, hz); + timeout_add_sec(&t->t_cleanup, 1); if (sync) { if (respbuf) @@ -919,7 +919,7 @@ pckbc_set_inputhandler(self, slot, func, arg, name) sc->subname[slot] = name; if (pckbc_console && slot == PCKBC_KBD_SLOT) - timeout_add(&t->t_poll, hz); + timeout_add_sec(&t->t_poll, 1); } void @@ -931,7 +931,7 @@ pckbc_poll(v) s = spltty(); (void)pckbcintr_internal(t, t->t_sc); - timeout_add(&t->t_poll, hz); + timeout_add_sec(&t->t_poll, 1); splx(s); } @@ -956,7 +956,7 @@ pckbcintr_internal(t, sc) /* reschedule timeout further into the idle times */ if (timeout_pending(&t->t_poll)) - timeout_add(&t->t_poll, hz); + timeout_add_sec(&t->t_poll, 1); for(;;) { stat = bus_space_read_1(t->t_iot, t->t_ioh_c, 0); diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 635acdad908..3ee58670a43 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.89 2008/08/29 22:59:56 brad Exp $ */ +/* $OpenBSD: re.c,v 1.90 2008/09/10 14:01:22 blambert Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1524,7 +1524,7 @@ re_tick(void *xsc) } splx(s); - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); } int @@ -2007,7 +2007,7 @@ re_init(struct ifnet *ifp) sc->rl_flags &= ~RL_FLAG_LINK; - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); return (0); } diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 9011926a09c..bc437adb649 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.58 2008/04/20 00:23:28 brad Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.59 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1052,7 +1052,7 @@ void rl_init(xsc) splx(s); timeout_set(&sc->sc_tick_tmo, rl_tick, sc); - timeout_add(&sc->sc_tick_tmo, hz); + timeout_add_sec(&sc->sc_tick_tmo, 1); } /* @@ -1473,7 +1473,7 @@ rl_tick(v) s = splnet(); mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_tmo, hz); + timeout_add_sec(&sc->sc_tick_tmo, 1); } struct cfdriver rl_cd = { diff --git a/sys/dev/ic/smc83c170.c b/sys/dev/ic/smc83c170.c index ecff1f4aef6..af2b8ca9a19 100644 --- a/sys/dev/ic/smc83c170.c +++ b/sys/dev/ic/smc83c170.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smc83c170.c,v 1.10 2008/06/26 05:42:16 ray Exp $ */ +/* $OpenBSD: smc83c170.c,v 1.11 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */ /*- @@ -900,7 +900,7 @@ epic_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); } /* @@ -1088,7 +1088,7 @@ epic_init(struct ifnet *ifp) /* * Start the one second clock. */ - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); /* * Attempt to start output on the interface. diff --git a/sys/dev/ic/smc91cxx.c b/sys/dev/ic/smc91cxx.c index 84815e9032d..1fc4c581cbf 100644 --- a/sys/dev/ic/smc91cxx.c +++ b/sys/dev/ic/smc91cxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smc91cxx.c,v 1.27 2008/06/26 05:42:16 ray Exp $ */ +/* $OpenBSD: smc91cxx.c,v 1.28 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: smc91cxx.c,v 1.11 1998/08/08 23:51:41 mycroft Exp $ */ /*- @@ -518,7 +518,7 @@ smc91cxx_init(sc) if (sc->sc_flags & SMC_FLAGS_HAS_MII) { /* Start the one second clock. */ timeout_set(&sc->sc_mii_timeout, smc91cxx_tick, sc); - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); } /* @@ -1362,5 +1362,5 @@ smc91cxx_tick(arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_mii_timeout, hz); + timeout_add_sec(&sc->sc_mii_timeout, 1); } diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index 898e27e4cbf..93426ee51a1 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.79 2008/05/11 03:01:29 brad Exp $ */ +/* $OpenBSD: xl.c,v 1.80 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1597,7 +1597,7 @@ xl_stats_update(void *xsc) XL_SEL_WIN(7); if (!sc->xl_stats_no_timeout) - timeout_add(&sc->xl_stsup_tmo, hz); + timeout_add_sec(&sc->xl_stsup_tmo, 1); } /* @@ -2143,7 +2143,7 @@ xl_init(void *xsc) splx(s); - timeout_add(&sc->xl_stsup_tmo, hz); + timeout_add_sec(&sc->xl_stsup_tmo, 1); } /* diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c index 046a917117d..641ad511eeb 100644 --- a/sys/dev/isa/if_ef_isapnp.c +++ b/sys/dev/isa/if_ef_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ef_isapnp.c,v 1.21 2006/03/25 22:41:44 djm Exp $ */ +/* $OpenBSD: if_ef_isapnp.c,v 1.22 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -471,7 +471,7 @@ efinit(sc) splx(s); - timeout_add(&sc->sc_tick_tmo, hz); + timeout_add_sec(&sc->sc_tick_tmo, 1); efstart(ifp); } @@ -1009,5 +1009,5 @@ ef_tick(v) s = splnet(); mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_tmo, hz); + timeout_add_sec(&sc->sc_tick_tmo, 1); } diff --git a/sys/dev/isa/viasio.c b/sys/dev/isa/viasio.c index 2a0bcf5579c..cb7527ccd87 100644 --- a/sys/dev/isa/viasio.c +++ b/sys/dev/isa/viasio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viasio.c,v 1.10 2007/06/14 19:13:37 grange Exp $ */ +/* $OpenBSD: viasio.c,v 1.11 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org> * @@ -312,7 +312,7 @@ viasio_hm_init(struct viasio_softc *sc) sensor_attach(&sc->sc_sensordev, &sc->sc_hm_sensors[i]); sensordev_install(&sc->sc_sensordev); timeout_set(&sc->sc_hm_timo, viasio_hm_refresh, sc); - timeout_add(&sc->sc_hm_timo, hz); + timeout_add_sec(&sc->sc_hm_timo, 1); } void @@ -425,7 +425,7 @@ viasio_hm_refresh(void *arg) sc->sc_hm_sensors[VT1211_HMS_FAN2].flags |= SENSOR_FINVALID; } - timeout_add(&sc->sc_hm_timo, hz); + timeout_add_sec(&sc->sc_hm_timo, 1); } void diff --git a/sys/dev/pci/if_art.c b/sys/dev/pci/if_art.c index 0343702d60e..bd32e0e260f 100644 --- a/sys/dev/pci/if_art.c +++ b/sys/dev/pci/if_art.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_art.c,v 1.15 2008/05/13 01:37:26 brad Exp $ */ +/* $OpenBSD: if_art.c,v 1.16 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2004,2005 Internet Business Solutions AG, Zurich, Switzerland @@ -177,7 +177,7 @@ art_softc_attach(struct device *parent, struct device *self, void *aux) sc->art_channel->cc_ifp->if_linkstatehooks, 0, art_linkstate, sc); /* Schedule the timeout one second from now. */ - timeout_add(&sc->art_onesec, hz); + timeout_add_sec(&sc->art_onesec, 1); } /* interface ioctl */ @@ -416,7 +416,7 @@ art_onesec(void *arg) /* * Schedule another timeout one second from now. */ - timeout_add(&ac->art_onesec, hz); + timeout_add_sec(&ac->art_onesec, 1); } void diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index 981f6eb7eea..4878cb58a5d 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bce.c,v 1.24 2008/05/23 08:49:27 brad Exp $ */ +/* $OpenBSD: if_bce.c,v 1.25 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */ /* @@ -1009,7 +1009,7 @@ bce_init(struct ifnet *ifp) BCE_ENET_CTL) | EC_EE); /* start timer */ - timeout_add(&sc->bce_timeout, hz); + timeout_add_sec(&sc->bce_timeout, 1); /* mark as running, and no outputs active */ ifp->if_flags |= IFF_RUNNING; @@ -1495,5 +1495,5 @@ bce_tick(void *v) mii_tick(&sc->bce_mii); splx(s); - timeout_add(&sc->bce_timeout, hz); + timeout_add_sec(&sc->bce_timeout, 1); } diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 3b9959d4b60..1c330c05fe9 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.242 2008/09/08 08:10:54 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.243 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -2709,7 +2709,7 @@ bge_tick(void *xsc) mii_tick(mii); } - timeout_add(&sc->bge_timeout, hz); + timeout_add_sec(&sc->bge_timeout, 1); splx(s); } @@ -3152,7 +3152,7 @@ bge_init(void *xsc) splx(s); - timeout_add(&sc->bge_timeout, hz); + timeout_add_sec(&sc->bge_timeout, 1); } /* diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 0df4f6bd894..55b5617337b 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.64 2008/06/24 23:02:42 brad Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -4327,7 +4327,7 @@ bnx_init(void *xsc) ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - timeout_add(&sc->bnx_timeout, hz); + timeout_add_sec(&sc->bnx_timeout, 1); bnx_init_exit: DBPRINT(sc, BNX_VERBOSE_RESET, "Exiting %s()\n", __FUNCTION__); @@ -5140,7 +5140,7 @@ bnx_tick(void *xsc) bnx_stats_update(sc); /* Schedule the next tick. */ - timeout_add(&sc->bnx_timeout, hz); + timeout_add_sec(&sc->bnx_timeout, 1); /* If link is up already up then we're done. */ if (sc->bnx_link) diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index cc37c7c4f54..7172f60b739 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.20 2008/08/30 07:39:12 brad Exp $ */ +/* $OpenBSD: if_cas.c,v 1.21 2008/09/10 14:01:22 blambert Exp $ */ /* * @@ -661,7 +661,7 @@ cas_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); } int @@ -1074,7 +1074,7 @@ cas_init(struct ifnet *ifp) bus_space_write_4(t, h, CAS_RX_KICK2, 4); /* Start the one second timer. */ - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index 5f34d4b699a..f80a5a004c8 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo Exp $ */ +/* $OpenBSD: if_et.c,v 1.13 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. * @@ -1013,7 +1013,7 @@ et_init(struct ifnet *ifp) et_enable_intrs(sc, ET_INTRS); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); CSR_WRITE_4(sc, ET_TIMER, sc->sc_timer); @@ -1142,7 +1142,7 @@ et_start(struct ifnet *ifp) } if (trans) { - timeout_add(&sc->sc_txtick, hz); + timeout_add_sec(&sc->sc_txtick, 1); ifp->if_timer = 5; } } @@ -2035,7 +2035,7 @@ et_tick(void *xsc) s = splnet(); mii_tick(&sc->sc_miibus); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); splx(s); } diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index c9d3839f8d0..f49899d9e14 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.7 2008/06/19 08:43:55 reyk Exp $ */ +/* $OpenBSD: if_ix.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */ /****************************************************************************** @@ -685,7 +685,7 @@ ixgbe_init(void *arg) IXGBE_WRITE_REG(&sc->hw, IXGBE_RXDCTL(i), rxdctl); } - timeout_add(&sc->timer, hz); + timeout_add_sec(&sc->timer, 1); /* Set up MSI/X routing */ ixgbe_configure_ivars(sc); @@ -741,7 +741,7 @@ ixgbe_legacy_irq(void *arg) if (reg_eicr & IXGBE_EICR_LSC) { timeout_del(&sc->timer); ixgbe_update_link_status(sc); - timeout_add(&sc->timer, hz); + timeout_add_sec(&sc->timer, 1); } } @@ -1100,7 +1100,7 @@ ixgbe_local_timer(void *arg) ixgbe_print_hw_stats(sc); #endif - timeout_add(&sc->timer, hz); + timeout_add_sec(&sc->timer, 1); splx(s); } diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 41def4b1bda..648ac634aa4 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.44 2008/06/08 16:54:34 brad Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.45 2008/09/10 14:01:22 blambert Exp $ */ #include <dev/pci/if_ixgb.h> @@ -546,7 +546,7 @@ ixgb_init(void *arg) temp_reg |= IXGB_CTRL0_JFE; IXGB_WRITE_REG(&sc->hw, CTRL0, temp_reg); - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); ixgb_clear_hw_cntrs(&sc->hw); ixgb_enable_intr(sc); @@ -590,7 +590,7 @@ ixgb_intr(void *arg) timeout_del(&sc->timer_handle); ixgb_check_for_link(&sc->hw); ixgb_update_link_status(sc); - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); } if (rxdmt0 && sc->raidc) { @@ -840,7 +840,7 @@ ixgb_local_timer(void *arg) ixgb_print_hw_stats(sc); #endif - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); splx(s); } diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index cc9913b55f6..a9def3cbae3 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.47 2008/05/23 08:49:27 brad Exp $ */ +/* $OpenBSD: if_lge.c,v 1.48 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -595,7 +595,7 @@ lge_attach(struct device *parent, struct device *self, void *aux) ether_ifattach(ifp); DPRINTFN(5, ("timeout_set\n")); timeout_set(&sc->lge_timeout, lge_tick, sc); - timeout_add(&sc->lge_timeout, hz); + timeout_add_sec(&sc->lge_timeout, 1); return; fail_5: @@ -1035,7 +1035,7 @@ lge_tick(void *xsc) } } - timeout_add(&sc->lge_timeout, hz); + timeout_add_sec(&sc->lge_timeout, 1); splx(s); } @@ -1325,7 +1325,7 @@ lge_init(void *xsc) splx(s); - timeout_add(&sc->lge_timeout, hz); + timeout_add_sec(&sc->lge_timeout, 1); } /* diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index aab797a6840..960c76fa457 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lii.c,v 1.17 2008/09/01 14:38:31 brad Exp $ */ +/* $OpenBSD: if_lii.c,v 1.18 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation. @@ -701,7 +701,7 @@ lii_init(struct ifnet *ifp) LII_WRITE_4(sc, LII_IMR, IMR_NORMAL_MASK); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; @@ -1159,5 +1159,5 @@ lii_tick(void *v) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); } diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 2534215d6b3..f7f4a8526b2 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.64 2008/06/21 21:15:20 brad Exp $ */ +/* $OpenBSD: if_msk.c,v 1.65 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1802,7 +1802,7 @@ msk_tick(void *xsc_if) s = splnet(); mii_tick(mii); splx(s); - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } void @@ -2133,7 +2133,7 @@ msk_init(void *xsc_if) ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); splx(s); } diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 8c0fe91c02d..2096cf0d59e 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.7 2008/05/23 08:49:27 brad Exp $ */ +/* $OpenBSD: if_myx.c,v 1.8 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -290,7 +290,7 @@ myx_attach(struct device *parent, struct device *self, void *aux) ether_ifattach(ifp); timeout_set(&sc->sc_tick, myx_tick, sc); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); mountroothook_establish(myx_attachhook, sc); @@ -810,7 +810,7 @@ myx_tick(void *arg) return; myx_link_state(sc); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); } int diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 043eab7d460..43bb11763c6 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.80 2008/08/09 21:00:52 brad Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */ /*- * Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr> @@ -1183,7 +1183,7 @@ nfe_init(struct ifnet *ifp) /* enable interrupts */ NFE_WRITE(sc, NFE_IRQ_MASK, NFE_IRQ_WANTED); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; @@ -1810,5 +1810,5 @@ nfe_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); } diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index 33c29e9b1fc..ce105f74562 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.54 2008/05/05 23:56:21 claudio Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.55 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1853,7 +1853,7 @@ nxe_tick(void *xsc) break; } - timeout_add(&sc->sc_tick, hz * 5); + timeout_add_sec(&sc->sc_tick, 5); } diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index d18c73efe44..1d23e361ed5 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.18 2008/05/13 02:24:08 brad Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.19 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -1520,7 +1520,7 @@ pcn_tick(void *arg) mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->sc_tick_timeout, hz); + timeout_add_sec(&sc->sc_tick_timeout, 1); } /* @@ -1762,7 +1762,7 @@ pcn_init(struct ifnet *ifp) if (sc->sc_flags & PCN_F_HAS_MII) { /* Start the one second MII clock. */ - timeout_add(&sc->sc_tick_timeout, hz); + timeout_add_sec(&sc->sc_tick_timeout, 1); } /* ...all done! */ diff --git a/sys/dev/pci/if_san_xilinx.c b/sys/dev/pci/if_san_xilinx.c index 98c4f9fb2b8..4a4f7e87665 100644 --- a/sys/dev/pci/if_san_xilinx.c +++ b/sys/dev/pci/if_san_xilinx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_xilinx.c,v 1.21 2007/10/08 04:15:15 krw Exp $ */ +/* $OpenBSD: if_san_xilinx.c,v 1.22 2008/09/10 14:01:22 blambert Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -3534,7 +3534,7 @@ aft_led_timer(void *data) } splx(s); - timeout_add(&card->u.xilinx.led_timer, hz); + timeout_add_sec(&card->u.xilinx.led_timer, 1); } } diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index f2a366009e5..b83130f53db 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.80 2008/07/15 12:10:48 thib Exp $ */ +/* $OpenBSD: if_sis.c,v 1.81 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1463,7 +1463,7 @@ sis_tick(void *xsc) if (!IFQ_IS_EMPTY(&ifp->if_snd)) sis_start(ifp); } - timeout_add(&sc->sis_timeout, hz); + timeout_add_sec(&sc->sis_timeout, 1); splx(s); } @@ -1841,7 +1841,7 @@ sis_init(void *xsc) splx(s); - timeout_add(&sc->sis_timeout, hz); + timeout_add_sec(&sc->sis_timeout, 1); } /* diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 96ea5796272..cf48c0597b8 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.146 2008/05/24 01:32:54 brad Exp $ */ +/* $OpenBSD: if_sk.c,v 1.147 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1246,7 +1246,7 @@ sk_attach(struct device *parent, struct device *self, void *aux) if (SK_IS_GENESIS(sc)) { timeout_set(&sc_if->sk_tick_ch, sk_tick, sc_if); - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } else timeout_set(&sc_if->sk_tick_ch, sk_yukon_tick, sc_if); @@ -1988,7 +1988,7 @@ sk_tick(void *xsc_if) } if (i != 3) { - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); return; } @@ -2009,7 +2009,7 @@ sk_yukon_tick(void *xsc_if) s = splnet(); mii_tick(mii); splx(s); - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } void @@ -2057,7 +2057,7 @@ sk_intr_bcom(struct sk_if_softc *sc_if) SK_LINKLED_BLINK_OFF); } else { mii_tick(mii); - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } } @@ -2074,11 +2074,11 @@ sk_intr_xmac(struct sk_if_softc *sc_if) if (sc_if->sk_phytype == SK_PHYTYPE_XMAC) { if (status & XM_ISR_GP0_SET) { SK_XM_SETBIT_2(sc_if, XM_IMR, XM_IMR_GP0_SET); - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } if (status & XM_ISR_AUTONEG_DONE) { - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); } } @@ -2670,7 +2670,7 @@ sk_init(void *xsc_if) ifp->if_flags &= ~IFF_OACTIVE; if (SK_IS_YUKON(sc)) - timeout_add(&sc_if->sk_tick_ch, hz); + timeout_add_sec(&sc_if->sk_tick_ch, 1); splx(s); } diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c index 273804c90d9..c2f1b3fe9bd 100644 --- a/sys/dev/pci/if_ste.c +++ b/sys/dev/pci/if_ste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ste.c,v 1.40 2007/07/17 23:25:15 krw Exp $ */ +/* $OpenBSD: if_ste.c,v 1.41 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -815,7 +815,7 @@ ste_stats_update(void *xsc) } } - timeout_add(&sc->sc_stats_tmo, hz); + timeout_add_sec(&sc->sc_stats_tmo, 1); splx(s); return; @@ -1196,7 +1196,7 @@ ste_init(void *xsc) splx(s); timeout_set(&sc->sc_stats_tmo, ste_stats_update, sc); - timeout_add(&sc->sc_stats_tmo, hz); + timeout_add_sec(&sc->sc_stats_tmo, 1); return; } diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index 16ac6ad7512..c9a8273968a 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_stge.c,v 1.39 2008/06/26 05:42:17 ray Exp $ */ +/* $OpenBSD: if_stge.c,v 1.40 2008/09/10 14:01:22 blambert Exp $ */ /* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */ /*- @@ -1084,7 +1084,7 @@ stge_tick(void *arg) stge_stats_update(sc); splx(s); - timeout_add(&sc->sc_timeout, hz); + timeout_add_sec(&sc->sc_timeout, 1); } /* @@ -1345,7 +1345,7 @@ stge_init(struct ifnet *ifp) /* * Start the one second MII clock. */ - timeout_add(&sc->sc_timeout, hz); + timeout_add_sec(&sc->sc_timeout, 1); /* * ...all done! diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index 87d08f0c24d..0f1eaf41b17 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.117 2008/05/13 00:52:12 brad Exp $ */ +/* $OpenBSD: if_tht.c,v 1.118 2008/09/10 14:01:22 blambert Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1737,7 +1737,7 @@ tht_fw_load(struct tht_softc *sc) } timeout_set(&ticker, tht_fw_tick, (void *)&ok); - timeout_add(&ticker, 2*hz); + timeout_add_sec(&ticker, 2); while (ok) { if (tht_read(sc, THT_REG_INIT_STATUS) != 0) { error = 0; diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index ffc6e8d72b8..bf42496923d 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tl.c,v 1.43 2007/05/08 21:19:13 deraadt Exp $ */ +/* $OpenBSD: if_tl.c,v 1.44 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1447,7 +1447,7 @@ void tl_stats_update(xsc) } } - timeout_add(&sc->tl_stats_tmo, hz); + timeout_add_sec(&sc->tl_stats_tmo, 1); if (!sc->tl_bitrate) mii_tick(&sc->sc_mii); @@ -1719,9 +1719,9 @@ void tl_init(xsc) /* Start the stats update counter */ timeout_set(&sc->tl_stats_tmo, tl_stats_update, sc); - timeout_add(&sc->tl_stats_tmo, hz); + timeout_add_sec(&sc->tl_stats_tmo, 1); timeout_set(&sc->tl_wait_tmo, tl_wait_up, sc); - timeout_add(&sc->tl_wait_tmo, 2 * hz); + timeout_add_sec(&sc->tl_wait_tmo, 2); return; } diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index 22fdd3a4bbe..37beacde363 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.92 2008/09/08 07:38:33 brad Exp $ */ +/* $OpenBSD: if_txp.c,v 1.93 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2001 @@ -1296,7 +1296,7 @@ txp_init(struct txp_softc *sc) ifp->if_flags &= ~IFF_OACTIVE; if (!timeout_pending(&sc->sc_tick)) - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); splx(s); } @@ -1337,7 +1337,7 @@ out: free(rsp, M_DEVBUF); splx(s); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); } void diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index fe9cb212169..24a0c1200ee 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vge.c,v 1.37 2008/05/22 19:23:04 mk Exp $ */ +/* $OpenBSD: if_vge.c,v 1.38 2008/09/10 14:01:23 blambert Exp $ */ /* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -1200,7 +1200,7 @@ vge_tick(void *xsc) vge_start(ifp); } } - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); splx(s); } @@ -1622,7 +1622,7 @@ vge_init(struct ifnet *ifp) sc->vge_link = 0; if (!timeout_pending(&sc->timer_handle)) - timeout_add(&sc->timer_handle, hz); + timeout_add_sec(&sc->timer_handle, 1); return (0); } diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index 8f440957a5c..15dedb3ef91 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.53 2008/07/07 00:42:34 dlg Exp $ */ +/* $OpenBSD: if_vic.c,v 1.54 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -1286,7 +1286,7 @@ vic_init(struct ifnet *ifp) splx(s); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); } void @@ -1356,7 +1356,7 @@ vic_tick(void *arg) vic_link_state(sc); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); } u_int32_t diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 17133111850..ae57786c965 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.75 2008/07/24 19:01:28 thib Exp $ */ +/* $OpenBSD: if_vr.c,v 1.76 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 1997, 1998 @@ -951,7 +951,7 @@ vr_tick(void *xsc) } mii_tick(&sc->sc_mii); - timeout_add(&sc->sc_to, hz); + timeout_add_sec(&sc->sc_to, 1); splx(s); } @@ -1289,7 +1289,7 @@ vr_init(void *xsc) ifp->if_flags &= ~IFF_OACTIVE; if (!timeout_pending(&sc->sc_to)) - timeout_add(&sc->sc_to, hz); + timeout_add_sec(&sc->sc_to, 1); splx(s); } diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index a486a41ddf7..b869ec8322b 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.38 2007/05/26 00:36:03 krw Exp $ */ +/* $OpenBSD: if_wb.c,v 1.39 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1268,7 +1268,7 @@ wb_tick(xsc) s = splnet(); mii_tick(&sc->sc_mii); splx(s); - timeout_add(&sc->wb_tick_tmo, hz); + timeout_add_sec(&sc->wb_tick_tmo, 1); } /* @@ -1571,7 +1571,7 @@ void wb_init(xsc) splx(s); timeout_set(&sc->wb_tick_tmo, wb_tick, sc); - timeout_add(&sc->wb_tick_tmo, hz); + timeout_add_sec(&sc->wb_tick_tmo, 1); return; } diff --git a/sys/dev/pci/mbg.c b/sys/dev/pci/mbg.c index 05a6a0a9b0b..df8f989b2f0 100644 --- a/sys/dev/pci/mbg.c +++ b/sys/dev/pci/mbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbg.c,v 1.24 2007/11/26 19:44:43 mbalmer Exp $ */ +/* $OpenBSD: mbg.c,v 1.25 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2006, 2007 Marc Balmer <mbalmer@openbsd.org> @@ -48,7 +48,7 @@ struct mbg_softc { struct ksensor sc_signal; struct ksensordev sc_sensordev; struct timeout sc_timeout; /* invalidate sensor */ - int sc_trust; /* trust time in ticks */ + int sc_trust; /* trust time in seconds */ int (*sc_read)(struct mbg_softc *, int cmd, char *buf, size_t len, @@ -177,7 +177,6 @@ mbg_attach(struct device *parent, struct device *self, void *aux) struct mbg_softc *sc = (struct mbg_softc *)self; struct pci_attach_args *const pa = (struct pci_attach_args *)aux; struct mbg_time tframe; - struct timeval tv_trust; pcireg_t memtype; bus_size_t iosize, iosize2; int bar = PCI_MAPREG_START, signal, t_trust; @@ -262,9 +261,7 @@ mbg_attach(struct device *parent, struct device *self, void *aux) break; } - tv_trust.tv_sec = t_trust; - tv_trust.tv_usec = 0L; - sc->sc_trust = tvtohz(&tv_trust); + sc->sc_trust = t_trust; if (sc->sc_read(sc, MBG_GET_TIME, (char *)&tframe, sizeof(struct mbg_time), NULL)) { @@ -302,7 +299,7 @@ mbg_attach(struct device *parent, struct device *self, void *aux) #endif printf("\n"); sensordev_install(&sc->sc_sensordev); - timeout_add(&sc->sc_timeout, sc->sc_trust); + timeout_add_sec(&sc->sc_timeout, sc->sc_trust); } /* @@ -397,7 +394,7 @@ mbg_update_sensor(struct mbg_softc *sc, struct timespec *tstamp, sc->sc_signal.tv.tv_usec = sc->sc_timedelta.tv.tv_usec; if (!(status & MBG_FREERUN)) { sc->sc_timedelta.status = SENSOR_S_OK; - timeout_add(&sc->sc_timeout, sc->sc_trust); + timeout_add_sec(&sc->sc_timeout, sc->sc_trust); } } @@ -579,7 +576,7 @@ mbg_timeout(void *xsc) * further degrade in TRUSTTIME seconds if no new valid NMEA * sentences are received. */ - timeout_add(&sc->sc_timeout, sc->sc_trust); + timeout_add_sec(&sc->sc_timeout, sc->sc_trust); } else sc->sc_timedelta.status = SENSOR_S_CRIT; } diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index 68ec830855c..47d47bf75e3 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppb.c,v 1.26 2007/12/31 19:13:36 kettenis Exp $ */ +/* $OpenBSD: ppb.c,v 1.27 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -240,7 +240,7 @@ ppb_hotplug_insert(void *arg1, void *arg2) /* XXX Turn on LEDs. */ /* Wait a second for things to settle. */ - timeout_add(&sc->sc_to, 1 * hz); + timeout_add_sec(&sc->sc_to, 1); } void diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 015c93f534f..3cd0a96ec1c 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.92 2008/06/11 19:38:00 djm Exp $ */ +/* $OpenBSD: rnd.c,v 1.93 2008/09/10 14:01:23 blambert Exp $ */ /* * rnd.c -- A strong random number generator @@ -819,7 +819,6 @@ arc4_reinit(void *v) static void arc4maybeinit(void) { - extern int hz; if (!arc4random_initialized) { #ifdef DIAGNOSTIC @@ -829,7 +828,7 @@ arc4maybeinit(void) arc4random_initialized++; arc4_stir(); /* 10 minutes, per dm@'s suggestion */ - timeout_add(&arc4_timeout, 10 * 60 * hz); + timeout_add_sec(&arc4_timeout, 10 * 60); } } diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index 0c4276bb905..6c5d738cc2d 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.20 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: be.c,v 1.21 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */ /*- @@ -1105,7 +1105,7 @@ beinit(struct be_softc *sc) ifp->if_flags &= ~IFF_OACTIVE; be_ifmedia_upd(ifp); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); splx(s); } @@ -1369,7 +1369,7 @@ be_tick(void *arg) mii_tick(&sc->sc_mii); (void)be_intphy_service(sc, &sc->sc_mii, MII_TICK); - timeout_add(&sc->sc_tick_ch, hz); + timeout_add_sec(&sc->sc_tick_ch, 1); splx(s); } diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 283a6eb33ef..3f39cf1b7c2 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.89 2008/09/08 07:08:27 brad Exp $ */ +/* $OpenBSD: ehci.c,v 1.90 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -671,7 +671,7 @@ ehci_softintr(void *v) /* Schedule a callout to catch any dropped transactions. */ if ((sc->sc_flags & EHCIF_DROPPED_INTR_WORKAROUND) && !LIST_EMPTY(&sc->sc_intrhead)) { - timeout_add(&sc->sc_tmo_intrlist, hz); + timeout_add_sec(&sc->sc_tmo_intrlist, 1); } #ifdef __HAVE_GENERIC_SOFT_INTERRUPTS diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 309c2d64e98..802cf569540 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.71 2008/03/18 12:24:19 jsg Exp $ */ +/* $OpenBSD: if_aue.c,v 1.72 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1245,7 +1245,7 @@ aue_tick_task(void *xsc) aue_start(ifp); } - timeout_add(&sc->aue_stat_ch, hz); + timeout_add_sec(&sc->aue_stat_ch, 1); splx(s); } @@ -1415,7 +1415,7 @@ aue_init(void *xsc) splx(s); - timeout_add(&sc->aue_stat_ch, hz); + timeout_add_sec(&sc->aue_stat_ch, 1); } int diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 49960fba976..3a0dd25ab34 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.85 2008/05/14 01:41:10 brad Exp $ */ +/* $OpenBSD: if_axe.c,v 1.86 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> @@ -1126,7 +1126,7 @@ axe_tick_task(void *xsc) axe_start(ifp); } - timeout_add(&sc->axe_stat_ch, hz); + timeout_add_sec(&sc->axe_stat_ch, 1); splx(s); } @@ -1325,7 +1325,7 @@ axe_init(void *xsc) splx(s); - timeout_add(&sc->axe_stat_ch, hz); + timeout_add_sec(&sc->axe_stat_ch, 1); return; } diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index b84ecbd528e..8b6df602f65 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.48 2007/11/23 15:43:02 mbalmer Exp $ */ +/* $OpenBSD: if_cue.c,v 1.49 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1056,7 +1056,7 @@ cue_init(void *xsc) splx(s); - timeout_add(&sc->cue_stat_ch, hz); + timeout_add_sec(&sc->cue_stat_ch, 1); } int diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 028ddc22dde..8b6628e3d2e 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.40 2007/11/23 15:43:02 mbalmer Exp $ */ +/* $OpenBSD: if_udav.c,v 1.41 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -683,7 +683,7 @@ udav_init(struct ifnet *ifp) splx(s); - timeout_add(&sc->sc_stat_ch, hz); + timeout_add_sec(&sc->sc_stat_ch, 1); return (0); } @@ -1497,7 +1497,7 @@ udav_tick_task(void *xsc) udav_start(ifp); } - timeout_add(&sc->sc_stat_ch, hz); + timeout_add_sec(&sc->sc_stat_ch, 1); splx(s); } diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index dff0568c6c4..2d9b1e87e39 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.50 2007/11/23 15:43:02 mbalmer Exp $ */ +/* $OpenBSD: if_url.c,v 1.51 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -574,7 +574,7 @@ url_init(struct ifnet *ifp) splx(s); - timeout_add(&sc->sc_stat_ch, hz); + timeout_add_sec(&sc->sc_stat_ch, 1); return (0); } @@ -1381,7 +1381,7 @@ url_tick_task(void *xsc) url_start(ifp); } - timeout_add(&sc->sc_stat_ch, hz); + timeout_add_sec(&sc->sc_stat_ch, 1); splx(s); } diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 6f99c172624..6a984bd2c6b 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.87 2008/06/29 10:04:15 yuo Exp $ */ +/* $OpenBSD: ohci.c,v 1.88 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ @@ -1181,7 +1181,7 @@ ohci_intr1(ohci_softc_t *sc) sc->sc_bus.bdev.dv_xname)); /* Do not allow RHSC interrupts > 1 per second */ - timeout_add(&sc->sc_tmo_rhsc, hz); + timeout_add_sec(&sc->sc_tmo_rhsc, 1); eintrs &= ~OHCI_RHSC; } diff --git a/sys/dev/usb/umbg.c b/sys/dev/usb/umbg.c index 3f11ca01da5..ae714b9565a 100644 --- a/sys/dev/usb/umbg.c +++ b/sys/dev/usb/umbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umbg.c,v 1.6 2007/11/23 16:34:47 mbalmer Exp $ */ +/* $OpenBSD: umbg.c,v 1.7 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org> @@ -177,7 +177,6 @@ umbg_attach(struct device *parent, struct device *self, void *aux) struct usb_attach_arg *uaa = aux; usbd_device_handle dev = uaa->device; usbd_interface_handle iface = uaa->iface; - struct timeval t; struct mbg_time tframe; usb_endpoint_descriptor_t *ed; usbd_status err; @@ -284,13 +283,9 @@ umbg_attach(struct device *parent, struct device *self, void *aux) usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, &sc->sc_dev); - /* convert timevals to hz */ - t.tv_sec = 5L; - t.tv_usec = 0L; - t_wait = tvtohz(&t); + t_wait = 5; - t.tv_sec = TRUSTTIME; - t_trust = tvtohz(&t); + t_trust = TRUSTTIME; usb_add_task(sc->sc_udev, &sc->sc_task); return; @@ -380,7 +375,7 @@ umbg_task(void *arg) if (sc->sc_timedelta.status == SENSOR_S_UNKNOWN || !(letoh16(tframe.status) & MBG_FREERUN)) { sc->sc_timedelta.status = SENSOR_S_OK; - timeout_add(&sc->sc_it_to, t_trust); + timeout_add_sec(&sc->sc_it_to, t_trust); } sc->sc_timedelta.tv.tv_sec = tstamp.tv_sec; @@ -399,7 +394,7 @@ umbg_task(void *arg) sc->sc_signal.tv.tv_usec = sc->sc_timedelta.tv.tv_usec; bail_out: - timeout_add(&sc->sc_to, t_wait); + timeout_add_sec(&sc->sc_to, t_wait); } @@ -456,7 +451,7 @@ umbg_it_intr(void *xsc) * further degrade in TRUSTTIME seconds if the clocks remains * free running. */ - timeout_add(&sc->sc_it_to, t_trust); + timeout_add_sec(&sc->sc_it_to, t_trust); } else sc->sc_timedelta.status = SENSOR_S_CRIT; } diff --git a/sys/dev/vmt.c b/sys/dev/vmt.c index 5b0264f8f72..b40bcc08995 100644 --- a/sys/dev/vmt.c +++ b/sys/dev/vmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmt.c,v 1.2 2008/07/12 23:17:33 ckuethe Exp $ */ +/* $OpenBSD: vmt.c,v 1.3 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2007 David Crawshaw <david@zentus.com> @@ -247,7 +247,7 @@ vmt_attach(struct device *parent, struct device *self, void *aux) sensordev_install(&sc->sc_sensordev); timeout_set(&sc->sc_tick, vmt_tick, sc); - timeout_add(&sc->sc_tick, hz); + timeout_add_sec(&sc->sc_tick, 1); printf("\n"); return; @@ -340,7 +340,7 @@ vmt_tick(void *xarg) printf("%s: \"%s\"\n", DEVNAME(sc), sc->sc_rpc_buf); out: - timeout_add(&sc->sc_tick, hz * 15); + timeout_add_sec(&sc->sc_tick, 15); } #define BACKDOOR_OP(op, frame) \ diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c index 41c8a1589fe..c5a5378b464 100644 --- a/sys/dev/wscons/wsdisplay_compat_usl.c +++ b/sys/dev/wscons/wsdisplay_compat_usl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay_compat_usl.c,v 1.19 2007/02/14 01:12:16 jsg Exp $ */ +/* $OpenBSD: wsdisplay_compat_usl.c,v 1.20 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: wsdisplay_compat_usl.c,v 1.12 2000/03/23 07:01:47 thorpej Exp $ */ /* @@ -188,7 +188,7 @@ usl_detachproc(cookie, waitok, callback, cbarg) sd->s_cbarg = cbarg; sd->s_flags |= SF_DETACHPENDING; psignal(sd->s_proc, sd->s_relsig); - timeout_add(&sd->s_detach_ch, wscompat_usl_synctimeout * hz); + timeout_add_sec(&sd->s_detach_ch, wscompat_usl_synctimeout); return (EAGAIN); } @@ -253,7 +253,7 @@ usl_attachproc(cookie, waitok, callback, cbarg) sd->s_cbarg = cbarg; sd->s_flags |= SF_ATTACHPENDING; psignal(sd->s_proc, sd->s_acqsig); - timeout_add(&sd->s_attach_ch, wscompat_usl_synctimeout * hz); + timeout_add_sec(&sd->s_attach_ch, wscompat_usl_synctimeout); return (EAGAIN); } diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 6c804a6f178..69a534fd63b 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.21 2007/07/03 03:22:34 cnst Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.22 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -255,6 +255,6 @@ sensor_task_work(void *xst, void *arg) wakeup(st); } else { st->state = ST_TICKING; - timeout_add(&st->timeout, hz * st->period); + timeout_add_sec(&st->timeout, st->period); } } diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index e7babbb88ed..0de34540858 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sched_bsd.c,v 1.17 2008/07/18 23:43:31 art Exp $ */ +/* $OpenBSD: sched_bsd.c,v 1.18 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -269,7 +269,7 @@ schedcpu(void *arg) } uvm_meter(); wakeup(&lbolt); - timeout_add(to, hz); + timeout_add_sec(to, 1); } /* diff --git a/sys/kern/tty_msts.c b/sys/kern/tty_msts.c index 660e9e2a0ee..5aa03c54376 100644 --- a/sys/kern/tty_msts.c +++ b/sys/kern/tty_msts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_msts.c,v 1.4 2008/06/11 17:11:36 mbalmer Exp $ */ +/* $OpenBSD: tty_msts.c,v 1.5 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org> @@ -53,7 +53,6 @@ void mstsattach(int); #endif int msts_count, msts_nxid; -static int t_trust; struct msts { char cbuf[MSTSMAX]; /* receive buffer */ @@ -92,7 +91,6 @@ mstsopen(dev_t dev, struct tty *tp) { struct proc *p = curproc; struct msts *np; - struct timeval t; int error; DPRINTF(("mstsopen\n")); @@ -128,11 +126,6 @@ mstsopen(dev_t dev, struct tty *tp) } else { sensordev_install(&np->timedev); timeout_set(&np->msts_tout, msts_timeout, np); - - /* convert timevals to hz */ - t.tv_sec = TRUSTTIME; - t.tv_usec = 0; - t_trust = tvtohz(&t); } return error; @@ -280,7 +273,7 @@ msts_decode(struct msts *np, struct tty *tp, char *fld[], int fldcnt) #ifdef MSTS_DEBUG if (np->time.status == SENSOR_S_UNKNOWN) { np->time.status = SENSOR_S_OK; - timeout_add(&np->msts_tout, t_trust); + timeout_add_sec(&np->msts_tout, TRUSTTIME); } np->gapno = 0; #endif @@ -305,7 +298,7 @@ msts_decode(struct msts *np, struct tty *tp, char *fld[], int fldcnt) if (fld[3][0] == ' ' && fld[3][1] == ' ') { np->time.status = SENSOR_S_OK; np->signal.status = SENSOR_S_OK; - timeout_add(&np->msts_tout, t_trust); + timeout_add_sec(&np->msts_tout, TRUSTTIME); } else np->signal.status = SENSOR_S_WARN; @@ -428,7 +421,7 @@ msts_timeout(void *xnp) * further degrade in TRUSTTIME seconds if no new valid MSTS * strings are received. */ - timeout_add(&np->msts_tout, t_trust); + timeout_add_sec(&np->msts_tout, TRUSTTIME); } else np->time.status = SENSOR_S_CRIT; } diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c index 1e52d855575..c84834cc369 100644 --- a/sys/kern/tty_nmea.c +++ b/sys/kern/tty_nmea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_nmea.c,v 1.30 2008/07/22 06:06:47 mbalmer Exp $ */ +/* $OpenBSD: tty_nmea.c,v 1.31 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org> @@ -50,7 +50,6 @@ void nmeaattach(int); #endif int nmea_count, nmea_nxid; -static int t_trust; struct nmea { char cbuf[NMEAMAX]; /* receive buffer */ @@ -97,7 +96,6 @@ nmeaopen(dev_t dev, struct tty *tp) { struct proc *p = curproc; struct nmea *np; - struct timeval t; int error; if (tp->t_line == NMEADISC) @@ -130,11 +128,6 @@ nmeaopen(dev_t dev, struct tty *tp) } else { sensordev_install(&np->timedev); timeout_set(&np->nmea_tout, nmea_timeout, np); - - /* convert timevals to hz */ - t.tv_sec = TRUSTTIME; - t.tv_usec = 0; - t_trust = tvtohz(&t); } return error; } @@ -317,7 +310,7 @@ nmea_gprmc(struct nmea *np, struct tty *tp, char *fld[], int fldcnt) #ifdef NMEA_DEBUG if (np->time.status == SENSOR_S_UNKNOWN) { np->time.status = SENSOR_S_OK; - timeout_add(&np->nmea_tout, t_trust); + timeout_add_sec(&np->nmea_tout, TRUSTTIME); } np->gapno = 0; if (nmeadebug > 0) { @@ -373,7 +366,7 @@ nmea_gprmc(struct nmea *np, struct tty *tp, char *fld[], int fldcnt) case 'A': /* The GPS has a fix, (re)arm the timeout. */ np->time.status = SENSOR_S_OK; np->signal.status = SENSOR_S_OK; - timeout_add(&np->nmea_tout, t_trust); + timeout_add_sec(&np->nmea_tout, TRUSTTIME); break; case 'V': /* * The GPS indicates a warning status, do not add to @@ -547,7 +540,7 @@ nmea_timeout(void *xnp) * further degrade in TRUSTTIME seconds if no new valid NMEA * sentences are received. */ - timeout_add(&np->nmea_tout, t_trust); + timeout_add_sec(&np->nmea_tout, TRUSTTIME); } else np->time.status = SENSOR_S_CRIT; } diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 3685e96609f..5cba8f9201d 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.35 2008/08/07 18:09:22 damien Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.36 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -1762,7 +1762,7 @@ bstp_tick(void *arg) } if (bs->bs_ifp->if_flags & IFF_RUNNING) - timeout_add(&bs->bs_bstptimeout, hz); + timeout_add_sec(&bs->bs_bstptimeout, 1); splx(s); } @@ -1923,7 +1923,7 @@ bstp_initialization(struct bstp_state *bs) timeout_set(&bs->bs_bstptimeout, bstp_tick, bs); if (bs->bs_ifflags & IFF_RUNNING && !timeout_pending(&bs->bs_bstptimeout)) - timeout_add(&bs->bs_bstptimeout, hz); + timeout_add_sec(&bs->bs_bstptimeout, 1); LIST_FOREACH(bp, &bs->bs_bplist, bp_next) { bp->bp_port_id = (bp->bp_priority << 8) | diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 68137511536..96ee7a54158 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.171 2008/09/02 17:35:16 chl Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.172 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -601,7 +601,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } sc->sc_brttimeout = bparam->ifbrp_ctime; if (bparam->ifbrp_ctime != 0) - timeout_add(&sc->sc_brtimeout, sc->sc_brttimeout * hz); + timeout_add_sec(&sc->sc_brtimeout, sc->sc_brttimeout); else timeout_del(&sc->sc_brtimeout); break; @@ -965,7 +965,7 @@ bridge_init(struct bridge_softc *sc) bstp_initialization(sc->sc_stp); if (sc->sc_brttimeout != 0) - timeout_add(&sc->sc_brtimeout, sc->sc_brttimeout * hz); + timeout_add_sec(&sc->sc_brtimeout, sc->sc_brttimeout); } /* @@ -1903,7 +1903,7 @@ bridge_rtage(struct bridge_softc *sc) } if (sc->sc_brttimeout != 0) - timeout_add(&sc->sc_brtimeout, sc->sc_brttimeout * hz); + timeout_add_sec(&sc->sc_brtimeout, sc->sc_brttimeout); } void diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 8c322ad512a..256c4b36823 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.99 2008/09/02 17:35:16 chl Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.100 2008/09/10 14:01:23 blambert Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -881,7 +881,7 @@ pfsync_input(struct mbuf *m, ...) printf("pfsync: received " "bulk update request\n"); pfsync_send_bus(sc, PFSYNC_BUS_START); - timeout_add(&sc->sc_bulk_tmo, 1 * hz); + timeout_add_sec(&sc->sc_bulk_tmo, 1); } else { st = pf_find_state_byid(&id_key); if (st == NULL) { @@ -1098,7 +1098,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) pfsync_sync_ok = 0; if (pf_status.debug >= PF_DEBUG_MISC) printf("pfsync: requesting bulk update\n"); - timeout_add(&sc->sc_bulkfail_tmo, 5 * hz); + timeout_add_sec(&sc->sc_bulkfail_tmo, 5); error = pfsync_request_update(NULL, NULL); if (error == ENOMEM) { splx(s); @@ -1203,9 +1203,9 @@ pfsync_get_mbuf(struct pfsync_softc *sc, u_int8_t action, void **sp) *sp = (void *)((char *)h + PFSYNC_HDRLEN); if (action == PFSYNC_ACT_TDB_UPD) - timeout_add(&sc->sc_tdb_tmo, hz); + timeout_add_sec(&sc->sc_tdb_tmo, 1); else - timeout_add(&sc->sc_tmo, hz); + timeout_add_sec(&sc->sc_tmo, 1); return (m); } @@ -1555,7 +1555,7 @@ pfsync_bulkfail(void *v) if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) { /* Try again in a bit */ - timeout_add(&sc->sc_bulkfail_tmo, 5 * hz); + timeout_add_sec(&sc->sc_bulkfail_tmo, 5); s = splnet(); error = pfsync_request_update(NULL, NULL); if (error == ENOMEM) { diff --git a/sys/net/if_strip.c b/sys/net/if_strip.c index ef50f71c949..791781ed5b4 100644 --- a/sys/net/if_strip.c +++ b/sys/net/if_strip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_strip.c,v 1.33 2007/11/27 16:22:13 martynas Exp $ */ +/* $OpenBSD: if_strip.c,v 1.34 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_strip.c,v 1.2.4.3 1996/08/03 00:58:32 jtc Exp $ */ /* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */ @@ -1028,7 +1028,7 @@ stripstart(tp) #if 0 /* schedule timeout to start output */ if ((sc->sc_flags & SC_TIMEOUT) == 0) { - timeout_add(&sc->sc_timo, hz); + timeout_add_sec(&sc->sc_timo, 1); sc->sc_flags |= SC_TIMEOUT; } #endif @@ -1040,7 +1040,7 @@ stripstart(tp) * after it has drained the t_outq. */ if ((sc->sc_flags & SC_TIMEOUT) == 0) { - timeout_add(&sc->sc_timo, hz); + timeout_add_sec(&sc->sc_timo, 1); sc->sc_flags |= SC_TIMEOUT; } #endif diff --git a/sys/net/route.c b/sys/net/route.c index b2679198127..74ee0fe4d47 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.96 2008/08/07 21:32:08 claudio Exp $ */ +/* $OpenBSD: route.c,v 1.97 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1110,7 +1110,7 @@ rt_timer_init() LIST_INIT(&rttimer_queue_head); timeout_set(&rt_timer_timeout, rt_timer_timer, &rt_timer_timeout); - timeout_add(&rt_timer_timeout, hz); /* every second */ + timeout_add_sec(&rt_timer_timeout, 1); rt_init_done = 1; } @@ -1277,7 +1277,7 @@ rt_timer_timer(void *arg) } splx(s); - timeout_add(to, hz); /* every second */ + timeout_add_sec(to, 1); } u_int16_t diff --git a/sys/netbt/hci_link.c b/sys/netbt/hci_link.c index 642d87af21d..b6d9a3e2b70 100644 --- a/sys/netbt/hci_link.c +++ b/sys/netbt/hci_link.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hci_link.c,v 1.7 2008/02/24 21:34:48 uwe Exp $ */ +/* $OpenBSD: hci_link.c,v 1.8 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: hci_link.c,v 1.16 2007/11/10 23:12:22 plunky Exp $ */ /*- @@ -155,7 +155,7 @@ hci_acl_close(struct hci_link *link, int err) if (link->hl_state == HCI_LINK_CLOSED) hci_link_free(link, err); else if (hci_acl_expiry > 0) - timeout_add(&link->hl_expire, hci_acl_expiry * hz); + timeout_add_sec(&link->hl_expire, hci_acl_expiry); } } @@ -185,7 +185,7 @@ hci_acl_newconn(struct hci_unit *unit, bdaddr_t *bdaddr) bdaddr_copy(&link->hl_bdaddr, bdaddr); if (hci_acl_expiry > 0) - timeout_add(&link->hl_expire, hci_acl_expiry * hz); + timeout_add_sec(&link->hl_expire, hci_acl_expiry); } return link; diff --git a/sys/netbt/l2cap_misc.c b/sys/netbt/l2cap_misc.c index cdc3270f448..9305b8cd7c7 100644 --- a/sys/netbt/l2cap_misc.c +++ b/sys/netbt/l2cap_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l2cap_misc.c,v 1.4 2008/06/08 21:10:28 claudio Exp $ */ +/* $OpenBSD: l2cap_misc.c,v 1.5 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: l2cap_misc.c,v 1.5 2007/11/03 17:20:17 plunky Exp $ */ /*- @@ -137,7 +137,7 @@ l2cap_request_alloc(struct l2cap_channel *chan, uint8_t code) req->lr_link = link; timeout_set(&req->lr_rtx, l2cap_rtx, req); - timeout_add(&req->lr_rtx, l2cap_response_timeout*hz); + timeout_add_sec(&req->lr_rtx, l2cap_response_timeout); TAILQ_INSERT_TAIL(&link->hl_reqs, req, lr_next); diff --git a/sys/netbt/rfcomm_dlc.c b/sys/netbt/rfcomm_dlc.c index 2d7a7b40374..95be78bcfa8 100644 --- a/sys/netbt/rfcomm_dlc.c +++ b/sys/netbt/rfcomm_dlc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfcomm_dlc.c,v 1.2 2008/02/24 21:34:48 uwe Exp $ */ +/* $OpenBSD: rfcomm_dlc.c,v 1.3 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: rfcomm_dlc.c,v 1.4 2007/11/03 17:20:17 plunky Exp $ */ /*- @@ -176,8 +176,7 @@ rfcomm_dlc_close(struct rfcomm_dlc *dlc, int err) if (rs->rs_state == RFCOMM_SESSION_LISTEN) rfcomm_session_free(rs); else - timeout_add(&rs->rs_timeout, - rfcomm_ack_timeout * hz); + timeout_add_sec(&rs->rs_timeout, rfcomm_ack_timeout); } } @@ -274,7 +273,7 @@ rfcomm_dlc_connect(struct rfcomm_dlc *dlc) return err; dlc->rd_state = RFCOMM_DLC_WAIT_CONNECT; - timeout_add(&dlc->rd_timeout, rfcomm_mcc_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, rfcomm_mcc_timeout); return 0; } @@ -303,7 +302,7 @@ rfcomm_dlc_open(struct rfcomm_dlc *dlc) if (err) return err; - timeout_add(&dlc->rd_timeout, rfcomm_mcc_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, rfcomm_mcc_timeout); dlc->rd_state = RFCOMM_DLC_OPEN; (*dlc->rd_proto->connected)(dlc->rd_upper); diff --git a/sys/netbt/rfcomm_session.c b/sys/netbt/rfcomm_session.c index b05c9257975..fca87af3144 100644 --- a/sys/netbt/rfcomm_session.c +++ b/sys/netbt/rfcomm_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfcomm_session.c,v 1.3 2008/02/24 21:34:48 uwe Exp $ */ +/* $OpenBSD: rfcomm_session.c,v 1.4 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: rfcomm_session.c,v 1.12 2008/01/31 19:30:23 plunky Exp $ */ /*- @@ -367,7 +367,7 @@ rfcomm_session_connected(void *arg) if (err) rfcomm_session_disconnected(rs, err); - timeout_add(&rs->rs_timeout, rfcomm_ack_timeout * hz); + timeout_add_sec(&rs->rs_timeout, rfcomm_ack_timeout); } } @@ -419,7 +419,7 @@ rfcomm_session_newconn(void *arg, struct sockaddr_bt *laddr, * schedule an expiry so that if nothing comes of it we * can punt. */ - timeout_add(&new->rs_timeout, rfcomm_mcc_timeout * hz); + timeout_add_sec(&new->rs_timeout, rfcomm_mcc_timeout); return new->rs_l2cap; } @@ -469,8 +469,8 @@ rfcomm_session_complete(void *arg, int count) dlc->rd_state = RFCOMM_DLC_WAIT_DISCONNECT; rfcomm_session_send_frame(rs, RFCOMM_FRAME_DISC, dlc->rd_dlci); - timeout_add(&dlc->rd_timeout, - rfcomm_ack_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, + rfcomm_ack_timeout); } } @@ -529,8 +529,8 @@ rfcomm_session_linkmode(void *arg, int new) rfcomm_dlc_close(dlc, err); } else { dlc->rd_state = RFCOMM_DLC_WAIT_RECV_UA; - timeout_add(&dlc->rd_timeout, - rfcomm_ack_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, + rfcomm_ack_timeout); break; } } @@ -544,7 +544,7 @@ rfcomm_session_linkmode(void *arg, int new) rs->rs_state = RFCOMM_SESSION_WAIT_DISCONNECT; rfcomm_session_send_frame(rs, RFCOMM_FRAME_DISC, 0); - timeout_add(&rs->rs_timeout, rfcomm_ack_timeout * hz); + timeout_add_sec(&rs->rs_timeout, rfcomm_ack_timeout); break; case RFCOMM_DLC_WAIT_SEND_UA: /* they are connecting */ @@ -875,7 +875,7 @@ check: /* last one out turns out the light */ if (LIST_EMPTY(&rs->rs_dlcs)) { rs->rs_state = RFCOMM_SESSION_WAIT_DISCONNECT; rfcomm_session_send_frame(rs, RFCOMM_FRAME_DISC, 0); - timeout_add(&rs->rs_timeout, rfcomm_ack_timeout * hz); + timeout_add_sec(&rs->rs_timeout, rfcomm_ack_timeout); } } @@ -1369,8 +1369,7 @@ rfcomm_session_recv_mcc_pn(struct rfcomm_session *rs, int cr, struct mbuf *m) if (err) goto close; - timeout_add(&dlc->rd_timeout, - rfcomm_ack_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, rfcomm_ack_timeout); return; } dlc->rd_mtu = pn.mtu; @@ -1385,7 +1384,7 @@ rfcomm_session_recv_mcc_pn(struct rfcomm_session *rs, int cr, struct mbuf *m) dlc->rd_txcred = (pn.credits & 0x07); } - timeout_add(&dlc->rd_timeout, rfcomm_ack_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, rfcomm_ack_timeout); /* set link mode */ err = rfcomm_dlc_setmode(dlc); diff --git a/sys/netbt/rfcomm_upper.c b/sys/netbt/rfcomm_upper.c index 741b229d671..76480ac8633 100644 --- a/sys/netbt/rfcomm_upper.c +++ b/sys/netbt/rfcomm_upper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfcomm_upper.c,v 1.4 2008/02/24 21:34:48 uwe Exp $ */ +/* $OpenBSD: rfcomm_upper.c,v 1.5 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: rfcomm_upper.c,v 1.10 2007/11/20 20:25:57 plunky Exp $ */ /*- @@ -247,7 +247,7 @@ rfcomm_disconnect(struct rfcomm_dlc *dlc, int linger) dlc->rd_state = RFCOMM_DLC_WAIT_DISCONNECT; err = rfcomm_session_send_frame(rs, RFCOMM_FRAME_DISC, dlc->rd_dlci); - timeout_add(&dlc->rd_timeout, rfcomm_ack_timeout * hz); + timeout_add_sec(&dlc->rd_timeout, rfcomm_ack_timeout); break; case RFCOMM_DLC_WAIT_DISCONNECT: diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 60d0ec86fd1..b1edb2a8097 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.75 2008/06/06 13:29:43 henning Exp $ */ +/* $OpenBSD: if_ether.c,v 1.76 2008/09/10 14:01:23 blambert Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -120,7 +120,7 @@ arptimer(arg) struct llinfo_arp *la, *nla; s = splsoftnet(); - timeout_add(to, arpt_prune * hz); + timeout_add_sec(to, arpt_prune); for (la = LIST_FIRST(&llinfo_arp); la != LIST_END(&llinfo_arp); la = nla) { struct rtentry *rt = la->la_rt; @@ -160,7 +160,7 @@ arp_rtrequest(req, rt, info) } timeout_set(&arptimer_to, arptimer, &arptimer_to); - timeout_add(&arptimer_to, hz); + timeout_add_sec(&arptimer_to, 1); } if (rt->rt_flags & RTF_GATEWAY) { diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 307aa0ab529..c0e7486c3c0 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.171 2008/04/18 06:42:20 djm Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.172 2008/09/10 14:01:23 blambert Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -262,8 +262,8 @@ reserve_spi(u_int32_t sspi, u_int32_t tspi, union sockaddr_union *src, if (ipsec_keep_invalid > 0) { tdbp->tdb_flags |= TDBF_TIMER; tdbp->tdb_exp_timeout = ipsec_keep_invalid; - timeout_add(&tdbp->tdb_timer_tmo, - hz * ipsec_keep_invalid); + timeout_add_sec(&tdbp->tdb_timer_tmo, + ipsec_keep_invalid); } return spi; diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c index a9414995ae9..921f7b84b42 100644 --- a/sys/netinet/ip_spd.c +++ b/sys/netinet/ip_spd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_spd.c,v 1.57 2008/07/22 09:26:39 bluhm Exp $ */ +/* $OpenBSD: ip_spd.c,v 1.58 2008/09/10 14:01:23 blambert Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -877,7 +877,7 @@ ipsp_acquire_sa(struct ipsec_policy *ipo, union sockaddr_union *gw, return 0; } - timeout_add(&ipa->ipa_timeout, ipsec_expire_acquire * hz); + timeout_add_sec(&ipa->ipa_timeout, ipsec_expire_acquire); TAILQ_INSERT_TAIL(&ipsec_acquire_head, ipa, ipa_next); TAILQ_INSERT_TAIL(&ipo->ipo_acquires, ipa, ipa_ipo_next); |