Subject: port-i386/450: mis-feature in i386/isa/com.c?
To: None <gnats-admin>
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
List: netbsd-bugs
Date: 08/31/1994 11:05:07
>Number:         450
>Category:       port-i386
>Synopsis:       modem doesn't hang up
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 31 11:05:05 1994
>Originator:     Alasdair Baird
>Organization:
absolutely none whatsoever
>Release:        current (29 Aug 94)
>Environment:
System: NetBSD wildcat.demon.co.uk 1.0_BETA NetBSD 1.0_BETA (WILDCAT) #54: Tue Aug 30 21:50:09 BST 1994 root@wildcat.demon.co.uk:/usr/src/sys/arch/i386/compile/WILDCAT i386


>Description:
	The com driver used in NetBSD is "based on HP dca driver".  I
	have identified one change that has been made that I figure
	should be un-made; in comclose() the condition for dropping
	all modem control signals has been changed in such a fashion
	that when I do something such as kill off a pppd the modem
	does not immediately go on-hook.  (This is NOT a modem problem!)
	The change made bases the decision to hangup upon whether the
	soft carrier flag is set; I believe this is a misinterpretation
	of what soft carrier is for.  It is my firm belief that the
	reason for soft carrier is that typically after the computer
	asserts dtr the modem is pretty quiet (bar some rts/cts-ing),
	and doesn't show a cd until after a successful dialing; as the
	comopen() routine requires a carrier to be present to complete
	this would cause problems unless the fake software carrier is
	used.  This is the *only* reason for a software carrier---it has
	no purpose in comclose() I believe.  Certainly I can find no
	other serial driver using it in this fashion, so I can only
	presume this change was made to facilitate the fixing of someone
	else's modem problems (don't give them my address if this change
	change is made!).
>How-To-Repeat:
	Stick a modem on a "softcar" direct connect, run up a pppd and
	then "kill -HUP" it.  Listen to the modem (if it has a speaker)
	then being off-hook for a long while until it takes it upon
	itself eventually to hangup.
>Fix:
	Undo the change in comclose() to bring it back into line with
	the dca and other serial drivers:


*** /sys/arch/i386/isa/com.c	Wed Aug 24 22:35:08 1994
--- com.c	Tue Aug 30 21:46:56 1994
***************
*** 356,363 ****
  	{
  		bic(iobase + com_cfcr, CFCR_SBREAK);
  		outb(iobase + com_ier, 0);
! 		if (tp->t_cflag & HUPCL &&
! 		    (sc->sc_swflags & COM_SW_SOFTCAR) == 0)
  			/* XXX perhaps only clear DTR */
  			outb(iobase + com_mcr, 0);
  	}
--- 356,363 ----
  	{
  		bic(iobase + com_cfcr, CFCR_SBREAK);
  		outb(iobase + com_ier, 0);
! 		if (tp->t_cflag & HUPCL ||
! 		    tp->t_state & TS_WOPEN || (tp->t_state & TS_ISOPEN) == 0)
  			/* XXX perhaps only clear DTR */
  			outb(iobase + com_mcr, 0);
  	}

>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------