diff options
-rw-r--r-- | sys/arch/i386/isa/pccom.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/com.c | 13 | ||||
-rw-r--r-- | sys/dev/isa/com.c | 13 |
3 files changed, 21 insertions, 18 deletions
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c index d235d46cbb9..ae6e3b005a9 100644 --- a/sys/arch/i386/isa/pccom.c +++ b/sys/arch/i386/isa/pccom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccom.c,v 1.3 1996/08/29 12:58:32 deraadt Exp $ */ +/* $OpenBSD: pccom.c,v 1.4 1996/10/22 01:11:52 downsj Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -109,6 +109,8 @@ struct com_softc { u_char sc_cua; + u_char sc_initialize; /* force initialization */ + #define RBUFSIZE 512 #define RBUFMASK 511 u_int sc_rxget; @@ -797,6 +799,7 @@ comopen(dev, flag, mode, p) s = spltty(); + sc->sc_initialize = 1; comparam(tp, &tp->t_termios); ttsetwater(tp); @@ -1223,11 +1226,9 @@ comparam(tp, t) * Set the FIFO threshold based on the receive speed, if we are * changing it. */ -#if 1 - if (tp->t_ispeed != t->c_ispeed) { -#else - if (1) { -#endif + if (sc->sc_initialize || (tp->t_ispeed != t->c_ispeed)) { + sc->sc_initialize = 0; + if (ospeed != 0) { /* * Make sure the transmit FIFO is empty before diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index cee49d340fd..87b8d969f19 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.23 1996/10/16 23:18:42 deraadt Exp $ */ +/* $OpenBSD: com.c,v 1.24 1996/10/22 01:11:50 downsj Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -113,6 +113,8 @@ struct com_softc { u_char sc_cua; + u_char sc_initialize; /* force initialization */ + u_char *sc_ibuf, *sc_ibufp, *sc_ibufhigh, *sc_ibufend; u_char sc_ibufs[2][COM_IBUFSIZE]; }; @@ -790,6 +792,7 @@ comopen(dev, flag, mode, p) s = spltty(); + sc->sc_initialize = 1; comparam(tp, &tp->t_termios); ttsetwater(tp); @@ -1219,11 +1222,9 @@ comparam(tp, t) * Set the FIFO threshold based on the receive speed, if we are * changing it. */ -#if 1 - if (tp->t_ispeed != t->c_ispeed) { -#else - if (1) { -#endif + if (sc->sc_initialize || (tp->t_ispeed != t->c_ispeed)) { + sc->sc_initialize = 0; + if (ospeed != 0) { /* * Make sure the transmit FIFO is empty before diff --git a/sys/dev/isa/com.c b/sys/dev/isa/com.c index cee49d340fd..87b8d969f19 100644 --- a/sys/dev/isa/com.c +++ b/sys/dev/isa/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.23 1996/10/16 23:18:42 deraadt Exp $ */ +/* $OpenBSD: com.c,v 1.24 1996/10/22 01:11:50 downsj Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -113,6 +113,8 @@ struct com_softc { u_char sc_cua; + u_char sc_initialize; /* force initialization */ + u_char *sc_ibuf, *sc_ibufp, *sc_ibufhigh, *sc_ibufend; u_char sc_ibufs[2][COM_IBUFSIZE]; }; @@ -790,6 +792,7 @@ comopen(dev, flag, mode, p) s = spltty(); + sc->sc_initialize = 1; comparam(tp, &tp->t_termios); ttsetwater(tp); @@ -1219,11 +1222,9 @@ comparam(tp, t) * Set the FIFO threshold based on the receive speed, if we are * changing it. */ -#if 1 - if (tp->t_ispeed != t->c_ispeed) { -#else - if (1) { -#endif + if (sc->sc_initialize || (tp->t_ispeed != t->c_ispeed)) { + sc->sc_initialize = 0; + if (ospeed != 0) { /* * Make sure the transmit FIFO is empty before |