How-to : Check if a device is supported by any of the modules currently installed on your system

pci

Introduction

In my searches for few drivers in order to get some old devices works, I found the following to be useful and quite rare on the web. This would help one to find out if the current OS configuration support a given device.

In this post I will be using an ALC3220 Realtek based Intel audio chipset, the one that comes with a Dell Precision T1700.

 

 

1) Master plan

Here is the master plan that should help you to best understand the process as a whole.

  1. Finding the device pci alias
  2. Searching the modules.alias file for the device support (using the device PCI alias)
  3. Have a drink !

 

2) Finding the device pci alias

Remember I am searching for the Intel audio chipset driver, so let’s start by finding the corresponding PCI alias.

2.1 Finding the PCI address of the device

Let’s use lspci command for this :

[root@server ~]# lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3 Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d4)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d4)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation C226 Series Chipset Family Server Advanced SKU LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
01:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
03:00.0 PCI bridge: Texas Instruments XIO2001 PCI Express-to-PCI Bridge
05:00.0 VGA compatible controller: NVIDIA Corporation GK107 [NVS 510] (rev a1)
05:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)

or :

[root@server ~]# lspci |grep Audio
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)
01:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
05:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)

As you can see we have multiple audio devices, the only one we are interested in is the Intel one, the two other are used by the NVIDIA GPU for the HDI / Display Port connector (I guess).

lspci command excerpt (only the interesting line here) :

00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)

 

2.2 Getting the correct pci address form

PCI aliases located in the module.alias file (/lib/modules/$(uname -r)/modules.alias in a Red Hat based distro) are listed using the “number” style pci list, this means the Vendor and Device codes are not resolved (using the PCI ID list ref: man lspci), by using the -n & -s options of the lspci command (see this post for a bit more about lspci command) we can get this exact form :

[root@server ~]# lspci -n -s 00:1b.0
00:1b.0 0403: 8086:8c20 (rev 04)

Note : You have noted that you need to pass the correct PCI address to the -s option (as seen in the above excerpt).

Now the interesting part is :

 8086:8c20

Where :

  • 8086 : Is the Vendor code for Intel Corporation
  • 8c20 : Is the Intel code for this very device

 

3) Searching the modules.alias file

As we now have everything we need, let’s search in the appropriate location : the modules.alias file (/lib/modules/$(uname -r)/modules.alias in a Red Hat based distro), launching a simple grep should do the job :

grep --color=auto -i 8086.*8c20 /lib/modules/*/modules.alias

I added the --color option to make the output a bit more “human readable” (you may already have this in you .bashrc or aliases file), also do not forget the -i option as the lspci command would return a lower-case address and the modules.alias file store addresses as upper-case…

Sample output for a supported device :

[root@server ~]# grep --color=auto -i 8086.*8c20 /lib/modules/*/modules.alias
/lib/modules/2.6.18-348.el5/modules.alias:alias pci:v00008086d00008C20sv*sd*bc*sc*i* snd-hda-intel

Sample output for a NOT supported device :

[root@server ~]# grep --color=auto -i 8086.*8c20 /lib/modules/*/modules.alias
[root@server ~]#

 

 

Conclusion

As usually feel free to ask in the comment section if you do have any questions.

 

Resources

 

More “Sysadmin” posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site supports SyntaxHighlighter via WP SyntaxHighlighter. It can highlight your code.
How to highlight your code: Paste your code in the comment form, select it and then click the language link button below. This will wrap your code in a <pre> tag and format it when submitted.