Re: Figuring out devnodes from a usb device

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

 



On Tue, Aug 03, 2010 at 10:28:18AM +0300, Felipe Balbi wrote:
> On 08/03/2010 01:29 AM, Greg KH wrote:
> Hi,
> 
> Thanks for you reply Greg
> 
> > On Sun, Aug 01, 2010 at 10:58:07PM +0300, Felipe Balbi wrote:
> >> Hi all,
> >>
> >> I'm trying to figure out how I could find all devnodes related to a USB
> >> device.
> > 
> > That's hard, as there are lots of different types of USB devices.
> > 
> > It's like saying, "I want to find all devnodes for a PCI device" :)
> > 
> >> For example, if I attach a usb mass storage device I want to
> >> figure out which /dev/sdXX I'm supposed to use when trying to read/write
> >> to that particular device. Similarly for ACM, Network and all other devices.
> > 
> > For each type of device, you are going to have to do it differently.
> > And note that network devices don't have device nodes, so that makes it
> > harder to make a "general" case here.
> > 
> >> Is there any way to achieve that with libudev ?
> > 
> > Yes, but it's going to have to be type (i.e. class) specific.
> > 
> >> I tried using
> >> udev_device_get_devlinks_list_entry() but that didn't help.
> > 
> > You might not be looking at the "right" device.  You will have to go up
> > and down the device tree to find the correct one, depending on the type.
> > And what about devices with multiple interfaces, with different device
> > nodes (like the famous disk drive with a button on it, mass-storage and
> > a HID device).
> 
> those are the cases I was actually looking for. It's, then, practically
> impossible to have a USBCV tool written for linux.

"USBCV"?

> There are missing pieces on the kernel and even if the missing on the
> kernel is implemented, it's gonna be difficult to find the devices we
> have o talk to anyway. Unless we do the entire class implementation
> with pure libusb or usbfs when e.g. testing MSC devices.

It's not impossible, just not something you can do without knowing the
type of device you are looking at.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux