finding the right module for the right hardware component using modules.[usb|pci]map file

All the modules available for the running kernel are located in the following directory : /lib/modules/$(uname -r)/

In this directory, there are several important files such as modules.pcimap and modules.usbmap. These files are created by depmod. They list all the modules available for the current kernel with the corresponding vendor id/model id of every hardware component which can be plugged to a PCI or USB bus.

Let’s have an example. I want to know which module to load for my fibre channel card (HBA) :

fool@localhost:~$ lspci |grep -i fibre

08:01.0 Fibre Channel: QLogic Corp. ISP2422-based 4Gb Fibre Channel to PCI-X HBA (rev 02)
08:01.1 Fibre Channel: QLogic Corp. ISP2422-based 4Gb Fibre Channel to PCI-X HBA (rev 02)

To get their respective vendor id/model id for each of them :

fool@localhost:~$ lspci -n |grep 08:01.0

08:01.0 0c04: 1077:2422 (rev 02)

Using the model id value, I can find the requested module’s name :

fool@localhost:~$ grep 2422 modules.pcimap
qla2xxx              0x00001077 0x00002422 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0

The approach can be reused for usb devices using the modules.usbmap file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s