Subject: Re: How minor numbers are allocated?
To: Mahadeva Swamy T L <Swamy@soc-soft.com>
From: None <cube@cubidou.net>
List: tech-kern
Date: 12/29/2003 12:59:34
On Mon, Dec 29, 2003 at 05:07:47PM +0530, Mahadeva Swamy T L wrote:
> Hi,
> 
> How the minor numbers are created in NetBSD for any driver?. which is
> the function which creates and links this to the device. Please let me
> know.

The driver handles minor numbers by itself.

It gets a major number registered along with a {c,b}devsw structure
containing pointers to the various operations (open, close, ioctl,
read...).  The first parameter of all those functions is of type
dev_t, which contains both the major and minor numbers.

Then the drivers acts accordingly to the value of that parameter.

Quentin Garnier.