Subject: Re: Serial Ports, PPP, and kernels
To: Aaron S. Magill <amagill@uiuc.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 02/11/1996 12:13:42
> 
> My first post, so be gentle, please ;-)
> 
> Ok, a couple of questions...
> First of all, in case it matters anywhere, I am running 1.1-current (as of
> Feb 1 I believe) on a Mac IIx w/ 8m of ram.
> 
> 1> Is there anyway to get some sort of handshaking support for pppd that
> actually works?  I think I read somewhere that hardware handshaking doesn't
> work, and I'll attest to the fact... it doesn't... unless I've missed
> something (I can't find where I read it originally...)
> 
> Currently I am running ppp on both serial ports, one to a PowerMac 7500,
> and one to a 28.8 modem which then connects to an internet provider, and
> then using FWTK to allow the PowerMac access to the internet (I only get 1
> IP address... time to look for a new provider!)  Eventually I'll be
> changing the connection to the PowerMac to an EtherNet connection, but for
> now...
> 
> Everything works, but transfer rates (esp FTP and HTTP) slow to a crawl
> when large files are transferred, and the syslog shows a lot of zd0b and
> zd0a overruns...
> 
> Even XON/XOFF handshaking would be ok if I can just figure out how to turn
> it on  (if it is supported)

Hardware flow control works now (the FAQ is out of date). Just turn on
crtscts, and output flow control will start working.

Part of the problem sounds like input flow problems. When using a modem,
the mac doesn't have an input flow control line (the one output, DTR,
is normally used to hang up the modem's phone line). I assume you are
seeing a lot of ring overflows (there are two kinds, ring & fifo)?

There isn't much the serial driver can do about these errors. The one
possible solution would be to make the ring buffer (defined in mac68k/
dev/zsvar.h) bigger. Your comments indicate that you can compile kernels,
so change these two lines in zsvar.h:
#define ZLRB_RING_SIZE 512              /* ZS line ring buffer size */
#define ZLRB_RING_MASK 511              /* mask for same */

Make them:
#define ZLRB_RING_SIZE 1024             /* ZS line ring buffer size */
#define ZLRB_RING_MASK 1023             /* mask for same */

The real source of the problem is that the tty system is not getting serviced
often enough. The driver gets an interrupt each time a character comes
in (and when characters have gone out, etc). If there are characters
waiting to be read when the interrupt gets serviced, they get taken out
of the "fifo" and put int the "ring" buffer. When the tty system has a moment,
it comes along and reads stuff out of the "ring" buffer. Thus what's
happening is that the tty system is not getting a chance to read the
ring buffer often-enough.

Adding more flow control won't help as the tty system, the bit on the
other end of the ring, is the part responsable for changing the HW
input flow control lines.

I can't debug these problems as I'm not experiencing them. I have a IIsi
with a 14.4 modem ppp'ing in. I run the serial port at 19200, and haven't
had an overflow (ring or fifo) since we changed the interrupt levels
in the middle of last month. I'm not saying they don't happen, just I
don't see them. :-(

I'd appreciate it if someone could track down these errors, especially if
someone could start and stop them at will. :-)

> 4> I had a question about a serial console, but I believe if I just disable
> ttye0, it should work... I'll write more on that if I need to latter.

Yes. Turn of ttye0, turn on the tty on the port you want, and have
console off. You need ttye0 off as the internal video does NOT get
initialized when serial console's on, so using it will bomb. :-(

Take care,

Bill