diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-22 01:11:53 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-10-22 01:11:53 +0000 |
commit | 77d2beecace1f45f9e3f773c88e7b848a8184349 (patch) | |
tree | 11ebb77bd1c232164cc688b313a8cd89e0fd815e /sys/dev | |
parent | 84655cecbe14330352a6030d064fac51d2cca13a (diff) |
patch com speed initialization
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/com.c | 13 | ||||
-rw-r--r-- | sys/dev/isa/com.c | 13 |
2 files changed, 14 insertions, 12 deletions
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 |