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/dev/ic | |
parent | 170b1962e3648be5d4b991579d61efbc60a24fd2 (diff) |
Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).
No functional changes.
ok krw@ miod@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/adv.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/adw.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/aic6360.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/aic79xx_openbsd.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/aic7xxx_openbsd.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/ath.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/atw.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/bha.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/bwi.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/gdt_common.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/iha.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/oosiop.c | 9 | ||||
-rw-r--r-- | sys/dev/ic/osiop.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/rtw.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/sili.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/trm.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/wdc.c | 4 |
17 files changed, 44 insertions, 49 deletions
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; } |