Re: devfs - why not ?

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu Apr 13 2000 - 10:08:43 EST


Keith Owens wrote:
> >You mean like the PCI registered codes? Or Linux-specific ones?
>
> MODULE_DEVICE_TABLE points at a struct <type>_device_id, currently he
> only defined type is pci.
>
> struct pci_device_id {
> unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
> unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
> unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
> unsigned long driver_data; /* Data private to the driver */
> };
>

An alternative is to use a string with wildcards. You get no endless
duplication of PCI_ANY_ID, and you don't need new macros for
different buses or different patterns to match.

Also things like bus names from new drivers can be ignored by an older
kernel/modutils that doesn't understand them.

MODULE_DEVICE_SUPPORTED ("pci-11f1-2249-*-*-net-*", 0);
MODULE_DEVICE_SUPPORTED ("pci-11f1-224a-*-*-net-*", 0);
MODULE_DEVICE_SUPPORTED ("isapnp-114422334455667899fdeffefed-creative-*", 0);
                     
That's not exactly the right form, but gives the general idea.
Just a thought.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:21 EST