diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index bd1a042c45e1..d5a2c668a3b5 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.121 1997/11/01 20:40:38 mycroft Exp $ */ +/* $NetBSD: com.c,v 1.122 1997/11/02 08:50:33 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -600,8 +600,6 @@ comopen(dev, flag, mode, p) ttychars(tp); ttsetwater(tp); - s2 = splserial(); - /* * Turn on DTR. We must always do this, even if carrier is not * present, because otherwise we'd have to use TIOCSDTR @@ -611,6 +609,8 @@ comopen(dev, flag, mode, p) */ com_modem(sc, 1); + s2 = splserial(); + /* Clear the input ring, and unblock. */ sc->sc_rbput = sc->sc_rbget = 0; sc->sc_rbavail = RXBUFSIZE; @@ -678,11 +678,12 @@ comclose(dev, flag, mode, p) /* If we were asserting flow control, then deassert it. */ SET(sc->sc_rx_flags, RX_IBUF_BLOCKED); com_hwiflow(sc); - /* Clear any break condition set with TIOCSBRK. */ - com_break(sc, 0); splx(s); + /* Clear any break condition set with TIOCSBRK. */ + com_break(sc, 0); + /* * Hang up if necessary. Wait a bit, so the other side has time to * notice even if we immediately open the port again. @@ -696,7 +697,7 @@ comclose(dev, flag, mode, p) /* Turn off interrupts. */ #ifdef DDB - if(ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) + if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) sc->sc_ier = IER_ERXRDY; /* interrupt on break */ else #else diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index c69e8641128b..27391dc13556 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: z8530tty.c,v 1.30 1997/11/02 08:29:51 mycroft Exp $ */ +/* $NetBSD: z8530tty.c,v 1.31 1997/11/02 08:50:31 mycroft Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -448,8 +448,6 @@ zsopen(dev, flags, mode, p) ttychars(tp); ttsetwater(tp); - s2 = splzs(); - /* * Turn on DTR. We must always do this, even if carrier is not * present, because otherwise we'd have to use TIOCSDTR @@ -459,6 +457,8 @@ zsopen(dev, flags, mode, p) */ zs_modem(zst, 1); + s2 = splzs(); + /* Clear the input ring, and unblock. */ zst->zst_rbget = zst->zst_rbput; zs_iflush(cs); @@ -528,11 +528,12 @@ zsclose(dev, flags, mode, p) /* If we were asserting flow control, then deassert it. */ zst->zst_rx_blocked = 1; zs_hwiflow(zst); - /* Clear any break condition set with TIOCSBRK. */ - zs_break(cs, 0); splx(s); + /* Clear any break condition set with TIOCSBRK. */ + zs_break(cs, 0); + /* * Hang up if necessary. Wait a bit, so the other side has time to * notice even if we immediately open the port again.