Re: Getting the System Device Name for a sysfs_device
John Powell <jpowell <at> vmware.com>
2008-01-30 05:19:38 GMT
After a day of getting familiar with what libsysfs provides I think I can
articulate my problem more completely.
It basically boils down to this. I need to search for a specific usb device
on the host and return the block device name associated with that usb device.
I can use sysfs to get the sys_device off of the usb bus, but there doesn't
seem to be anything around to translate or link that device into the device
off the scsi bus. Both trees contain attributes that I need. (idProduct,
idVendor, size and device name for example).
At the moment sysfs is doing half of the work for me. I grab the device off
the usb bus, examine 'idProduct' and 'idVendor'. Then have to search the
device path for the 'block:sdXX' under hostXX/targetYYY link. Once I have the
block device name I can open the device on the scsi bus and get 'size'
Anyway, I hope that maybe I have missed something obvious. Thanks in advance
for your time.
From: John Powell
Sent: Mon 1/28/2008 3:47 PM
To: 'linux-diag-devel <at> lists.sourceforge.net'
Subject: Getting the System Device Name for a sysfs_device