Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Ignore input when the port is not open. This cha...



details:   https://anonhg.NetBSD.org/src/rev/3cc76d9e950c
branches:  trunk
changeset: 546149:3cc76d9e950c
user:      gson <gson%NetBSD.org@localhost>
date:      Mon Apr 21 03:43:18 2003 +0000

description:
Ignore input when the port is not open.  This change is functionally
identical to the patch in kern/6502 (which is hereby fixed), but
modelled after the corresponding fix to the 8530 driver in
z8530tty.c revision 1.60 to maintain consistency with that driver.

diffstat:

 sys/dev/ic/com.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 3c883523fd9b -r 3cc76d9e950c sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Mon Apr 21 02:03:41 2003 +0000
+++ b/sys/dev/ic/com.c  Mon Apr 21 03:43:18 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.204 2003/03/14 02:21:01 simonb Exp $ */
+/*     $NetBSD: com.c,v 1.205 2003/04/21 03:43:18 gson Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.204 2003/03/14 02:21:01 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.205 2003/04/21 03:43:18 gson Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -1769,6 +1769,13 @@
                            comdiag, sc);
        }
 
+       /* If not yet open, drop the entire buffer content here */
+       if (!ISSET(tp->t_state, TS_ISOPEN)) {
+               get += cc << 1;
+               if (get >= end)
+                       get -= com_rbuf_size << 1;
+               cc = 0;
+       }
        while (cc) {
                code = get[0];
                lsr = get[1];



Home | Main Index | Thread Index | Old Index