Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: minors



On Wed, Jun 02, 2004 at 05:11:36PM +0400, Manu Abraham wrote:
> > Yes, but someone will have to do the work to change it. And it's also
> > no bad to leave it unchanged for the moment, so that people who don't
> > use devfs can upgrade from 2.4 to 2.6 without having to recreate
> > their device nodes. IMHO it's better to wait until we have proper udev
> > support.
> >
> > Johannes
> 
> Johannes,
> 
> 			Thanks Johannes, you lifted off a big weight off my head. I have 2 more 
> doubts.
> 
> 	1) The allocation of minors, there have been a lot minor numbers left off 
> between one card and the other.
> 
> say for eg,
> 
> Card 0 has minors 3,4,5,7
> Card 1 has minors 67,68,69,71
> Card 2 has minors 131,132,133,135
> 
> 	as you see a lot of minor numbers have been left out say between 9 and 67, 
> considering that minors are allocated as per the hardware requirements for 
> various cards, which explains the minors from 0 to 8.

Originally the idea was to infer the type of the device from the
minor number by masking out some bits. We have STB hardware that
supports up to 3 demux channels, so we need to bits for the
device number. We have 9 different device types, so we need 4 bits
to encode them. this leaves two bits for the adapter number...

But the way dvb_device_open() / dvbdev_find_device() is currently
implemented, we could assign minor numbers more flexibly. E.g.
we could use 3 bits for the adapter number, and 5 bits for
the adapters devices (not encoding their type). However this
won't work for people who use MAKEDEV scripts.


> 	2) with devfs, devfs is supposed to automatically allocate minors dependant 
> upon the drivers. ie, the issue as stated earlier should not arise. I have 
> the same scenario with or without devfs.
> 
> 	The minor numbers do not change at all. I dug into the code and found that 
> the nums2minor inline function is allocating the minors no matter whether one 
> uses devfs or not.
> 
> 	Is it possible to change this scenario, without impacting the normal 
> behavior.

The old DVB drivers had a CONFIG_DVB_DEVFS_ONLY option which allowed
one to use more than four cards.

I think it was dropped because it was difficult to maintain backwards
compatibility, and because devfs is deprecated in 2.6 (because of udev).


Johannes




Home | Main Index | Thread Index