我想知道列出特定设备 ID 的 Linux 内核包中所有模块的文件在哪里?该文件(路径)在哪里?
pci.ids 和 usb.ids 包含设备 ID 和设备名称,但不包含该设备的模块。例如,在 pci.ids 中有一行“ 10ec 8169 RTL8169/8110 Family PCI Gigabit Ethernet NIC”,但它没有包含该设备的模块名称“r8169”。
在 esxi 中有一个 simple.map 文件,上面的例子里有一行“10ec:8169 0000:0000 network r8169”。但我在 linux 中找不到它?(我的 linux 是 opensuse 12.2)
谢谢并致以诚挚问候
答案1
lspci -v
或怎么样lspci -k
?
06:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
Subsystem: Intel Corporation Device 1050
Flags: bus master, fast devsel, latency 0, IRQ 44
Memory at da000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: <access denied>
Kernel driver in use: iwl3945
Kernel modules: iwl3945
您也可以按照以下步骤进行判断:
$ lspci | grep -i wireless
06:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
$ lspci -n | grep 06:00.0
06:00.0 0280: 8086:4222 (rev 02)
$ grep 4222 /lib/modules/2.6.38-gentoo/modules.pcimap
iwl3945 0x00008086 0x00004222 0xffffffff 0x00001005 0x00000000 0x00000000 0x0
iwl3945 0x00008086 0x00004222 0xffffffff 0x00001034 0x00000000 0x00000000 0x0
iwl3945 0x00008086 0x00004222 0xffffffff 0x00001044 0x00000000 0x00000000 0x0
iwl3945 0x00008086 0x00004222 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
$ modinfo iwl3945
filename: /lib/modules/2.6.38-gentoo/kernel/drivers/net/wireless/iwlwifi/iwl3945.ko
firmware: iwlwifi-3945-2.ucode
license: GPL
author: Copyright(c) 2003-2010 Intel Corporation <[email protected]>
version: in-tree:ds
description: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux
srcversion: 65739B23FCE2B5359078B5A
alias: pci:v00008086d00004227sv*sd*bc*sc*i*
alias: pci:v00008086d00004222sv*sd*bc*sc*i*
alias: pci:v00008086d00004227sv*sd00001014bc*sc*i*
alias: pci:v00008086d00004222sv*sd00001044bc*sc*i*
alias: pci:v00008086d00004222sv*sd00001034bc*sc*i*
alias: pci:v00008086d00004222sv*sd00001005bc*sc*i*
depends:
vermagic: 2.6.38-gentoo SMP mod_unload PENTIUM4
parm: antenna:select antenna (1=Main, 2=Aux, default 0 [both]) (int)
parm: swcrypto:using software crypto (default 1 [software])
(int)
parm: debug:debug output mask (uint)
parm: disable_hw_scan:disable hardware scanning (default 0) (deprecated) (int)
parm: fw_restart3945:restart firmware in case of error (int)
答案2
您可以在文件系统中找到从设备到模块的符号链接/sys
:
$ ll /sys/class/net/wlan0/device/driver
lrwxrwxrwx. 1 root root 0 sep 22 11:46 /sys/class/net/wlan0/device/driver -> ../../../../bus/pci/drivers/ath9k
您可以使用driver
以下方式查找所有符号链接/sys
$ find /sys -type l -name 'driver' -ls