Subject: Re: 32 bit dev_t, Revision 3
To: None <, tech-kern@NetBSD.ORG>
From: Chris Torek <torek@BSDI.COM>
List: tech-kern
Date: 01/13/1998 16:25:31
>What is the definition of 'unit'?

It is all up to the drivers, but for disk drivers, "unit" is the
unit and "subunit" is the partition (max of 1023 partitions).  On
the scsi tape driver, we have 1 bit of "no rewind", at the bottom,
8 bits of raw "density code" data in the middle, and one bit of
"fixed size records" at the top.  (Bizarre encoding, if you ask
me; I imagine it "jest grew"...)

>How about multi-port TTY devices ...

Up to the drivers. :-)  I really do not know for sure, although I
suspect that no one has changed any of the minor(dev) macros in
(all | most) of them, so they just get the whole 20 bits.

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

Presumably the bpf code was also left unchanged.

I changed the `mknod' program to use dv_makedev (== major+unit+subunit)
if given 3 numeric arguments, and to use makedev (== major+minor)
if given 2, so most old uses "just work".  Then "ls" got really
confusing, though, and we went to just printing as 3 numbers, with
the middle one often being 0.  It is kind of cheesy, but it works
well in practice, as the unchanged drivers never get past minor
number 255.