summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/aac.c16
-rw-r--r--sys/dev/ic/gdt_common.c16
2 files changed, 20 insertions, 12 deletions
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c
index 87b31467d8d..641f75b68e4 100644
--- a/sys/dev/ic/aac.c
+++ b/sys/dev/ic/aac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aac.c,v 1.1 2000/11/10 09:39:35 niklas Exp $ */
+/* $OpenBSD: aac.c,v 1.2 2000/12/13 15:32:39 mickey Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
@@ -1026,7 +1026,7 @@ aac_host_response(struct aac_softc *sc)
if (ccb == NULL) {
AAC_PRINT_FIB(sc, fib);
} else {
- untimeout(aac_timeout, ccb);
+ timeout_del(&ccb->ac_xs->stimeout);
aac_unmap_command(ccb); /* XXX defer? */
aac_enqueue_completed(ccb);
}
@@ -1460,6 +1460,7 @@ aac_enqueue_ccb(sc, ccb)
{
AAC_DPRINTF(AAC_D_QUEUE, ("aac_enqueue_ccb(%p, %p) ", sc, ccb));
+ timeout_set(&ccb->ac_xs->stimeout, aac_timeout, ccb);
TAILQ_INSERT_TAIL(&sc->sc_ccbq, ccb, ac_chain);
aac_start_ccbs(sc);
}
@@ -1469,23 +1470,26 @@ aac_start_ccbs(sc)
struct aac_softc *sc;
{
struct aac_ccb *ccb;
+ struct scsi_xfer *xs;
AAC_DPRINTF(AAC_D_QUEUE, ("aac_start_ccbs(%p) ", sc));
while ((ccb = TAILQ_FIRST(&sc->sc_ccbq)) != NULL) {
+
+ xs = ccb->ac_xs;
if (ccb->ac_flags & AAC_ACF_WATCHDOG)
- untimeout(aac_watchdog, ccb);
+ timeout_del(&xs->stimeout);
if (aac_exec_ccb(ccb) == 0) {
ccb->ac_flags |= AAC_ACF_WATCHDOG;
- timeout(aac_watchdog, ccb,
+ timeout_add(&xs->stimeout,
(AAC_WATCH_TIMEOUT * hz) / 1000);
break;
}
TAILQ_REMOVE(&sc->sc_ccbq, ccb, ac_chain);
- if ((ccb->ac_xs->flags & SCSI_POLL) == 0)
- timeout(aac_timeout, ccb,
+ if ((xs->flags & SCSI_POLL) == 0)
+ timeout_add(&xs->stimeout,
(ccb->ac_timeout * hz) / 1000);
}
}
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c
index 5b3368858e0..8c188cff90d 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.9 2000/11/10 09:42:14 niklas Exp $ */
+/* $OpenBSD: gdt_common.c,v 1.10 2000/12/13 15:32:39 mickey Exp $ */
/*
* Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -1056,7 +1056,7 @@ gdt_intr(arg)
ccb = &gdt->sc_ccbs[ctx.istatus - 2];
xs = ccb->gc_xs;
if (!gdt_polling)
- untimeout(gdt_timeout, ccb);
+ timeout_del(&xs->stimeout);
ctx.service = ccb->gc_service;
prev_cmd = ccb->gc_flags & GDT_GCF_CMD_MASK;
if (xs && xs->cmd->opcode != PREVENT_ALLOW &&
@@ -1285,6 +1285,7 @@ gdt_enqueue_ccb(gdt, ccb)
{
GDT_DPRINTF(GDT_D_QUEUE, ("gdt_enqueue_ccb(%p, %p) ", gdt, ccb));
+ timeout_set(&ccb->gc_xs->stimeout, gdt_timeout, ccb);
TAILQ_INSERT_TAIL(&gdt->sc_ccbq, ccb, gc_chain);
gdt_start_ccbs(gdt);
}
@@ -1294,23 +1295,26 @@ gdt_start_ccbs(gdt)
struct gdt_softc *gdt;
{
struct gdt_ccb *ccb;
+ struct scsi_xfer *xs;
GDT_DPRINTF(GDT_D_QUEUE, ("gdt_start_ccbs(%p) ", gdt));
while ((ccb = TAILQ_FIRST(&gdt->sc_ccbq)) != NULL) {
+
+ xs = ccb->gc_xs;
if (ccb->gc_flags & GDT_GCF_WATCHDOG)
- untimeout(gdt_watchdog, ccb);
+ timeout_del(&xs->stimeout);
if (gdt_exec_ccb(ccb) == 0) {
ccb->gc_flags |= GDT_GCF_WATCHDOG;
- timeout(gdt_watchdog, ccb,
+ timeout_add(&xs->stimeout,
(GDT_WATCH_TIMEOUT * hz) / 1000);
break;
}
TAILQ_REMOVE(&gdt->sc_ccbq, ccb, gc_chain);
- if ((ccb->gc_xs->flags & SCSI_POLL) == 0)
- timeout(gdt_timeout, ccb,
+ if ((xs->flags & SCSI_POLL) == 0)
+ timeout_add(&xs->stimeout,
(ccb->gc_timeout * hz) / 1000);
}
}