summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-12-06 15:46:52 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-12-06 15:46:52 +0000
commit1dc41ef01fb1a397290447c65c8ee76943975c21 (patch)
tree612919fe1f6760c0c71714c58dda2bb667ddb1e3 /sys/dev
parent6643e21d4fc495a33c5dbf705fd1efef6faca9a2 (diff)
new timeouts; art@ ok
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/aic7xxx.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index d4e78e3e0e4..c9da675e13b 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.40 2000/01/07 23:08:17 gibbs Exp $
- * $OpenBSD: aic7xxx.c,v 1.23 2000/08/02 18:50:17 aaron Exp $
+ * $OpenBSD: aic7xxx.c,v 1.24 2000/12/06 15:46:51 mickey Exp $
*/
/*
* A few notes on features of the driver.
@@ -662,6 +662,7 @@ ahcfreescb(ahc, scb)
scb->flags = SCB_FREE;
hscb->control = 0;
hscb->status = 0;
+ timeout_del(&scb->xs->stimeout);
SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links);
@@ -1975,11 +1976,8 @@ ahc_handle_seqint(ahc, intstat)
* Ensure we have enough time to actually
* retrieve the sense.
*/
- if (!(scb->xs->flags & SCSI_POLL)) {
- untimeout(ahc_timeout, (caddr_t)scb);
- timeout(ahc_timeout, (caddr_t)scb,
- 5 * hz);
- }
+ if (!(scb->xs->flags & SCSI_POLL))
+ timeout_add(&scb->xs->stimeout, 5 * hz);
}
break;
case SCSI_BUSY:
@@ -3439,7 +3437,7 @@ ahc_done(ahc, scb)
LIST_REMOVE(scb, pend_links);
- untimeout(ahc_timeout, (caddr_t)scb);
+ timeout_del(&scb->xs->stimeout);
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOWCMDS) {
@@ -3487,10 +3485,9 @@ ahc_done(ahc, scb)
while (scbp != NULL) {
struct scsi_xfer *txs = scbp->xs;
- if (!(txs->flags & SCSI_POLL)) {
- timeout(ahc_timeout, scbp,
+ if (!(txs->flags & SCSI_POLL))
+ timeout_add(&scbp->xs->stimeout,
(scbp->xs->timeout * hz)/1000);
- }
scbp = LIST_NEXT(scbp, pend_links);
}
@@ -4219,6 +4216,7 @@ get_scb:
scb->xs = xs;
hscb = scb->hscb;
hscb->tcl = tcl;
+ timeout_set(&xs->stimeout, ahc_timeout, scb);
if (ahc_istagged_device(ahc, xs, 0))
scb->hscb->control |= MSG_SIMPLE_Q_TAG;
@@ -4356,8 +4354,7 @@ ahc_execute_scb(arg, dm_segs, nsegments)
scb->flags |= SCB_ACTIVE;
if (!(xs->flags & SCSI_POLL))
- timeout(ahc_timeout, (caddr_t)scb,
- (xs->timeout * hz) / 1000);
+ timeout_add(&xs->stimeout, (xs->timeout * hz) / 1000);
if ((scb->flags & SCB_TARGET_IMMEDIATE) != 0) {
#if 0
@@ -4818,7 +4815,7 @@ ahc_set_recoveryscb(ahc, scb)
*/
scbp = ahc->pending_scbs.lh_first;
while (scbp != NULL) {
- untimeout(ahc_timeout, scbp);
+ timeout_del(&scbp->xs->stimeout);
scbp = scbp->pend_links.le_next;
}
}
@@ -4967,8 +4964,8 @@ bus_reset:
scb->flags |= SCB_OTHERTCL_TIMEOUT;
newtimeout = MAX(active_scb->xs->timeout,
scb->xs->timeout);
- timeout(ahc_timeout, scb,
- (newtimeout * hz) / 1000);
+ timeout_add(&scb->xs->stimeout,
+ (newtimeout * hz) / 1000);
splx(s);
return;
}
@@ -4996,7 +4993,7 @@ bus_reset:
sc_print_addr(active_scb->xs->sc_link);
printf("BDR message in message buffer\n");
active_scb->flags |= SCB_DEVICE_RESET;
- timeout(ahc_timeout, (caddr_t)active_scb, 2 * hz);
+ timeout_add(&active_scb->xs->stimeout, 2 * hz);
unpause_sequencer(ahc);
} else {
int disconnected;
@@ -5085,7 +5082,7 @@ bus_reset:
ahc_outb(ahc, KERNEL_QINPOS,
ahc->qinfifonext);
}
- timeout(ahc_timeout, (caddr_t)scb, 2 * hz);
+ timeout_add(&scb->xs->stimeout, 2 * hz);
unpause_sequencer(ahc);
} else {
/* Go "immediatly" to the bus reset */