linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to determine physical bus of a device and find it there
@ 2004-01-20  2:52 Kay Sievers
  2004-01-20 14:09 ` Olaf Hering
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Kay Sievers @ 2004-01-20  2:52 UTC (permalink / raw)
  To: linux-hotplug


Hi,
I want to collect all possible attributes of a device with the udevinfo
program. This issue is also still unresolved with udev.

We need to determine the device on its physical bus not only the logical.
Here is a example for a usb-storage device with its logical 'scsi' and
physical 'usb' bus:

First I look in the hotplug provided directory and I find:

/sys/block/sda

  SYSFS_dev="8:0"
  SYSFS_range="16"
  SYSFS_size="31360"
  SYSFS_stat="      12        0       96       87        0        0 0        0        0       87       87"

then following the "device" link, I get on the scsi bus
/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/host5/5:0:0:0

  SYSFS_detach_state="0"
  SYSFS_type="0"
  SYSFS_vendor="SMSC    "
  SYSFS_device_blocked="0"
  SYSFS_queue_depth="1"
  SYSFS_scsi_level="3"
  SYSFS_model="USB 2 HS-CF"
  SYSFS_rev="1.25"
  SYSFS_online="1"

but the really interesting attributes are on the usb bus:
/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1':

  SYSFS_detach_state="0"
  SYSFS_bNumConfigurations="1"
  SYSFS_bNumInterfaces=" 1"
  SYSFS_bConfigurationValue="1"
  SYSFS_bmAttributes="80"
  SYSFS_bMaxPower=" 48mA"
  SYSFS_idVendor="0424"
  SYSFS_idProduct="20fc"
  SYSFS_bcdDevice="0125"
  SYSFS_bDeviceClass="00"
  SYSFS_bDeviceSubClass="00"
  SYSFS_bDeviceProtocol="00"
  SYSFS_speed="12"
  SYSFS_manufacturer="SMSC"
  SYSFS_product="USB 2 Flash Media Device"
  SYSFS_serial="0305037000C2"


So, how do I reliable get there?
Do I need to extract the information from the path,
but what part of the string I can take out?
Shouldn't the kernel provide a link?
Do we need some magic here :)

thanks,
Kay


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-01-23  1:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-20  2:52 how to determine physical bus of a device and find it there Kay Sievers
2004-01-20 14:09 ` Olaf Hering
2004-01-22 22:40 ` Greg KH
2004-01-22 22:58 ` Greg KH
2004-01-22 23:27 ` Kay Sievers
2004-01-22 23:42 ` Kay Sievers
2004-01-23  1:42 ` Greg KH
2004-01-23  1:43 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).