Subject: Re: serial line speeds...
To: Jeremy Cooper <jeremy@broder.com>
From: Bill Studenmund <skippy@macro.stanford.edu>
List: current-users
Date: 12/12/1997 16:03:11
On Fri, 12 Dec 1997, Jeremy Cooper wrote:

> On Thu, 11 Dec 1997 dillema@acm.org wrote:
> 
> > Somewhere in the include files I found 230400 Bps as a standard terminal
> > speed, it is however not accepted by stty or pppd. I noticed that the speed
> > in termios.h is represented with an unsigned int value. Does this mean max.
> > serial speed is 65565 Bps??? If so, I find it a bit strange that 115200 Bps 
> > is accepted just fine, while 230400 is not... I'm just being curious here. 
> 
> Serial line speeds are indeed represented to the kernel termios ioctl
> calls as unsigned integers.  However, they are represented in an
> enumerated fasion, not directly.  That is to say, 300, 600, and 1200 baud
> are represented as the baud rates 1, 2, and 3 respectively.  (This is just
> an example and not quoted directly from the real header file.)  This
> places a limit not on the highest baud rate that can be represented, but
> instead on the maximum number of baud rates that can be supported.

Not anymore! They used to be, and that's why we have B9600, B19200,
B38400, etc. But in NetBSD, these labels just map directly to the rate.
Also, neither the com nor the z8530tty serial drivers unmap baud rates.

Since the bit rate is a u_int32, and maxes out at over 4 billion, I think
we're safe. At least until we hook a trans-oceanic communications cable
up to a serial port. :-)

Take care,

Bill