NetBSD Problem Report #373

From gnats  Sun Jul 31 04:06:39 1994
Received: from cis-ts3-slip4.cis.brown.edu (root@cis-ts3-slip4.cis.brown.edu [128.148.19.58]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id EAA19780 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 31 Jul 1994 04:06:36 -0700
Message-Id: <199407311107.HAA00447@cis-ts3-slip4.cis.brown.edu>
Date: Sun, 31 Jul 1994 07:07:34 -0400
From: Mark Weaver <mhw@cs.brown.edu>
Reply-To: mhw@cs.brown.edu
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: bogons in com.c
X-Send-Pr-Version: 3.2

>Number:         373
>Category:       port-i386
>Synopsis:       bogons in com.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          closed
>Class:          sw-bug
>Submitter-Id:   mhw
>Arrival-Date:   Sun Jul 31 04:20:06 +0000 1994
>Closed-Date:    Sun Jul 31 11:48:07 +0000 1994
>Last-Modified:  
>Originator:     Mark Weaver
>Release:        NetBSD 1.0-BETA (27-July-1994)
>Organization:
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science
>Environment:

System: NetBSD cis-ts3-slip4.cis.brown.edu 1.0_BETA NetBSD 1.0_BETA (EXCELSIOR) #5: Sun Jul 31 06:15:34 EDT 1994 mhw@cis-ts3-slip4.cis.brown.edu:/usr/src/sys/arch/i386/compile/EXCELSIOR i386


>Description:
	There are two problems in com.c.  First, it shouldn't call
	ttstart directly, it should call (*linesw[tp->t_line].l_start).
	Second, in comparam, it attempts to twiddle the TS_TTSTOP flag
	when CRTSCTS or MDMBUF changes, but it copies cflag over before
	comparing the old and the new, so it never thinks they've changed.

	These problems were originally brought up by
	Ryutaroh Matsumoto <ryutaroh@fujiyama.iijnet.or.jp>,
	although his patch was incorrect.  I've tested the patch
	below with SLIP, tip, and my serial mouse and everything
	works perfectly.

>How-To-Repeat:
>Fix:
diff -c  src/sys/arch/i386/isa/com.c.mhw1 src/sys/arch/i386/isa/com.c
*** src/sys/arch/i386/isa/com.c.mhw1	Sun Jul 31 06:13:27 1994
--- src/sys/arch/i386/isa/com.c	Sun Jul 31 06:14:45 1994
***************
*** 557,567 ****

  	s = spltty();

- 	/* and copy to tty */
- 	tp->t_ispeed = t->c_ispeed;
- 	tp->t_ospeed = t->c_ospeed;
- 	tp->t_cflag = t->c_cflag;
- 
  	if (ospeed == 0)
  		outb(iobase + com_mcr, sc->sc_mcr &= ~MCR_DTR);
  	else
--- 557,562 ----
***************
*** 591,597 ****
  	    (tp->t_cflag & CRTSCTS) != (t->c_cflag & CRTSCTS)) {
  		if ((t->c_cflag & CRTSCTS) == 0) {
  			tp->t_state &= ~TS_TTSTOP;
! 			ttstart(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}
--- 586,592 ----
  	    (tp->t_cflag & CRTSCTS) != (t->c_cflag & CRTSCTS)) {
  		if ((t->c_cflag & CRTSCTS) == 0) {
  			tp->t_state &= ~TS_TTSTOP;
! 			(*linesw[tp->t_line].l_start)(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}
***************
*** 605,615 ****
  	    (tp->t_cflag & MDMBUF) != (t->c_cflag & MDMBUF)) {
  		if ((t->c_cflag & MDMBUF) == 0) {
  			tp->t_state &= ~TS_TTSTOP;
! 			ttstart(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}

  	splx(s);
  	return 0;
  }
--- 600,615 ----
  	    (tp->t_cflag & MDMBUF) != (t->c_cflag & MDMBUF)) {
  		if ((t->c_cflag & MDMBUF) == 0) {
  			tp->t_state &= ~TS_TTSTOP;
! 			(*linesw[tp->t_line].l_start)(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}

+ 	/* and copy to tty */
+ 	tp->t_ispeed = t->c_ispeed;
+ 	tp->t_ospeed = t->c_ospeed;
+ 	tp->t_cflag = t->c_cflag;
+ 
  	splx(s);
  	return 0;
  }
***************
*** 722,728 ****
  		/* the line is up and we want to do rts/cts flow control */
  		if (msr & MSR_CTS) {
  			tp->t_state &= ~TS_TTSTOP;
! 			ttstart(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}
--- 722,728 ----
  		/* the line is up and we want to do rts/cts flow control */
  		if (msr & MSR_CTS) {
  			tp->t_state &= ~TS_TTSTOP;
! 			(*linesw[tp->t_line].l_start)(tp);
  		} else
  			tp->t_state |= TS_TTSTOP;
  	}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Sun Jul 31 04:48:07 PDT 1994 
State-Changed-Why:  
Patch applied. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.