Subject: Re: how to get unit number & ioctl numbers?
To: None <port-i386@netbsd.org>
From: T. William Wells <bill@twwells.com>
List: port-i386
Date: 09/15/1994 00:40:11
In article <9409142217.AA06435@alpha.bostic.com>,
Chris G. Demetriou <cgd@alpha.bostic.com> wrote:
: > I'm going to need
: > a major device number for it as well as a couple of ioctl numbers (for
: > get/set sio parameters).
:
: Like what parameters?

The delay parameters at close:

	1) Delay after the transmitter has drained, before dropping DTR.
	2) The length of time to keep DTR down.
	3) The length of time after DTR is restored before opens are allowed.

and also the receive FIFO trigger level. These all get passed using a single
structure. Other things might be passed in that structure, if the need arises.

: > What do I do to get them?

I've got a program, siocontrol, that will, among other things, set these
parameters or print them.

: > Maybe a name
: > other than sio would also be a good idea?
:
: I'd say, if it's a replacement for 'com', call it 'com'.  i.e. people
: shouldn't need to worry about configuring it differently.

It's not a plug-in replacement for com. For example, to implement
bidirectional ports, I use a bit in the minor device to distinguish callin
from callout units. Com uses ttselect, which naively indexes com_tty with the
minor device number, and this loses. So, my driver has a select routine,
which adjusts the minor device, before calling ttselect.