summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-07-21 11:20:36 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-07-21 11:20:36 +0000
commitb210500edbb39b7ba582d49dd14ac07445ee3615 (patch)
tree3fe1e4605aba6630759d208a27635cd98d87aadc /sys
parent4b2a27698bbf56ff35658aa59500d98c31399e91 (diff)
Use new timeouts.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ncr53c9x.c19
-rw-r--r--sys/dev/ic/ncr53c9xvar.h5
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c
index fb280889e43..6f1d3056902 100644
--- a/sys/dev/ic/ncr53c9x.c
+++ b/sys/dev/ic/ncr53c9x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr53c9x.c,v 1.8 2000/06/17 18:03:11 fgsch Exp $ */
+/* $OpenBSD: ncr53c9x.c,v 1.9 2000/07/21 11:20:35 art Exp $ */
/* $NetBSD: ncr53c9x.c,v 1.26 1998/05/26 23:17:34 thorpej Exp $ */
/*
@@ -315,6 +315,7 @@ ncr53c9x_init(sc, doreset)
ecb = sc->sc_ecb;
bzero(ecb, sizeof(sc->sc_ecb));
for (r = 0; r < sizeof(sc->sc_ecb) / sizeof(*ecb); r++) {
+ timeout_set(&ecb->to, ncr53c9x_timeout, ecb);
TAILQ_INSERT_TAIL(&sc->free_list, ecb, chain);
ecb++;
}
@@ -488,8 +489,7 @@ ncr53c9x_select(sc, ecb)
* always possible that the interrupt may never happen.
*/
if ((ecb->xs->flags & SCSI_POLL) == 0)
- timeout(ncr53c9x_timeout, ecb,
- (ecb->timeout * hz) / 1000);
+ timeout_add(&ecb->to, (ecb->timeout * hz) / 1000);
/*
* The docs say the target register is never reset, and I
@@ -815,7 +815,7 @@ ncr53c9x_done(sc, ecb)
NCR_TRACE(("[ncr53c9x_done(error:%x)] ", xs->error));
- untimeout(ncr53c9x_timeout, ecb);
+ timeout_del(&ecb->to);
/*
* Now, if we've come here with no error code, i.e. we've kept the
@@ -1636,7 +1636,7 @@ again:
goto reset;
}
printf("sending REQUEST SENSE\n");
- untimeout(ncr53c9x_timeout, ecb);
+ timeout_del(&ecb->to);
ncr53c9x_sense(sc, ecb);
goto out;
}
@@ -1702,7 +1702,7 @@ printf("<<RESELECT CONT'd>>");
*/
if (sc->sc_state == NCR_SELECTING) {
NCR_MISC(("backoff selector "));
- untimeout(ncr53c9x_timeout, ecb);
+ timeout_del(&ecb->to);
sc_link = ecb->xs->sc_link;
ti = &sc->sc_tinfo[sc_link->target];
TAILQ_INSERT_HEAD(&sc->ready_list, ecb, chain);
@@ -2132,12 +2132,9 @@ ncr53c9x_abort(sc, ecb)
ncr53c9x_sched_msgout(SEND_ABORT);
/*
- * Reschedule timeout. First, cancel a queued timeout (if any)
- * in case someone decides to call ncr53c9x_abort() from
- * elsewhere.
+ * Reschedule timeout.
*/
- untimeout(ncr53c9x_timeout, ecb);
- timeout(ncr53c9x_timeout, ecb, (ecb->timeout * hz) / 1000);
+ timeout_add(&ecb->to, (ecb->timeout * hz) / 1000);
} else {
/* The command should be on the nexus list */
if ((ecb->flags & ECB_NEXUS) == 0) {
diff --git a/sys/dev/ic/ncr53c9xvar.h b/sys/dev/ic/ncr53c9xvar.h
index 481bdf3af54..284cb0275b6 100644
--- a/sys/dev/ic/ncr53c9xvar.h
+++ b/sys/dev/ic/ncr53c9xvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr53c9xvar.h,v 1.6 2000/06/17 18:03:11 fgsch Exp $ */
+/* $OpenBSD: ncr53c9xvar.h,v 1.7 2000/07/21 11:20:34 art Exp $ */
/* $NetBSD: ncr53c9xvar.h,v 1.13 1998/05/26 23:17:34 thorpej Exp $ */
/*-
@@ -67,6 +67,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/timeout.h>
+
/* Set this to 1 for normal debug, or 2 for per-target tracing. */
#define NCR53C9X_DEBUG 1
@@ -109,6 +111,7 @@ struct ncr53c9x_ecb {
#define ECB_RESET 0x80
#define ECB_TENTATIVE_DONE 0x100
int timeout;
+ struct timeout to;
struct {
u_char id; /* Selection Id msg */