Subject: hardware flow control problem
To: None <netbsd-bugs@NetBSD.ORG>
From: John R. Winans <winans@aps.anl.gov>
List: netbsd-bugs
Date: 01/13/1995 10:19:43
First, please let me ask a question,  How do I set up the ttys so that
	ixany is OFF be default?

Second, this has GOT to me a misfeature...

My Environment
--------------
	NetBSD 1.0 with patches up to #5 applied.  Running on a 386sx generic 
	motherboard, 4 16550s, and 1 IDE.

Problem Description
-------------------

If I insert the rtscts flag in my /etc/ttys file for a port that is 'on' and
log into it via modem and then run a program that looks like this:

while (1)
	printf("a long line of text..........................................\n");

I get some odd behavior.  The following is a description of a simple experiment:

1) 	Turn off tty01 in /etc/ttys
2) 	kill -1 1
3) 	I Plug in a modem to tty01.
4) 	Tip out to it and configure it to auto answer and use rtc/cts flow control.
5) 	Set tty01 to 'on rtscts' in /etc/ttys
6) 	kill -1 1
7) 	sttyflags -a
8) 	'ps' and see the getty running at 38.4
9) 	dial in to modem and sync up at 14.4 
10) log in and do a 'stty -a' 
	Note that tty is running at 38.4 (OK, since dte side of modem is too)
	Note that ixany is on for some reason.
11) Run print-loop program
12) Observe that the modem is turning cts off and on and that NetBSD is
    following along nicely.
13) During a period where the cts line of de-asserted and NetBSD is not
    sending data, hit the space key on the host that dialed in.
14) Observe that NetBSD resumes transmission even though cts is still 
    de-asserted.

Doing an 'stty -ixany' on tty01 and rerunning the above experiment yeilds a 
more desireable result.  That is, no matter what, when cts is de-asserted, data
stops flowing from NetBSD and when it is asserted, it restarts again.

However, I am pretty sure that this is NOT how it is supposed to work.  I 
should be able to use both rtscts AND xon/xoff flow control at the same time 
and ixany should also be allowed to be used w/o dorking over the rtscts.

What I would LIKE to use is '-ixon ixany -ixoff crtscts' on dial-up shell 
logins, and '-ixon -ixany -ixoff crtscts' for dial-up slip.

Any information would be appreciated... I looked thru the com driver and 
couldn't deciphering it since it has a miniscule amount of doc and I have no 
experience with drivers that talk to the UNIX tty/line code.  (I have only
done simple character device work in UNIX.)

--John