nancy.bedard | 23 Jan 01:21 2008
Picon

Words in my Heart

A Toast My Love http://68.54.138.43/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
John Powell | 29 Jan 00:47 2008

Getting the System Device Name for a sysfs_device

Is there a 'pretty' way to get the system device name for a given
sysfs_device?

For example I do the following...

device_bus = sysfs_open_bus("usb");
devices = sysfs_get_bus_devices(device_bus);

dlist_for_each_data(devices, device, struct sysfs_devices) {
	printf('Name: %s\n', device->name);
}

device-name isn't what I want at all. I want something in the form of 'sdX'
('sda' for example).

Regards,

John Powell
-- _______
  |  _____|_
 _|_|___  | |
| | |  John Powell                      jpowell at vmware dot com
| |_|__VMware Kernel Applications       direct: (650) 427-1777
|   |___|___|
|_______| 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
(Continue reading)

John Powell | 30 Jan 06:19 2008

Re: Getting the System Device Name for a sysfs_device


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'
attribute.

Anyway, I hope that maybe I have missed something obvious. Thanks in advance
for your time.

Regards,

John

-----Original Message-----
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

(Continue reading)

j-boogi | 31 Jan 06:12 2008
Picon

You... In My Dreams

Special Romance http://99.139.85.124/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane