aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sio
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-11-30 15:52:56 +0000
committerBruce Evans <bde@FreeBSD.org>1996-11-30 15:52:56 +0000
commitc252c2507e625dca0f51d696e6a9d92919c746ed (patch)
tree332a28f285dadb9491356fa2fd399bec8c690048 /sys/dev/sio
parenteea9b0845f157ab8527771f67a1693057df23dd8 (diff)
downloadsrc-c252c2507e625dca0f51d696e6a9d92919c746ed.tar.gz
src-c252c2507e625dca0f51d696e6a9d92919c746ed.zip
Fixed input of BREAKs when IGNPAR is set and IGNBRK is not set. BREAKs
are always together with Framing Errors and they were incorrectly treated as FE's and discarded. Reorganized the BREAK/FE/PE tests. Found by: NIST-PCTS
Notes
Notes: svn path=/head/; revision=20049
Diffstat (limited to 'sys/dev/sio')
-rw-r--r--sys/dev/sio/sio.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 0b70455f3c75..627314ec5729 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.152 1996/11/30 15:19:19 bde Exp $
+ * $Id: sio.c,v 1.153 1996/11/30 15:29:31 bde Exp $
*/
#include "opt_comconsole.h"
@@ -1366,33 +1366,38 @@ siointr1(com)
recv_data = 0;
else
recv_data = inb(com->data_port);
- if (line_status & (LSR_PE|LSR_FE|LSR_BI)) {
-#ifdef DDB
-#ifdef BREAK_TO_DEBUGGER
- if (line_status & LSR_BI
- && com->unit == comconsole) {
- Debugger("serial console break");
- goto cont;
- }
-#endif
-#endif
+ if (line_status & (LSR_BI | LSR_FE | LSR_PE)) {
/*
- Don't store PE if IGNPAR and BI if IGNBRK,
- this hack allows "raw" tty optimization
- works even if IGN* is set.
- */
- if ( com->tp == NULL
- || !(com->tp->t_state & TS_ISOPEN)
- || (line_status & (LSR_PE|LSR_FE))
- && (com->tp->t_iflag & IGNPAR)
- || (line_status & LSR_BI)
- && (com->tp->t_iflag & IGNBRK))
- goto cont;
- if ( (line_status & (LSR_PE|LSR_FE))
- && (com->tp->t_state & TS_CAN_BYPASS_L_RINT)
- && ((line_status & LSR_FE)
- || (line_status & LSR_PE)
- && (com->tp->t_iflag & INPCK)))
+ * Don't store BI if IGNBRK or FE/PE if IGNPAR.
+ * Otherwise, push the work to a higher level
+ * (to handle PARMRK) if we're bypassing.
+ * Otherwise, convert BI/FE and PE+INPCK to 0.
+ *
+ * This makes bypassing work right in the
+ * usual "raw" case (IGNBRK set, and IGNPAR
+ * and INPCK clear).
+ *
+ * Note: BI together with FE/PE means just BI.
+ */
+ if (line_status & LSR_BI) {
+#if defined(DDB) && defined(BREAK_TO_DEBUGGER)
+ if (com->unit == comconsole) {
+ Debugger(
+ "serial console break");
+ goto cont;
+ }
+#endif
+ if (com->tp == NULL
+ || com->tp->t_iflag & IGNBRK)
+ goto cont;
+ } else {
+ if (com->tp == NULL
+ || com->tp->t_iflag & IGNPAR)
+ goto cont;
+ }
+ if (com->tp->t_state & TS_CAN_BYPASS_L_RINT
+ && (line_status & (LSR_BI | LSR_FE)
+ || com->tp->t_iflag & INPCK))
recv_data = 0;
}
++com->bytes_in;