Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 1998 11:59:41 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Tom <tom@sdf.com>
Cc:        Terry Lambert <tlambert@primenet.com>, hackers@FreeBSD.ORG
Subject:   Re: cloning drivers 
Message-ID:  <199801250129.LAA00656@word.smith.net.au>
In-Reply-To: Your message of "Sat, 24 Jan 1998 16:56:22 -0800." <Pine.BSF.3.95q.980124165322.20454B-100000@misery.sdf.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sun, 25 Jan 1998, Terry Lambert wrote:
> 
> > I have a cloning pty driver and cloning bfs and tun and vnode
> > drivers as well.
> 
>   Can it become more generic so that any driver can be cloned?
> 
>   It seems silly to me that I need to recompile the kernel to support an
> additional (but identical to the first) ethernet card.  
> 
>   It seems to me that some of the PCI devices do this somewhat
> automatically right now?  IE. if you added a "device de0", it
> automatically makes devices de0 to de(N-1) for N DEC ethernet cards?

You're confusing a couple of related issues here.

A cloning driver is one where you walk up to some control node and say 
"I'll have a new one of these, thanks".  It's most useful for logical 
entities (like ptys, or bpfilter handles).

On the other hand, the number of instances of a device that a driver 
handles internally is dependant on the driver's internal policy.

Most drivers allocate a fixed-size static array of instance references 
at compile time.  This is done because at runtime they are (currently) 
only provided with their major/minor numbers when their entrypoints are 
called, and so lookup for the corresponding instance is easiest when 
simply indexing into the array.

This is what Jean-Mark Gurney is working on in the "interrupt argument 
to void *" thread, and one of the things that DEVFS aims to combat.  By 
allowing the driver to specify a token that will be handed back to it 
on entry, it becomes possible to dynamically allocate device instances 
and address them efficiently.

All it takes is developer time.  Want to get involved?


> Tom
> 
> 

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\ 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801250129.LAA00656>