-Title: Which module is loaded for a given PCI device?
+Title: Which module is loaded for a given PCI and USB device?
Tags: english, debian
-Date: 2011-01-23 00:15
+Date: 2011-01-23 00:20
-<p>In the discover-data package in Debian, there is a script to report
-useful information about the running hardware for use when people
-report missing information. One part I find very useful when
-debugging, is the part report which kernel module is loaded for a
-given PCI device. To see the output, make sure discover-data is
-installed and run <tt>/usr/share/bug/discover-data 3>&1</tt>. The
-relevant output on one of my machines like this:
+<p>In the
+<a href="http://packages.qa.debian.org/discover-data">discover-data</a>
+package in Debian, there is a script to report useful information
+about the running hardware for use when people report missing
+information. One part of this script that I find very useful when
+debugging hardware problems, is the part mapping loaded kernel module
+to the PCI device it claims. It allow me to quickly see if the kernel
+module I expect is driving the hardware I am struggling with. To see
+the output, make sure discover-data is installed and run
+<tt>/usr/share/bug/discover-data 3>&1</tt>. The relevant output on
+one of my machines like this:</p>
<pre>
loaded modules:
module=`cd $address/driver/module ; pwd -P | xargs basename`
if grep -q "^$module " /proc/modules ; then
address=$(echo $address |sed s/0000://)
- id=`lspci -n -s $address | tail -n 1 | awk '{print $3}'`
+ id=`lspci -n -s $address | tail -n 1 | awk '{print $3}'`
echo "$id $module"
fi
fi