diff options
author | Jake Burkholder <jake@FreeBSD.org> | 2002-11-18 05:56:43 +0000 |
---|---|---|
committer | Jake Burkholder <jake@FreeBSD.org> | 2002-11-18 05:56:43 +0000 |
commit | e2815d20d910ba94bfdac8e6fa72ff8fc5275392 (patch) | |
tree | 9a9c2f1fce5823ee9cf50b9c3031957399090547 /sys/dev | |
parent | 484c780433385f3bf8a60cedb1363a5bdf954145 (diff) | |
download | src-e2815d20d910ba94bfdac8e6fa72ff8fc5275392.tar.gz src-e2815d20d910ba94bfdac8e6fa72ff8fc5275392.zip |
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.
Notes
Notes:
svn path=/head/; revision=107042
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sab/sab.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c index f8534553a7ad..beef8b1176a4 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); } |