Re: [ANNOUNCE] Hardware detection tool 0.2

From: Greg KH (greg@kroah.com)
Date: Fri Aug 31 2001 - 19:08:22 EST


On Fri, Aug 31, 2001 at 07:46:38PM -0400, jeff millar wrote:
> What bus and slot number does the driver use to register itself before the
> plugging the card?

I don't understand what you are asking here.
In pci_module_init you pass a pointer to your struct pci_driver object
that describes to the pci subsystem what kind of pci devices that your
driver works for. It does this with the id_table pointer which is a
struct pci_device_id.

MODULE_DEVICE_TABLE takes that struct pci_device_id table and exports it
to an area in the module object table that allows it to be extracted by
depmod. depmod takes that info and creates
/lib/modules/<kernel_version/modules.pcimap from it. So any userspace
code can then look at the modules.pcimap file and determine what kind of
pci devices each module is claiming it supports.

Using that table, combined with tools like lspci, a userspace program
can build a table of kernel modules that a given hardware platform
needs. And if it wants to, from the kernel module list, it can generate
a .config file, which is what I think Carlos is trying to do. And what
I thought this thread was talking about.

This whole process did not involve any hotplug stuff at all.

But if you want to use it for hotplug you can :)
See my OLS 2001 paper and presentation at http://www.kroah.com/linux/
and http://linux-hotplug.sf.net/ which contains lots of good
documentation if you want to know more on how the linux-hotplug
subsystem currently works.

Did that help?

thanks,

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



This archive was generated by hypermail 2b29 : Fri Aug 31 2001 - 21:00:36 EST