>>> On Fri, 16 Nov 2001 08:31:42 +0100, "Bjorn Boxstart"
>>> <boxstart@xxxxxxxx> said:
boxstart> Hello All, According to the readme that comes with devfs,
boxstart> Devfs should solve the problem of having minors and majors.
Ah, it does, it does...
boxstart> I thought this would help me with using over 16 USB printers
boxstart> at once. After installation however, I still can use only 16
boxstart> printers. Can anybody clarify for me what I misunderstood.....
Well, how the minor device number (device id) is interepreted is up to
the driver, and how big its internal tables are, 'devfs' cannot work
around that.
If the driver has a compiled in number of devices, like in your case in
'drivers/usb/printer.c':
#define USBLP_MINORS 16
static struct usblp *usblp_table[USBLP_MINORS];
that's how the driver is written. If you want more than 16 printers you
have to change that definition above and recompile the driver, there is
no way around that.
Most drivers don't support an arbitrary number of devices, they have
statically allocated device state tables, like the USB printer driver.
'devfs' solves the two big problems with static allocation of '/dev/'
entries (not of device state entries in the driver) to major and minor
numbers:
* Static allocation of major device numbers (driver id).
* Static definition of an '/dev/' entry for every possible minor number
(device id).
Since '/dev/' entries are created dynamically, based on what the driver
itself tells 'devfs', their major numbers need not be known in advance,
as only the drivers actually present will trigger the creation of
'/dev/' entries, and only the number of entries corresponding to the
actual number of minor numbers defined by the driver is created.
In your case, it means that no matter what number you put in the
definition of 'USBLP_MINORS', the right number of '/dev/printers/'
entries will be created automagically.
|