Re: finding device driver associated with device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I leave quotations after my reply?

On Fri, Jan 18, 2008 at 03:51:42PM +0530, Onkar wrote:
>  # getcfg eth1
> HWD_HWDESC="eth1";
> HWD_HWDESCTYPE="interface";
> HWD_INTERFACE_N="1";
> HWD_INTERFACE_0="eth1";
> HWD_INTERFACEPATH_0="/sys/class/net/eth1";
> HWD_INTERFACETYPE_0="eth";
> HWD_ID="00:73:06:01:17:57";
> HWD_BUS_N="4";
> HWD_BUSNAME_0="pci";
> HWD_BUSID_0="0000:00:13.3";
> HWD_BUSNAME_1="usb";
> HWD_BUSID_1="usb4";
> HWD_BUSNAME_2="usb";
> HWD_BUSID_2="4-1";
> HWD_BUSNAME_3="usb";
> HWD_BUSID_3="4-1:2.0";
> HWD_DRIVER="cdc_ether";
> HWD_CONFIG_N="0";
> HWD_DEVICEPATH="/sys/devices/pci0000:00/0000:00:13.3/usb4/4-1/4-1:2.0";
> export  HWD_HWDESC HWD_HWDESCTYPE HWD_INTERFACE_N HWD_INTERFACE_0
> HWD_INTERFACEPATH_0 HWD_INTERFACETYPE_0 HWD_ID HWD_BUS_N HWD_BUSNAME_0
> HWD_BUSID_0 HWD_BUSNAME_1 HWD_BUSID_1 HWD_BUSNAME_2 HWD_BUSID_2
> HWD_BUSNAME_3 HWD_BUSID_3 HWD_DRIVER HWD_CONFIG_N HWD_DEVICEPATH;

Right, it tries to interpret sysfs. Good plan, actually:

erik@mythtv:~ > cd /sys/class/net/eth0/
erik@mythtv:class/net/eth0 > ls -l device
lrwxrwxrwx 1 root root 0 2008-01-18 09:50 device -> ../../../devices/pci0000:00/0000:00:19.0
erik@mythtv:class/net/eth0 > cd device
erik@mythtv:net/eth0/device > ls -l driver
lrwxrwxrwx 1 root root 0 2008-01-18 09:50 driver -> ../../../bus/pci/drivers/e1000
erik@mythtv:net/eth0/device > cd driver/
erik@mythtv:eth0/device/driver > pwd
/sys/bus/pci/drivers/e1000

So eth0 is serviced by the e1000 driver. Now let's try /dev/sda:

erik@mythtv:/sys/block/sda > pwd
/sys/block/sda
erik@mythtv:/sys/block/sda > cd device/driver
erik@mythtv:sda/device/driver > pwd
/sys/bus/scsi/drivers/sd

Right, it's serviced by the sd driver. What is the host driver? I know
there's only one scsi target, so:

erik@mythtv:sda/device/driver > cd 0:0:0:0/
erik@mythtv:device/driver/0:0:0:0 > pwd
/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0
erik@mythtv:device/driver/0:0:0:0 > cd ../../..
erik@mythtv:devices/pci0000:00/0000:00:1f.2 > pwd
/sys/devices/pci0000:00/0000:00:1f.2
erik@mythtv:devices/pci0000:00/0000:00:1f.2 > ls -l driver
lrwxrwxrwx 1 root root 0 2008-01-18 09:50 driver -> ../../../bus/pci/drivers/ahci
erik@mythtv:devices/pci0000:00/0000:00:1f.2 > cd driver
erik@mythtv:pci0000:00/0000:00:1f.2/driver > pwd
/sys/bus/pci/drivers/ahci

The host driver is the SATA ahci driver.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux