Michael Mol wrote:
On Sun, Oct 9, 2011 at 9:30 AM, Michael Mol<mike...@gmail.com>  wrote:
On Sun, Oct 9, 2011 at 12:53 AM, Lavender<448463...@qq.com>  wrote:
Yeah, your reply is exact what I mean , but I'm really confused by those
modules' names, I can't find any contact between the hard device name and
its module name . For example,  there is a module named 3c59x.ko , I totally
don't know what device it present for ,
This got a *lot* easier back when sysfs was added.

cd /sys/module/<modulename>/drivers/

And go from there

lspci will help you see the 'text' name for the device in question.

For example, let's say I don't know what the 'ahci' module is for.

$ cd /sys/module/ahci/drivers
$ ls
pci:ahci
$ cd pci\:ahci/
$ ls
0000:00:11.0  bind  module  new_id  remove_id  uevent  unbind
$ sudo lspci|grep 11.0
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA
Controller [AHCI mode]
$

So now I know the ahci module manages my SATA controller.
Came up with something possibly a little handier. This command should
tell you what driver is associated with every device on the system.

find /sys/devices -name driver -print0|xargs -0 ls -l|cut -d' '
-f10-|sed -e 's/\.\.\///g'

Output could probably still be a bit better cleaned up, but it should help.


Let's not fail to mention lspci -k either.  That is a handy tool.

Dale

:-)  :-)

Reply via email to