diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-12-13 04:07:27 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-12-13 04:07:27 +0000 |
commit | 6414649aab02efd6444fb6d332d828658cfe9ef2 (patch) | |
tree | 6e4708984b23d77ce63cdf92c1ae1717ed4e4a4c /sys/dev/ic/aic79xx_openbsd.c | |
parent | 4aeffaa1a581000c23d516d4d226c5f2a436a3fa (diff) |
Use millisends rather than microseconds in parameters to timer
functions, and ultra-conservative calculations, to avoid possible
overflow issues. Also consistant with values passed in scsi requests.
Whitespace and comment tweaks.
Update FreeBSD tags now that we are sync'd to the latest version.
From FreeBSD aic79xx.c r1.33, aic79xx.h r1.23, aic_osm_lib.h r1.4.
Diffstat (limited to 'sys/dev/ic/aic79xx_openbsd.c')
-rw-r--r-- | sys/dev/ic/aic79xx_openbsd.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index d43b19cf41a..8da21ece3b6 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.12 2004/11/23 05:15:35 krw Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.13 2004/12/13 04:07:26 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -780,12 +780,27 @@ ahd_adapter_req_set_xfer_mode(struct ahd_softc *ahd, struct scb *scb) } void -aic_scb_timer_reset(struct scb *scb, u_int usec) +aic_timer_reset(aic_timer_t *timer, u_int msec, ahd_callback_t *func, + void *arg) { - if (!(scb->xs->xs_control & XS_CTL_POLL)) { - callout_reset(&scb->xs->xs_callout, - (usec * hz)/1000000, ahd_timeout, scb); - } + uint64_t ticks; + + ticks = msec; + ticks *= hz; + ticks /= 1000; + callout_reset(timer, ticks, func, arg); +} + +void +aic_scb_timer_reset(struct scb *scb, u_int msec) +{ + uint64_t ticks; + + ticks = msec; + ticks *= hz; + ticks /= 1000; + if (!(scb->xs->xs_control & XS_CTL_POLL)) + callout_reset(&scb->xs->xs_callout, ticks, ahd_timeout, scb); } void |