summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2012-08-19 18:38:12 +0000
committerkettenis <kettenis@openbsd.org>2012-08-19 18:38:12 +0000
commitddf199f18d5c09a31f452676058e451f1a91c46d (patch)
tree60a555205fd0fb42a260009095fcf81f7a0bf696
parentBuild static netent and hostent structure in a nicer and hopefully not (diff)
downloadwireguard-openbsd-ddf199f18d5c09a31f452676058e451f1a91c46d.tar.xz
wireguard-openbsd-ddf199f18d5c09a31f452676058e451f1a91c46d.zip
Skip putting a port in sleep mode when it is used as serial console. In that
case the kernel will still be using the port even after the last process closes it. And on machines like the v445 the firmware won't be happy if the console port is in sleep mode when the kernel reboots or halts. ok miod@
-rw-r--r--sys/dev/ic/com.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 5ebea29d72b..63c863c63bd 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.149 2012/05/12 18:02:33 kettenis Exp $ */
+/* $OpenBSD: com.c,v 1.150 2012/08/19 18:38:12 kettenis Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -540,26 +540,28 @@ compwroff(struct com_softc *sc)
bus_space_write_1(iot, ioh, com_fifo,
FIFO_RCV_RST | FIFO_XMT_RST);
- switch (sc->sc_uarttype) {
- case COM_UART_ST16650:
- case COM_UART_ST16650V2:
- bus_space_write_1(iot, ioh, com_lcr, LCR_EFR);
- bus_space_write_1(iot, ioh, com_efr, EFR_ECB);
- bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
- bus_space_write_1(iot, ioh, com_lcr, 0);
- break;
- case COM_UART_TI16750:
- bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
- break;
+ if (!ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
+ switch (sc->sc_uarttype) {
+ case COM_UART_ST16650:
+ case COM_UART_ST16650V2:
+ bus_space_write_1(iot, ioh, com_lcr, LCR_EFR);
+ bus_space_write_1(iot, ioh, com_efr, EFR_ECB);
+ bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
+ bus_space_write_1(iot, ioh, com_lcr, 0);
+ break;
+ case COM_UART_TI16750:
+ bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
+ break;
#ifdef COM_PXA2X0
- case COM_UART_PXA2X0:
- bus_space_write_1(iot, ioh, com_ier, 0);
+ case COM_UART_PXA2X0:
+ bus_space_write_1(iot, ioh, com_ier, 0);
#ifdef __zaurus__
- if (ISSET(sc->sc_hwflags, COM_HW_SIR))
- scoop_set_irled(0);
+ if (ISSET(sc->sc_hwflags, COM_HW_SIR))
+ scoop_set_irled(0);
#endif
- break;
+ break;
#endif
+ }
}
}