summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2000-08-16 19:15:36 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2000-08-16 19:15:36 +0000
commit7bd5e11e2ab510512d79a06969bd63a2c9dc9576 (patch)
tree856c36df63617e042f86dc9abfe795ee40a9b93f /sys
parent59f5da9eade314d4bf719b4b25bd335d3bc55ef4 (diff)
morth to use new timeouts
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/isa/pccom.c14
-rw-r--r--sys/arch/i386/isa/pccomvar.h4
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c
index 672388303fb..b114e47be10 100644
--- a/sys/arch/i386/isa/pccom.c
+++ b/sys/arch/i386/isa/pccom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccom.c,v 1.34 1999/11/28 12:07:02 downsj Exp $ */
+/* $OpenBSD: pccom.c,v 1.35 2000/08/16 19:15:35 mickey Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -83,6 +83,7 @@
#include <sys/types.h>
#include <sys/device.h>
#include <sys/vnode.h>
+#include <sys/timeout.h>
#include <machine/bus.h>
#include <machine/intr.h>
@@ -447,6 +448,9 @@ comattach(parent, self, aux)
sc->sc_ioh = ioh;
sc->sc_iobase = iobase;
+ timeout_set(&sc->sc_dtr_tmo, com_raisedtr, sc);
+ timeout_set(&sc->sc_diag_tmo, comdiag, sc);
+
if (iobase == comconsaddr) {
comconsattached = 1;
@@ -701,8 +705,8 @@ com_detach(self, flags)
ttyfree(sc->sc_tty);
}
- untimeout(com_raisedtr, sc);
- untimeout(comdiag, sc);
+ timeout_del(&sc->sc_dtr_tmo);
+ timeout_del(&sc->sc_diag_tmo);
return (0);
}
@@ -994,7 +998,7 @@ comclose(dev, flag, mode, p)
/* tty device is waiting for carrier; drop dtr then re-raise */
CLR(sc->sc_mcr, MCR_DTR | MCR_RTS);
bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr);
- timeout(com_raisedtr, sc, hz * 2);
+ timeout_add(&sc->sc_dtr_tmo, hz * 2);
} else {
/* no one else waiting; turn off the uart */
compwroff(sc);
@@ -1590,7 +1594,7 @@ comsoft()
if (ISSET(lsr, LSR_OE)) {
sc->sc_overflows++;
if (sc->sc_errors++ == 0)
- timeout(comdiag, sc, 60 * hz);
+ timeout_add(&sc->sc_diag_tmo, 60 * hz);
}
rxget = (rxget + 1) & RBUFMASK;
c |= lsrmap[(lsr & (LSR_BI|LSR_FE|LSR_PE)) >> 2];
diff --git a/sys/arch/i386/isa/pccomvar.h b/sys/arch/i386/isa/pccomvar.h
index 817986db6f5..1d3dbcfcf09 100644
--- a/sys/arch/i386/isa/pccomvar.h
+++ b/sys/arch/i386/isa/pccomvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccomvar.h,v 1.9 2000/02/04 06:12:21 angelos Exp $ */
+/* $OpenBSD: pccomvar.h,v 1.10 2000/08/16 19:15:35 mickey Exp $ */
/* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */
/*
@@ -46,6 +46,8 @@ struct com_softc {
void *sc_ih;
bus_space_tag_t sc_iot;
struct tty *sc_tty;
+ struct timeout sc_dtr_tmo;
+ struct timeout sc_diag_tmo;
int sc_overflows;
int sc_floods;