2000-11-24 11:01:55

by Adam J. Richter

[permalink] [raw]
Subject: Patch: MODULE_DEVICE_TABLE's for all remaining PCI drivers in linux-2.4.0-test11

>Date: Wed, 22 Nov 2000 13:02:24 +0000
>From: Tim Waugh <[email protected]>
>Hurray! Someday we'll have pci_device_id tables for all PCI devices..

That someday is today.

A complete patch covering all of the new PCI MODULE_DEVICE_TABLE's
is FTPable from
I have also attached a subset of that patch below covering all of the
drivers that were not covered in my previous posts to linux-kernel
(which covered block, char, net, and scsi).

With these changes, it will be possible to simplify linux
distributions a bit, in terms of installation, maintenance,
and internal structure. This is potentially important for Linux
adoption, especially among users who are not linux-kernel people.
By having complete coverage, we also make it much more likely that
any new drivers that are developed by adapting an existing driver
(and almost all are) will be likely to include appropriate
MODULE_DEVICE_TABLE's as well. Indeed, this mechanism is more
important to externally provided drivers, since depmod will automatically
pick up their device ID information after they are deposited in the
/lib/modules/<version> tree and depmod is run. Finally, these changes
also eliminate a small step in porting these drivers to the new PCI
interface. This may help motivate device driver authors to attempt
that after 2.4.0.

In the past, I have offered to include the patch that
I submitted for pciutils that adds the "pcimodules" program, that
uses /lib/modules/<version>/modules.pcimap and /proc/bus/usb to
generate a list of modules applicable to the current hardware.
Since it has been a while, and I have not seen a new pciutils release,
I have placed that patch in
I would encourage people to give it a whirl (please see its manual page
for an example of how to integrate it into a boot script).

Notes about the patch:

This is not a "final" release. I imagine I have made mistakes,
and I am interested in corrections.

There are a few files that I have deliberately skipped:

drivers/net/de4x5.c - This driver wants to look at every
ethernet PCI device and determine
compability by reading the eeprom,
plus tulip.c handles the same devices.

drivers/radio/radio-maestro.c - I don't understand why this
driver exists. Why does it have to
speak to maestro hardware directly?
Shouldn't there be some generic sound
interface for it to use? Anyhow, the
only PCI ID's that it seems to select
for are those indicating a maestro sound
card, and I assume most maestro users
will not want to load this module.
I also do not know if the maestro
sound system is useable if this driver
is loaded.

drivers/scsi/eata_pio.c - eati_dma.c supports the same devices.
Is there some PCI-based circumstance when
it would be better to use eata_pio?

drivers/sound/maestro.c - I have submitted a port of this
to the new PCI interface and do not
to collide with it.

drivers/sound/cs46xx.c - Likewise, I understand there is a port of
this to the new PCI interface and I
do not to collide with it.

drivers/usb/{usb-,}uhci.c - I have sent patches porting
these drivers to the new PCI interface,
and do not want to collide with them.

Although the patch I have attached below covers only
the drivers for which I have not posted patches previously,
the complete patch covering all of the PCI MODULE_DEVICE_TABLE's added
is FTPable from

With the exception of ohci1394.c, the only "-" lines in these
patches exist to ensure that <linux/module.h> is always included, so
the MODULE_DEVICE_TABLE macro is defined.

In the special case of ohci1394.c, I was able to avoid having
a complex vendor_id/device_id table by changing the driver instead to
just look for the appropriate PCI device class (there is one specifically
for IEEE1394 OHCI controllers). Many thanks to Sebastien Rogeaux for
letting me know that this was OK and verifying that the resulting drivers

Anyhow, here is the patch for the drivers that I had not covered
in my previous posts. This includes atm, ieee1394, isdn, media/video,
video, and one driver in telephony. The larger pci_device_id tables
now use a macro to make the table more readable, as suggested by
Keith Owens and refined a bit by Jeff Garzik. Since this addresses
the reduncancy and readability issue with large tables, all of these
new tables use named initializers (by the way, I did not invent that
practice for pci_device_id tables; I think it originated in usb/usb-ohci.c
by David Brownell). Again, the complete patch covering all of the
MODULE_DEVICE_TABLE changes is FTPable from

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
[email protected] \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

(No filename) (5.17 kB)
diffs.new (30.03 kB)
Download all attachments