Subject: Re: 32 bit dev_t, Revision 3
To: Chris Torek <torek@BSDI.COM>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: tech-kern
Date: 01/13/1998 15:01:47
> Just FYI, we have:

thanks for that information!


>  - a combined "devsw" (no separate b-vs-c; a device can be used
>    as a block device iff it has a strategy routine)

This is a reasonable way to tell, yes.  "no need for flags, then."  8-)


>  - 32-bit dev_t split up as {
> 	12 bits major
> 	20 bits minor {
> 	   10 bits "unit"
> 	   10 bits "subunit"
> 	}
>    }
>    (interpretation of minor is left to the device itself; disks and
>    tapes use the subunit while ttys are generally just sequential);
>    ls -l shows <major,unit,subunit> (even on ttys).

What is the definition of 'unit'?  For example, take SCSI.  Does
device,LUN -> unit and partition number -> subunit, or does device ->
unit and LUN fit into subunit (with other information, e.g. partition
number)?  Looking at the list Paul Vixie posted, it looks like the
former.

How about multi-port TTY devices (e.g. cyclom boards, etc.?)  In that
case, does 'unit' correspond to driver unit, and 'subunit' correspond
to the individual ttys, or do the ttys all get their own individual
'unit' numbers?  (I can see logic for either, though probably more
justification for the former.  Paul didn't provide much tty
information.)

In that list, he showed bpf units as having different subunits but all
the same 'unit'.  Why was that done that way?


Could you provide more information about how you use 10 'subunit'
bits?  (even for tape modes, that seems a bit excepssive!)  Also, a
bif of explanation about how units and subunits are 'intended' to be
allocated?


>  - new macros (make the obvious changes to the old ones):
> [ ... ]
>  - the devsw struct looks like this [fn params squished out for space]:
> [ ... ]

Right, makes sense.


Thank you for the information!



chris