summaryrefslogtreecommitdiffstats
path: root/sys/dev/sab
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-11-18 05:56:43 +0000
committerjake <jake@FreeBSD.org>2002-11-18 05:56:43 +0000
commita5dc43bc55675d81c608826f1b1f68fe2ac66dfa (patch)
tree9a9c2f1fce5823ee9cf50b9c3031957399090547 /sys/dev/sab
parent98ba605081d56e7c2d9f6f3854a69d94b119767d (diff)
downloadFreeBSD-src-a5dc43bc55675d81c608826f1b1f68fe2ac66dfa.zip
FreeBSD-src-a5dc43bc55675d81c608826f1b1f68fe2ac66dfa.tar.gz
Setup a default tty mode even if the device is not the console. Don't
reset the chip on open if we're not the console. This fixes running a getty on ttya or ttyb if console input and output devices are screen.
Diffstat (limited to 'sys/dev/sab')
-rw-r--r--sys/dev/sab/sab.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c
index f853455..beef8b1 100644
--- a/sys/dev/sab/sab.c
+++ b/sys/dev/sab/sab.c
@@ -492,6 +492,9 @@ sabtty_attach(device_t dev)
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
tp->t_lflag = TTYDEF_LFLAG;
+ tp->t_cflag = CREAD | CLOCAL | CS8;
+ tp->t_ospeed = TTYDEF_SPEED;
+ tp->t_ispeed = TTYDEF_SPEED;
if (sabtty_console(dev, mode, sizeof(mode))) {
ttychars(tp);
@@ -499,7 +502,7 @@ sabtty_attach(device_t dev)
&stop, &c) == 5) {
tp->t_ospeed = baud;
tp->t_ispeed = baud;
- tp->t_cflag = CREAD | HUPCL;
+ tp->t_cflag = CREAD | CLOCAL;
switch (clen) {
case 5:
@@ -524,10 +527,6 @@ sabtty_attach(device_t dev)
if (stop == 2)
tp->t_cflag |= CSTOPB;
- } else {
- tp->t_ospeed = 9600;
- tp->t_ispeed = 9600;
- tp->t_cflag = CREAD | CS8 | HUPCL;
}
sc->sc_flags |= SABTTYF_CONS;
sabtty_cons = sc;
@@ -801,11 +800,6 @@ sabttyopen(dev_t dev, int flags, int mode, struct thread *td)
(void)tsleep(sc, TTIPRI, "ttclos", hz);
}
- if ((sc->sc_flags & SABTTYF_CONS) == 0) {
- /* Flush and power down if we're not the console */
- sabtty_flush(sc);
- sabtty_reset(sc);
- }
return (error);
}
OpenPOWER on IntegriCloud