diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-11-29 00:08:01 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-11-29 00:08:01 +0000 |
commit | 84b0e38d400e1e67adc9a2f4fbbac103687a8b25 (patch) | |
tree | a8054c327eb6c91bbdd75cfc0a09e8680b811992 | |
parent | c22dd90537d6062543fbd52f32ed24c9a905f8a9 (diff) |
Oh, scsi layer already has timeout stuff for us.
-rw-r--r-- | sys/dev/pci/ips.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index e0178cc1530..94fcd1a3835 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.11 2006/11/29 00:04:39 dlg Exp $ */ +/* $OpenBSD: ips.c,v 1.12 2006/11/29 00:08:00 grange Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -183,7 +183,6 @@ struct ccb { bus_dmamap_t c_dmam; struct scsi_xfer * c_xfer; - struct timeout c_timo; TAILQ_ENTRY(ccb) c_link; }; @@ -537,7 +536,8 @@ ips_scsi_io(struct scsi_xfer *xs) cmd->buffaddr = ccb->c_dmam->dm_segs[0].ds_addr; } - timeout_add(&ccb->c_timo, hz); + timeout_set(&xs->stimeout, ips_xfer_timeout, ccb); + timeout_add(&xs->stimeout, (xs->timeout * 1000) / hz); s = splbio(); (*sc->sc_exec)(sc); @@ -706,11 +706,11 @@ ips_morpheus_intr(void *arg) } rv = 1; - timeout_del(&ccb->c_timo); bus_dmamap_unload(sc->sc_dmat, ccb->c_dmam); xs = ccb->c_xfer; xs->resid = 0; xs->flags |= ITSDONE; + timeout_del(&xs->stimeout); s = splbio(); scsi_done(xs); ccb->c_flags &= ~CCB_F_RUN; @@ -737,7 +737,6 @@ ips_ccb_alloc(bus_dma_tag_t dmat, int n) IPS_MAXFER, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &ccb[i].c_dmam)) goto fail; - timeout_set(&ccb[i].c_timo, ips_xfer_timeout, &ccb[i]); } return (ccb); |