diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1995-03-28 10:51:59 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1995-03-28 10:51:59 +0000 |
| commit | 2cad35d11b9e2ffd2957ad9920bee5fafb7984ae (patch) | |
| tree | 85262b1df3d22def3f8802059f36d2e3e35e01ad /sys/dev/sio/sio.c | |
| parent | e36fea798c6375abd7024709f2b2ccb228f85255 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sio/sio.c')
| -rw-r--r-- | sys/dev/sio/sio.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 418a00642a5c..0c8883ee9aed 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.72 1995/03/28 05:39:53 ache Exp $ + * $Id: sio.c,v 1.73 1995/03/28 06:15:44 ache Exp $ */ #include "sio.h" @@ -1121,9 +1121,20 @@ siointr1(com) if (com->iptr - com->ibuf == 8) setsofttty(); #endif - ioptr[0] = recv_data; - ioptr[CE_INPUT_OFFSET] = line_status; - com->iptr = ++ioptr; + /* + Don't store PE if IGNPAR and BI if IGNBRK, + this hack allows "raw" tty optimization + works even if IGN* is set. + Assume TTY_OE mapped to TTY_PE + */ + if ( (!(line_status & (LSR_PE|LSR_OE)) + || !(com->tp->t_iflag & IGNPAR)) + && (!(line_status & LSR_BI) + || !(com->tp->t_iflag & IGNBRK))) { + ioptr[0] = recv_data; + ioptr[CE_INPUT_OFFSET] = line_status; + com->iptr = ++ioptr; + } if (ioptr == com->ihighwater && com->state & CS_RTS_IFLOW) outb(com->modem_ctl_port, @@ -1550,11 +1561,27 @@ repeat: * call overhead). */ if (!(tp->t_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP - | IXOFF | IXON | IGNBRK | BRKINT | PARMRK)) + | IXOFF | IXON)) + && (!(tp->t_iflag & BRKINT) || (tp->t_iflag & IGNBRK)) + && (!(tp->t_iflag & PARMRK) || + (tp->t_iflag & (IGNPAR|IGNBRK)) == (IGNPAR|IGNBRK)) && !(tp->t_lflag & (ECHO | ECHONL | ICANON | IEXTEN | ISIG | PENDIN)) && !(tp->t_state & (TS_CNTTB | TS_LNCH)) && linesw[tp->t_line].l_rint == ttyinput) { + u_char *scan = buf; + int cnt = incc; + + /* Zero PE & FE chars per POSIX spec. and 4.4 ttyinput() */ + while (cnt--) { + if ( (scan[CE_INPUT_OFFSET] & LSR_FE) + /* Assume TTY_OE mapped to TTY_PE */ + || (scan[CE_INPUT_OFFSET] & (LSR_PE|LSR_OE)) + && (tp->t_iflag & INPCK)) + scan[0] = 0; + scan++; + } + tk_nin += incc; tk_rawcc += incc; tp->t_rawcc += incc; |
