LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 11-12-2008, 01:34 AM   #1
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Rep: Reputation: 15
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
 
Old 11-12-2008, 02:03 AM   #2
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia 7 - Debian 10 - Artix Linux
Posts: 1,142
Blog Entries: 5

Rep: Reputation: 207Reputation: 207Reputation: 207
What about the lsmod command?
 
Old 11-12-2008, 04:03 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
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.
 
Old 11-12-2008, 04:24 AM   #4
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by FredGSanford View Post
What about the lsmod command?
lsmod just displays the loaded modules, it does not say which device is using which module.
 
Old 11-12-2008, 04:31 AM   #5
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
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.
 
Old 11-12-2008, 10:22 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
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.
 
Old 11-13-2008, 01:24 AM   #7
ptemmerman
Member
 
Registered: Oct 2008
Location: Spain
Distribution: Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Guide needed in device driver / module compilation. SPo2 Linux - Newbie 1 09-30-2007 12:18 PM
Problem in inserting a device driver module rajesh_b Programming 5 05-10-2007 12:20 AM
How do you list the driver module used by a device? Timshel Linux - Hardware 3 02-13-2006 10:23 PM
Installing a device driver as a Module lehumphr Linux - Newbie 1 04-27-2004 11:31 PM
creating a simple module(device driver) pessanimahi Linux - Software 1 09-16-2003 11:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration