On Wed, 21 Mar 2001, Rev Simon Rumble wrote:

> On Wed, Mar 21, 2001 at 11:48:05PM +1100, Ian Tester uttered:
> 
> > Are you just confused about the device names?
> > /dev/radio0 is your first radio device. The Video4Linux devices are allocated as
> > each driver is loaded. When you load the driver for your radio card, it will
> > probably take /dev/radio0, unless you have others already loaded :)
> 
> Ahhhh...  I thought each device _driver_ had a minor number uniquely
> identifying the type of device.  However it seems I'm mistaken and in
> fact the minor numbers are allocated for each device of that type...
> Cool that makes sense now.

Major numbers are associated with device drivers - each has their own. The minor
number is passed along as an argument to the driver. The driver does whatever
it wants with the minor number.

The situation with Video4Linux is happening/has happened with many other "kernel
subsystems". One central device driver (e.g videodev.o) manages several
sub-drivers. It exports a set of registering and unregistering functions and
when each sub-driver is (un)loaded they use these to register some resource with
the main driver. This saves on duplication, makes it much simpler to support
multiple simultaneous devices, and keeps everything cleaner and more modular.
Look at the SCSI and USB subsystems for other examples of this approach.

bye

-- 
8<--------8<--------8<--------8<--------8<--------8<--------8<--------
Ian Tester   *8)#          \7\    LINUX: because geeks will find a way
[EMAIL PROTECTED]       \7\      http://www.zipworld.com.au/~imroy



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to