diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2009-01-21 21:54:01 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2009-01-21 21:54:01 +0000 |
commit | ebcf515942389f0e738f6323c8b553ceabee63f1 (patch) | |
tree | 02576077cba384aac928f4d78d19526d93f75d7b /sys | |
parent | 170b1962e3648be5d4b991579d61efbc60a24fd2 (diff) |
Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).
No functional changes.
ok krw@ miod@
Diffstat (limited to 'sys')
33 files changed, 85 insertions, 96 deletions
diff --git a/sys/dev/adb/akbd.c b/sys/dev/adb/akbd.c index 938a9b25a1e..af1bbd19556 100644 --- a/sys/dev/adb/akbd.c +++ b/sys/dev/adb/akbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: akbd.c,v 1.6 2007/03/13 20:56:56 miod Exp $ */ +/* $OpenBSD: akbd.c,v 1.7 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: akbd.c,v 1.17 2005/01/15 16:00:59 chs Exp $ */ /* @@ -449,7 +449,7 @@ akbd_rawrepeat(void *v) s = spltty(); wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep); splx(s); - timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAYN / 1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAYN); } #endif @@ -576,7 +576,7 @@ akbd_input(struct akbd_softc *sc, int key) timeout_del(&sc->sc_rawrepeat_ch); sc->sc_nrep = npress; if (npress != 0) - timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAY1/1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1); #endif } else { wskbd_input(sc->sc_wskbddev, type, val); diff --git a/sys/dev/ata/ata_wdc.c b/sys/dev/ata/ata_wdc.c index fe05bc10e79..a4a247b8795 100644 --- a/sys/dev/ata/ata_wdc.c +++ b/sys/dev/ata/ata_wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ata_wdc.c,v 1.32 2008/06/27 06:03:08 ray Exp $ */ +/* $OpenBSD: ata_wdc.c,v 1.33 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: ata_wdc.c,v 1.21 1999/08/09 09:43:11 bouyer Exp $ */ /* @@ -160,7 +160,7 @@ wdc_ata_bio_start(struct channel_softc *chp, struct wdc_xfer *xfer) /* start timeout machinery */ if ((ata_bio->flags & ATA_POLL) == 0) - timeout_add(&chp->ch_timo, ATA_DELAY / 1000 * hz); + timeout_add_msec(&chp->ch_timo, ATA_DELAY); _wdc_ata_bio_start(chp, xfer); } diff --git a/sys/dev/bluetooth/btkbd.c b/sys/dev/bluetooth/btkbd.c index b67459b625d..863f6c551ad 100644 --- a/sys/dev/bluetooth/btkbd.c +++ b/sys/dev/bluetooth/btkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btkbd.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */ +/* $OpenBSD: btkbd.c,v 1.5 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: btkbd.c,v 1.10 2008/09/09 03:54:56 cube Exp $ */ /* @@ -551,7 +551,7 @@ btkbd_input(struct bthidev *self, uint8_t *data, int len) timeout_del(&sc->sc_repeat); if (npress != 0) { sc->sc_nrep = npress; - timeout_add(&sc->sc_repeat, hz * REP_DELAY1 / 1000); + timeout_add_msec(&sc->sc_repeat, REP_DELAY1); } #endif return; @@ -579,7 +579,7 @@ btkbd_repeat(void *arg) s = spltty(); wskbd_rawinput(sc->sc_wskbd, sc->sc_rep, sc->sc_nrep); splx(s); - timeout_add(&sc->sc_repeat, hz * REP_DELAYN / 1000); + timeout_add_msec(&sc->sc_repeat, REP_DELAYN); } #endif #endif diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c index e45e16209be..588d97b12d7 100644 --- a/sys/dev/eisa/aha1742.c +++ b/sys/dev/eisa/aha1742.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha1742.c,v 1.29 2009/01/11 16:54:59 blambert Exp $ */ +/* $OpenBSD: aha1742.c,v 1.30 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: aha1742.c,v 1.61 1996/05/12 23:40:01 mycroft Exp $ */ /* @@ -990,7 +990,7 @@ ahb_scsi_cmd(xs) if ((flags & SCSI_POLL) == 0) { splx(s); - timeout_add(&ecb->xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&ecb->xs->stimeout, xs->timeout); return SUCCESSFULLY_QUEUED; } @@ -1106,7 +1106,7 @@ ahb_scsi_cmd(xs) */ if ((flags & SCSI_POLL) == 0) { splx(s); - timeout_add(&ecb->xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&ecb->xs->stimeout, xs->timeout); return SUCCESSFULLY_QUEUED; } diff --git a/sys/dev/eisa/uha_eisa.c b/sys/dev/eisa/uha_eisa.c index 978ee42916b..9ce0016f8d3 100644 --- a/sys/dev/eisa/uha_eisa.c +++ b/sys/dev/eisa/uha_eisa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uha_eisa.c,v 1.7 2007/11/05 17:54:27 krw Exp $ */ +/* $OpenBSD: uha_eisa.c,v 1.8 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: uha_eisa.c,v 1.5 1996/10/21 22:31:07 thorpej Exp $ */ /* @@ -247,7 +247,7 @@ u24_start_mbox(sc, mscp) bus_space_write_1(iot, ioh, U24_LINT, U24_OGMFULL); if ((mscp->xs->flags & SCSI_POLL) == 0) - timeout_add(&mscp->xs->stimeout, (mscp->timeout * hz) / 1000); + timeout_add_msec(&mscp->xs->stimeout, mscp->timeout); } int diff --git a/sys/dev/hil/hilkbd.c b/sys/dev/hil/hilkbd.c index d473551c270..17b680acaef 100644 --- a/sys/dev/hil/hilkbd.c +++ b/sys/dev/hil/hilkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hilkbd.c,v 1.13 2006/08/10 23:43:45 miod Exp $ */ +/* $OpenBSD: hilkbd.c,v 1.14 2009/01/21 21:53:59 grange Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -436,8 +436,7 @@ hilkbd_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf) timeout_del(&sc->sc_rawrepeat_ch); sc->sc_nrep = npress; if (npress != 0) { - timeout_add(&sc->sc_rawrepeat_ch, - (hz * REP_DELAY1) / 1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1); } } else #endif @@ -492,6 +491,6 @@ hilkbd_rawrepeat(void *v) s = spltty(); wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep); splx(s); - timeout_add(&sc->sc_rawrepeat_ch, (hz * REP_DELAYN) / 1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAYN); } #endif diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c index 071f8d6a46d..6f539f79246 100644 --- a/sys/dev/i2o/ioprbs.c +++ b/sys/dev/i2o/ioprbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioprbs.c,v 1.14 2008/11/25 17:52:02 krw Exp $ */ +/* $OpenBSD: ioprbs.c,v 1.15 2009/01/21 21:53:59 grange Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -859,8 +859,7 @@ ioprbs_start_ccbs(sc) ccb->ic_flags |= IOPRBS_ICF_WATCHDOG; timeout_set(&ccb->ic_xs->stimeout, ioprbs_watchdog, ccb); - timeout_add(&xs->stimeout, - (IOPRBS_WATCH_TIMEOUT * hz) / 1000); + timeout_add_msec(&xs->stimeout, IOPRBS_WATCH_TIMEOUT); break; } TAILQ_REMOVE(&sc->sc_ccbq, ccb, ic_chain); @@ -868,8 +867,7 @@ ioprbs_start_ccbs(sc) if ((xs->flags & SCSI_POLL) == 0) { timeout_set(&ccb->ic_xs->stimeout, ioprbs_timeout, ccb); - timeout_add(&xs->stimeout, - (ccb->ic_timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->ic_timeout); } } } diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index 808f946707f..69dfd70cdaf 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adv.c,v 1.22 2008/11/26 16:38:00 krw Exp $ */ +/* $OpenBSD: adv.c,v 1.23 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */ /* @@ -320,15 +320,14 @@ adv_start_ccbs(sc) if (AscExeScsiQueue(sc, &ccb->scsiq) == ASC_BUSY) { ccb->flags |= CCB_WATCHDOG; timeout_set(&xs->stimeout, adv_watchdog, ccb); - timeout_add(&xs->stimeout, - (ADV_WATCH_TIMEOUT * hz) / 1000); + timeout_add_msec(&xs->stimeout, ADV_WATCH_TIMEOUT); break; } TAILQ_REMOVE(&sc->sc_waiting_ccb, ccb, chain); if ((ccb->xs->flags & SCSI_POLL) == 0) { timeout_set(&xs->stimeout, adv_timeout, ccb); - timeout_add(&xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->timeout); } } } diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index 9146a660d38..eb5fa0742c9 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.36 2008/11/26 16:38:00 krw Exp $ */ +/* $OpenBSD: adw.c,v 1.37 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -407,7 +407,7 @@ adw_queue_ccb(sc, ccb, retry) /* ALWAYS initialize stimeout, lest it contain garbage! */ timeout_set(&ccb->xs->stimeout, adw_timeout, ccb); if ((ccb->xs->flags & SCSI_POLL) == 0) - timeout_add(&ccb->xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&ccb->xs->stimeout, ccb->timeout); } return(errcode); @@ -915,7 +915,7 @@ adw_timeout(arg) * by hand so the next time a timeout event will occur * we will reset the bus. */ - timeout_add(&xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->timeout); } else { /* * Abort the operation that has timed out. @@ -947,7 +947,7 @@ adw_timeout(arg) * by hand so to give a second opportunity to the command * which timed-out. */ - timeout_add(&xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->timeout); } splx(s); diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c index a7dc296b64c..0875c30220d 100644 --- a/sys/dev/ic/aic6360.c +++ b/sys/dev/ic/aic6360.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic6360.c,v 1.17 2008/11/24 00:31:35 krw Exp $ */ +/* $OpenBSD: aic6360.c,v 1.18 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: aic6360.c,v 1.52 1996/12/10 21:27:51 thorpej Exp $ */ #ifdef DDB @@ -1769,8 +1769,7 @@ loop: /* On our first connection, schedule a timeout. */ if ((acb->xs->flags & SCSI_POLL) == 0) - timeout_add(&acb->xs->stimeout, - (acb->timeout * hz) / 1000); + timeout_add_msec(&acb->xs->stimeout, acb->timeout); sc->sc_state = AIC_CONNECTED; } else if ((sstat1 & SELTO) != 0) { diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index 1185218ad77..aa6a80a5db8 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.30 2008/11/25 18:10:00 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.31 2009/01/21 21:53:59 grange Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -459,7 +459,7 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments) LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links); if (!(xs->flags & SCSI_POLL)) - timeout_add(&xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, xs->timeout); scb->flags |= SCB_ACTIVE; diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index 8e5b4937d15..fadb1c8afdc 100644 --- a/sys/dev/ic/aic7xxx_openbsd.c +++ b/sys/dev/ic/aic7xxx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.c,v 1.40 2008/11/25 18:10:00 krw Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.41 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -465,7 +465,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments) LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links); if (!(xs->flags & SCSI_POLL)) - timeout_add(&xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, xs->timeout); /* * We only allow one untagged transaction diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 25875cdc619..7aa923ae2d2 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ath.c,v 1.79 2008/10/15 19:12:19 blambert Exp $ */ +/* $OpenBSD: ath.c,v 1.80 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */ /*- @@ -3030,7 +3030,7 @@ ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) timeout_add(&sc->sc_rssadapt_to, hz / 10); } else if (nstate == IEEE80211_S_SCAN) { /* start ap/neighbor scan timer */ - timeout_add(&sc->sc_scan_to, (hz * ath_dwelltime) / 1000); + timeout_add_msec(&sc->sc_scan_to, ath_dwelltime); } bad: return error; diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index f1c2e55458b..df3570dfbe9 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.64 2008/11/28 02:44:17 brad Exp $ */ +/* $OpenBSD: atw.c,v 1.65 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -2519,7 +2519,7 @@ atw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) panic("%s: unexpected state IEEE80211_S_INIT", __func__); break; case IEEE80211_S_SCAN: - timeout_add(&sc->sc_scan_to, atw_dwelltime * hz / 1000); + timeout_add_msec(&sc->sc_scan_to, atw_dwelltime); break; case IEEE80211_S_RUN: if (ic->ic_opmode == IEEE80211_M_STA) diff --git a/sys/dev/ic/bha.c b/sys/dev/ic/bha.c index 00f36323c28..c6b0ddd6bf4 100644 --- a/sys/dev/ic/bha.c +++ b/sys/dev/ic/bha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bha.c,v 1.15 2008/11/26 16:38:00 krw Exp $ */ +/* $OpenBSD: bha.c,v 1.16 2009/01/21 21:53:59 grange Exp $ */ /* $NetBSD: bha.c,v 1.27 1998/11/19 21:53:00 thorpej Exp $ */ #undef BHADEBUG @@ -711,7 +711,7 @@ bha_start_ccbs(sc) bus_space_write_1(iot, ioh, BHA_CMD_PORT, BHA_START_SCSI); if ((xs->flags & SCSI_POLL) == 0) - timeout_add(&xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->timeout); ++sc->sc_mbofull; bha_nextmbx(wmbo, wmbx, mbo); diff --git a/sys/dev/ic/bwi.c b/sys/dev/ic/bwi.c index e0513a889cc..7dd98f81b78 100644 --- a/sys/dev/ic/bwi.c +++ b/sys/dev/ic/bwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwi.c,v 1.84 2009/01/07 01:07:03 jsg Exp $ */ +/* $OpenBSD: bwi.c,v 1.85 2009/01/21 21:53:59 grange Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -7452,7 +7452,7 @@ back: error = sc->sc_newstate(ic, nstate, arg); if (nstate == IEEE80211_S_SCAN) { - timeout_add(&sc->sc_scan_ch, (sc->sc_dwell_time * hz) / 1000); + timeout_add_msec(&sc->sc_scan_ch, sc->sc_dwell_time); } else if (nstate == IEEE80211_S_RUN) { /* XXX 15 seconds */ timeout_add_sec(&sc->sc_calib_ch, 1); diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index 3447d84c8cf..d88f5803868 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.43 2008/11/24 00:31:35 krw Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.44 2009/01/21 21:53:59 grange Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -1374,16 +1374,14 @@ gdt_start_ccbs(struct gdt_softc *sc) if (gdt_exec_ccb(ccb) == 0) { ccb->gc_flags |= GDT_GCF_WATCHDOG; timeout_set(&ccb->gc_xs->stimeout, gdt_watchdog, ccb); - timeout_add(&xs->stimeout, - (GDT_WATCH_TIMEOUT * hz) / 1000); + timeout_add_msec(&xs->stimeout, GDT_WATCH_TIMEOUT); break; } TAILQ_REMOVE(&sc->sc_ccbq, ccb, gc_chain); if ((xs->flags & SCSI_POLL) == 0) { timeout_set(&ccb->gc_xs->stimeout, gdt_timeout, ccb); - timeout_add(&xs->stimeout, - (ccb->gc_timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, ccb->gc_timeout); } } } diff --git a/sys/dev/ic/iha.c b/sys/dev/ic/iha.c index a1ff56956be..2ea843238e6 100644 --- a/sys/dev/ic/iha.c +++ b/sys/dev/ic/iha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iha.c,v 1.31 2008/11/24 00:31:35 krw Exp $ */ +/* $OpenBSD: iha.c,v 1.32 2009/01/21 21:54:00 grange Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -338,7 +338,7 @@ iha_scsi_cmd(xs) */ timeout_set(&xs->stimeout, iha_timeout, pScb); if ((pScb->SCB_Flags & SCSI_POLL) == 0) - timeout_add(&xs->stimeout, (xs->timeout/1000) * hz); + timeout_add_msec(&xs->stimeout, xs->timeout); iha_exec_scb(sc, pScb); @@ -877,8 +877,8 @@ iha_push_sense_request(sc, pScb) sensecmd->length = sizeof(pScb->SCB_ScsiSenseData); if ((pScb->SCB_Flags & SCSI_POLL) == 0) - timeout_add(&pScb->SCB_Xs->stimeout, - (pScb->SCB_Xs->timeout/1000) * hz); + timeout_add_msec(&pScb->SCB_Xs->stimeout, + pScb->SCB_Xs->timeout); iha_push_pend_scb(sc, pScb); diff --git a/sys/dev/ic/oosiop.c b/sys/dev/ic/oosiop.c index de9a1e9b2ae..ac6fe33be30 100644 --- a/sys/dev/ic/oosiop.c +++ b/sys/dev/ic/oosiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop.c,v 1.9 2008/05/27 21:08:48 kettenis Exp $ */ +/* $OpenBSD: oosiop.c,v 1.10 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */ /* @@ -799,7 +799,7 @@ oosiop_scsicmd(struct scsi_xfer *xs) oosiop_poll(sc, cb); else { /* start expire timer */ - timeout_add(&xs->stimeout, (xs->timeout / 1000) * hz); + timeout_add_msec(&xs->stimeout, xs->timeout); } if (xs->flags & (SCSI_POLL | ITSDONE)) @@ -1000,7 +1000,7 @@ FREE: TAILQ_INSERT_HEAD(&sc->sc_cbq, cb, chain); if ((cb->xs->flags & SCSI_POLL) == 0) { /* start expire timer */ - timeout_add(&xs->stimeout, (xs->timeout / 1000) * hz); + timeout_add_msec(&xs->stimeout, xs->timeout); } } } @@ -1243,8 +1243,7 @@ oosiop_processintr(struct oosiop_softc *sc, u_int8_t istat) /* Schedule timeout */ if ((cb->xs->flags & SCSI_POLL) == 0) { /* start expire timer */ - timeout_add(&cb->xs->stimeout, - (cb->xs->timeout / 1000) * hz); + timeout_add_msec(&cb->xs->stimeout, cb->xs->timeout); } } diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c index d514cfb67de..f0d0b8f39bb 100644 --- a/sys/dev/ic/osiop.c +++ b/sys/dev/ic/osiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop.c,v 1.35 2008/11/24 00:31:35 krw Exp $ */ +/* $OpenBSD: osiop.c,v 1.36 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */ /* @@ -449,7 +449,7 @@ osiop_scsicmd(xs) osiop_poll(sc, acb); else /* start expire timer */ - timeout_add(&xs->stimeout, (xs->timeout/1000) * hz); + timeout_add_msec(&xs->stimeout, xs->timeout); if (xs->flags & (SCSI_POLL | ITSDONE)) return (COMPLETE); @@ -748,7 +748,7 @@ FREE: TAILQ_INSERT_HEAD(&sc->ready_list, acb, chain); if (((acb->xsflags & SCSI_POLL) == 0) && ((sc->sc_flags & OSIOP_NODMA) == 0)) /* start expire timer */ - timeout_add(&xs->stimeout, (xs->timeout/1000) * hz); + timeout_add_msec(&xs->stimeout, xs->timeout); } osiop_sched(sc); diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index b10a9e63f40..13119b4348f 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtw.c,v 1.71 2008/11/28 02:44:17 brad Exp $ */ +/* $OpenBSD: rtw.c,v 1.72 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */ /*- @@ -3454,7 +3454,7 @@ rtw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) rtw_set_nettype(sc, IEEE80211_M_MONITOR); } - timeout_add(&sc->sc_scan_to, rtw_dwelltime * hz / 1000); + timeout_add_msec(&sc->sc_scan_to, rtw_dwelltime); break; case IEEE80211_S_RUN: diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index fc5e849e8f6..cb852822424 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.40 2008/11/23 12:46:51 dlg Exp $ */ +/* $OpenBSD: sili.c,v 1.41 2009/01/21 21:54:00 grange Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -863,7 +863,7 @@ sili_ata_cmd(struct ata_xfer *xa) return (ATA_COMPLETE); } - timeout_add(&xa->stimeout, (xa->timeout * hz) / 1000); + timeout_add_msec(&xa->stimeout, xa->timeout); s = splbio(); sili_start(sp, ccb); diff --git a/sys/dev/ic/trm.c b/sys/dev/ic/trm.c index 5b7b25dae19..60e19b88c77 100644 --- a/sys/dev/ic/trm.c +++ b/sys/dev/ic/trm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trm.c,v 1.10 2008/11/24 00:31:35 krw Exp $ +/* $OpenBSD: trm.c,v 1.11 2009/01/21 21:54:00 grange Exp $ * ------------------------------------------------------------ * O.S : OpenBSD * File Name : trm.c @@ -461,7 +461,7 @@ trm_scsi_cmd(struct scsi_xfer *xs) trm_StartWaitingSRB(sc); if ((xferflags & SCSI_POLL) == 0) { - timeout_add(&xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, xs->timeout); splx(intflag); return SUCCESSFULLY_QUEUED; } @@ -2282,7 +2282,7 @@ trm_RequestSense(struct trm_softc *sc, struct trm_scsi_req_q *pSRB) pSRB->ScsiCmdLen = 6; if ((pSRB->xs != NULL) && ((pSRB->xs->flags & SCSI_POLL) == 0)) - timeout_add(&pSRB->xs->stimeout, (pSRB->xs->timeout/1000) * hz); + timeout_add_msec(&pSRB->xs->stimeout, pSRB->xs->timeout); if (trm_StartSRB(sc, pSRB) != 0) trm_RewaitSRB(sc, pSRB); diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 416d121bbbf..268b912a7aa 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc.c,v 1.100 2008/07/02 03:00:55 fgsch Exp $ */ +/* $OpenBSD: wdc.c,v 1.101 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -1781,7 +1781,7 @@ __wdccommand_start(chp, xfer) if ((wdc_c->flags & AT_POLL) == 0) { chp->ch_flags |= WDCF_IRQ_WAIT; /* wait for interrupt */ - timeout_add(&chp->ch_timo, wdc_c->timeout / 1000 * hz); + timeout_add_msec(&chp->ch_timo, wdc_c->timeout); return; } diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c index 6d3b84123c1..00ce661c903 100644 --- a/sys/dev/isa/aha.c +++ b/sys/dev/isa/aha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha.c,v 1.60 2008/11/25 17:52:02 krw Exp $ */ +/* $OpenBSD: aha.c,v 1.61 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */ #undef AHADIAG @@ -816,7 +816,7 @@ aha_start_ccbs(sc) if ((ccb->xs->flags & SCSI_POLL) == 0) { timeout_set(&ccb->xs->stimeout, aha_timeout, ccb); - timeout_add(&ccb->xs->stimeout, (ccb->timeout * hz) / 1000); + timeout_add_msec(&ccb->xs->stimeout, ccb->timeout); } ++sc->sc_mbofull; diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index c5a060e494d..28cfba3100e 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seagate.c,v 1.25 2009/01/11 16:54:59 blambert Exp $ */ +/* $OpenBSD: seagate.c,v 1.26 2009/01/21 21:54:00 grange Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -583,7 +583,7 @@ sea_scsi_cmd(struct scsi_xfer *xs) */ if ((flags & SCSI_POLL) == 0) { timeout_set(&scb->xs->stimeout, sea_timeout, scb); - timeout_add(&scb->xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&scb->xs->stimeout, xs->timeout); splx(s); return SUCCESSFULLY_QUEUED; } diff --git a/sys/dev/isa/uha_isa.c b/sys/dev/isa/uha_isa.c index 7094b6c3677..6f2a59de1ec 100644 --- a/sys/dev/isa/uha_isa.c +++ b/sys/dev/isa/uha_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uha_isa.c,v 1.8 2007/04/10 17:47:55 miod Exp $ */ +/* $OpenBSD: uha_isa.c,v 1.9 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: uha_isa.c,v 1.5 1996/10/21 22:41:21 thorpej Exp $ */ /* @@ -269,7 +269,7 @@ u14_start_mbox(sc, mscp) bus_space_write_1(iot, ioh, U14_LINT, U14_OGMFULL); if ((mscp->xs->flags & SCSI_POLL) == 0) - timeout_add(&mscp->xs->stimeout, (mscp->timeout * hz) / 1000); + timeout_add_msec(&mscp->xs->stimeout, mscp->timeout); } /* diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c index 85ad383e5b1..6522735ff61 100644 --- a/sys/dev/isa/wds.c +++ b/sys/dev/isa/wds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wds.c,v 1.26 2008/11/25 17:52:02 krw Exp $ */ +/* $OpenBSD: wds.c,v 1.27 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: wds.c,v 1.13 1996/11/03 16:20:31 mycroft Exp $ */ #undef WDSDIAG @@ -741,7 +741,7 @@ wds_start_scbs(sc) if ((scb->flags & SCB_POLLED) == 0) { timeout_set(&scb->xs->stimeout, wds_timeout, scb); - timeout_add(&scb->xs->stimeout, (scb->timeout * hz) / 1000); + timeout_add_msec(&scb->xs->stimeout, scb->timeout); } ++sc->sc_mbofull; diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index 5208944c457..ca3aef1afc3 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.145 2008/12/13 11:49:54 mikeb Exp $ */ +/* $OpenBSD: ahci.c,v 1.146 2009/01/21 21:54:00 grange Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -2328,7 +2328,7 @@ ahci_ata_cmd(struct ata_xfer *xa) return (ATA_COMPLETE); } - timeout_add(&xa->stimeout, (xa->timeout * hz) / 1000); + timeout_add_msec(&xa->stimeout, xa->timeout); s = splbio(); ahci_start(ccb); diff --git a/sys/dev/pci/if_san_te1.c b/sys/dev/pci/if_san_te1.c index 36adb4bc7bc..6153c9d6543 100644 --- a/sys/dev/pci/if_san_te1.c +++ b/sys/dev/pci/if_san_te1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_te1.c,v 1.10 2007/11/26 09:28:33 martynas Exp $ */ +/* $OpenBSD: if_san_te1.c,v 1.11 2009/01/21 21:54:00 grange Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -3658,7 +3658,7 @@ sdla_te_enable_timer(sdla_t *card, unsigned long delay) } bit_set((u_int8_t*)&card->fe_te.te_critical, TE_TIMER_RUNNING); - timeout_add(&card->fe_te.te_timer, delay * hz / 1000); + timeout_add_msec(&card->fe_te.te_timer, delay); return; } diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c index 2c18ab4a8bc..101fe0218a3 100644 --- a/sys/dev/sdmmc/sdmmc_scsi.c +++ b/sys/dev/sdmmc/sdmmc_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_scsi.c,v 1.11 2008/12/02 23:49:54 deraadt Exp $ */ +/* $OpenBSD: sdmmc_scsi.c,v 1.12 2009/01/21 21:54:00 grange Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -417,7 +417,7 @@ sdmmc_start_xs(struct sdmmc_softc *sc, struct sdmmc_ccb *ccb) return COMPLETE; } - timeout_add(&xs->stimeout, (xs->timeout * hz) / 1000); + timeout_add_msec(&xs->stimeout, xs->timeout); sdmmc_add_task(sc, &ccb->ccb_task); return SUCCESSFULLY_QUEUED; } diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 6bc4c1f7ae5..9c26d9bb852 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukbd.c,v 1.44 2009/01/21 18:18:33 miod Exp $ */ +/* $OpenBSD: ukbd.c,v 1.45 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -682,8 +682,7 @@ ukbd_decode(struct ukbd_softc *sc, struct ukbd_data *ud) splx(s); if (npress != 0) { sc->sc_nrep = npress; - timeout_add(&sc->sc_rawrepeat_ch, - hz * REP_DELAY1 / 1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAY1); } else timeout_del(&sc->sc_rawrepeat_ch); return; @@ -736,7 +735,7 @@ ukbd_rawrepeat(void *v) s = spltty(); wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep); splx(s); - timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAYN / 1000); + timeout_add_msec(&sc->sc_rawrepeat_ch, REP_DELAYN); } #endif diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index 9e644f6272b..867ac32e52b 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.59 2008/12/21 20:16:35 dlg Exp $ */ +/* $OpenBSD: wskbd.c,v 1.60 2009/01/21 21:54:00 grange Exp $ */ /* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */ /* @@ -522,8 +522,7 @@ wskbd_repeat(void *v) sc->sc_repeat_value); } if (sc->sc_keyrepeat_data.delN != 0) - timeout_add(&sc->sc_repeat_ch, - (hz * sc->sc_keyrepeat_data.delN) / 1000); + timeout_add_msec(&sc->sc_repeat_ch, sc->sc_keyrepeat_data.delN); splx(s); } #endif @@ -641,8 +640,8 @@ wskbd_input(struct device *dev, u_int type, int value) if (sc->sc_keyrepeat_data.del1 != 0) { sc->sc_repeating = num; - timeout_add(&sc->sc_repeat_ch, - (hz * sc->sc_keyrepeat_data.del1) / 1000); + timeout_add_msec(&sc->sc_repeat_ch, + sc->sc_keyrepeat_data.del1); } } return; @@ -657,8 +656,7 @@ wskbd_input(struct device *dev, u_int type, int value) sc->sc_repeat_type = type; sc->sc_repeat_value = value; sc->sc_repeating = 1; - timeout_add(&sc->sc_repeat_ch, - (hz * sc->sc_keyrepeat_data.del1) / 1000); + timeout_add_msec(&sc->sc_repeat_ch, sc->sc_keyrepeat_data.del1); } #endif } |