Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-12-2008, 01:34 AM
|
#1
|
Member
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75
Rep:
|
How can I know which driver/module is using each device
Hi folks,
I'm interested in knowing which module is being loaded for each piece of hardware I have in my machine.
I've read that some people execute lspci -knn and get below like output:
Quote:
04:00.0 Ethernet controller: Atheros Communications, Inc. AR5006EG 802.11 b/g Wireless PCI Express Adapter (rev 01)
Subsystem: Unknown device 1a32:0105
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at f8000000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [40] Power Management version 2
Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
Capabilities: [60] Express Legacy Endpoint, MSI 00
Capabilities: [90] MSI-X: Enable- Mask- TabSize=1
Capabilities: [100] Advanced Error Reporting <?>
Capabilities: [140] Virtual Channel <?>
Kernel driver in use: ath_pci
Kernel modules: ath_pci
|
As you can see, the kernel driver and module being used are specified.
Unfortunately, the lspci that I have does not support the -k option.
I'm using CentOS 5.2. lspci version 2.2.3
Any other ways of mapping the kernel drivers to my hardware?
Thanks
|
|
|
11-12-2008, 02:03 AM
|
#2
|
Senior Member
Registered: Nov 2005
Location: USA
Distribution: Mageia 7 - Debian 10 - Artix Linux
Posts: 1,142
|
What about the lsmod command?
|
|
|
11-12-2008, 04:03 AM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You can use the "-v" option of lspci. The module in use and modules are on the last two lines:
Code:
01:00.0 VGA compatible controller: nVidia Corporation Device 062a (rev a1) (prog-if 00 [VGA controller])
Subsystem: Toshiba America Info Systems Device ff01
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at ce000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
Memory at cc000000 (64-bit, non-prefetchable) [size=32M]
I/O ports at 2000 [size=128]
Capabilities: [60] Power Management version 3
Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [b4] Vendor Specific Information <?>
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nvidia
Also look as "modinfo" to learn more about the module, such as module option you could add in the /etc/modprobe.conf or /etc/modprobe.d/<device> entry.
/etc/modprobe.d/nvidia
Code:
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660
Code:
sudo /sbin/modinfo nvidia
filename: /lib/modules/2.6.25.18-0.2-default/kernel/drivers/video/nvidia.ko
license: NVIDIA
alias: char-major-195-*
alias: pci:v000010DEd*sv*sd*bc03sc02i00*
alias: pci:v000010DEd*sv*sd*bc03sc00i00*
depends: i2c-core
vermagic: 2.6.25.18-0.2-default SMP mod_unload
parm: NVreg_EnableVia4x:int
parm: NVreg_EnableALiAGP:int
parm: NVreg_ReqAGPRate:int
parm: NVreg_EnableAGPSBA:int
parm: NVreg_EnableAGPFW:int
parm: NVreg_Mobile:int
parm: NVreg_ResmanDebugLevel:int
parm: NVreg_RmLogonRC:int
parm: NVreg_ModifyDeviceFiles:int
parm: NVreg_DeviceFileUID:int
parm: NVreg_DeviceFileGID:int
parm: NVreg_DeviceFileMode:int
parm: NVreg_RemapLimit:int
parm: NVreg_UpdateMemoryTypes:int
parm: NVreg_UseVBios:int
parm: NVreg_RMEdgeIntrCheck:int
parm: NVreg_UsePageAttributeTable:int
parm: NVreg_EnableMSI:int
parm: NVreg_RegistryDwords:charp
parm: NVreg_NvAGP:int
Usually, there will be further documentation for kernel module options if you install the kernel-docs package. In the example I used, the documentation would be from nvidia instead. The command "/sbin/lscpi -n" will include the manufactures code, this makes a good item to include in a Google search, if you need to find which kernel module handles that hardware.
|
|
|
11-12-2008, 04:24 AM
|
#4
|
Member
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75
Original Poster
Rep:
|
Quote:
Originally Posted by FredGSanford
What about the lsmod command?
|
lsmod just displays the loaded modules, it does not say which device is using which module.
|
|
|
11-12-2008, 04:31 AM
|
#5
|
Member
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
You can use the "-v" option of lspci. The module in use and modules are on the last two lines:
Code:
01:00.0 VGA compatible controller: nVidia Corporation Device 062a (rev a1) (prog-if 00 [VGA controller])
Subsystem: Toshiba America Info Systems Device ff01
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at ce000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
Memory at cc000000 (64-bit, non-prefetchable) [size=32M]
I/O ports at 2000 [size=128]
Capabilities: [60] Power Management version 3
Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [b4] Vendor Specific Information <?>
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nvidia
Also look as "modinfo" to learn more about the module, such as module option you could add in the /etc/modprobe.conf or /etc/modprobe.d/<device> entry.
/etc/modprobe.d/nvidia
Code:
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660
Code:
sudo /sbin/modinfo nvidia
filename: /lib/modules/2.6.25.18-0.2-default/kernel/drivers/video/nvidia.ko
license: NVIDIA
alias: char-major-195-*
alias: pci:v000010DEd*sv*sd*bc03sc02i00*
alias: pci:v000010DEd*sv*sd*bc03sc00i00*
depends: i2c-core
vermagic: 2.6.25.18-0.2-default SMP mod_unload
parm: NVreg_EnableVia4x:int
parm: NVreg_EnableALiAGP:int
parm: NVreg_ReqAGPRate:int
parm: NVreg_EnableAGPSBA:int
parm: NVreg_EnableAGPFW:int
parm: NVreg_Mobile:int
parm: NVreg_ResmanDebugLevel:int
parm: NVreg_RmLogonRC:int
parm: NVreg_ModifyDeviceFiles:int
parm: NVreg_DeviceFileUID:int
parm: NVreg_DeviceFileGID:int
parm: NVreg_DeviceFileMode:int
parm: NVreg_RemapLimit:int
parm: NVreg_UpdateMemoryTypes:int
parm: NVreg_UseVBios:int
parm: NVreg_RMEdgeIntrCheck:int
parm: NVreg_UsePageAttributeTable:int
parm: NVreg_EnableMSI:int
parm: NVreg_RegistryDwords:charp
parm: NVreg_NvAGP:int
Usually, there will be further documentation for kernel module options if you install the kernel-docs package. In the example I used, the documentation would be from nvidia instead. The command "/sbin/lscpi -n" will include the manufactures code, this makes a good item to include in a Google search, if you need to find which kernel module handles that hardware.
|
Thanks jschiwal.
Unfortunately, I tried lspci -v (and -vv) before, but I don't get the Kernel module information whatsoever.
Quote:
04:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
Subsystem: Intel Corporation Unknown device 1001
Flags: bus master, fast devsel, latency 0, IRQ 82
Memory at f8000000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [c8] Power Management version 2
Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable+
Capabilities: [e0] Express Legacy Endpoint IRQ 0
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Device Serial Number 28-7e-4a-ff-ff-3c-1f-00
|
The modinfo may help, but it's quite cumbersome having to check each module seperately in order to know which hardware it serves. Also, modinfo is not always very descriptive regarding which specific piece of hardware it's serving.
|
|
|
11-12-2008, 10:22 PM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You did say "each of the devices" which includes devices with modules loaded.
Using your example:
Code:
locate 3945 | grep modules
/lib/modules/2.6.25.18-0.2-default/kernel/drivers/net/wireless/iwlwifi/iwl3945.ko
Checking with "modinfo iwl3945" confirms my guess that you need the iwl3945 kernel module.
Code:
modinfo iwl3945.
bash: modinfo: command not found
jschiwal@qosmio:~> /sbin/modinfo iwl3945
filename: /lib/modules/2.6.25.18-0.2-default/kernel/drivers/net/wireless/iwlwifi/iwl3945.ko
license: GPL
author: Copyright(c) 2003-2007 Intel Corporation
version: 1.2.23ks
description: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux
srcversion: 4A575718FCF5F831B2E2602
alias: pci:v00008086d00004227sv*sd*bc*sc*i*
alias: pci:v00008086d00004222sv*sd*bc*sc*i*
depends: mac80211,firmware_class
vermagic: 2.6.25.18-0.2-default SMP mod_unload
parm: antenna:select antenna (1=Main, 2=Aux, default 0 [both]) (int)
parm: disable:manually disable the radio (default 0 [radio on]) (int)
parm: hwcrypto:using hardware crypto engine (default 0 [software])
(int)
parm: debug:debug output mask (int)
parm: disable_hw_scan:disable hardware scanning (default 0) (int)
parm: queues_num:number of hw queues. (int)
parm: qos_enable:enable all QoS functionality (int)
You might also want to search on google and your package system to see of there is a "cutter" program you need to use as well. If you are lucky, the driver will work on it's own and you just need to install "wireless-tools" and "wpa_supplicant" to configure wireless.
Last edited by jschiwal; 11-12-2008 at 10:25 PM.
|
|
|
11-13-2008, 01:24 AM
|
#7
|
Member
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75
Original Poster
Rep:
|
Thanks Jschiwal,
I was looking for an alternative for "lsmod -knn" or "lsmod -v".
Your suggestions require a little more effort, but I think that they will do.
Thanks again.
|
|
|
All times are GMT -5. The time now is 07:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|