Module Name: src
Committed By: macallan
Date: Thu Jan 10 17:38:10 UTC 2013
Modified Files:
src/sys/dev/ic: com.c
Log Message:
don't try to become console if we get is_console=false as device property
To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/sys/dev/ic/com.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.306 src/sys/dev/ic/com.c:1.307
--- src/sys/dev/ic/com.c:1.306 Mon May 21 20:51:46 2012
+++ src/sys/dev/ic/com.c Thu Jan 10 17:38:10 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $ */
+/* $NetBSD: com.c,v 1.307 2013/01/10 17:38:10 macallan Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.307 2013/01/10 17:38:10 macallan Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -379,9 +379,14 @@ com_attach_subr(struct com_softc *sc)
u_int8_t lcr;
#endif
const char *fifo_msg = NULL;
+ prop_dictionary_t dict;
+ bool is_console = true;
aprint_naive("\n");
+ dict = device_properties(sc->sc_dev);
+ prop_dictionary_get_bool(dict, "is_console", &is_console);
+
callout_init(&sc->sc_diag_callout, 0);
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
@@ -402,9 +407,13 @@ com_attach_subr(struct com_softc *sc)
(u_long)comcons_info.regs.cr_iobase);
}
+
/* Make sure the console is always "hardwired". */
delay(10000); /* wait for output to finish */
- SET(sc->sc_hwflags, COM_HW_CONSOLE);
+ if (is_console) {
+ SET(sc->sc_hwflags, COM_HW_CONSOLE);
+ }
+
SET(sc->sc_swflags, TIOCFLAG_SOFTCAR);
}