Tag Archive: modules.pcimap


pcimodules command, part of pciutils package, lists all the loaded modules corresponding to the PCI devices found and detected by the kernel. pcimodules needs the modules.pcimap file to run successfully. If missing, then you have to recreate it manually :

fool@localhost:~$ pcimodules
/lib/modules/3.0.0-1-686-pae/modules.pcimap: No such file or directory

root@localhost:~#depmod -m

root@localhost:~# ls -l /lib/modules/3.0.0-1-686-pae/modules.pcimap

-rw-r–r– 1 root root 441540 Sep 26 21:19 /lib/modules/3.0.0-1-686-pae/modules.pcimap

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              0×00001077 0×00002422 0xffffffff 0xffffffff 0×00000000 0×00000000 0×0

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

Follow

Get every new post delivered to your Inbox.