From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Figuring out devnodes from a usb device
Date: Tue, 03 Aug 2010 19:53:08 +0000 [thread overview]
Message-ID: <20100803195308.GA2525@kroah.com> (raw)
In-Reply-To: <4C55D1CF.5090206@felipebalbi.com>
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
next prev parent reply other threads:[~2010-08-03 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-01 19:58 Figuring out devnodes from a usb device Felipe Balbi
2010-08-02 22:29 ` Greg KH
2010-08-03 7:28 ` Felipe Balbi
2010-08-03 9:13 ` Kay Sievers
2010-08-03 19:53 ` Greg KH [this message]
2010-08-03 20:20 ` Felipe Balbi
2010-08-03 20:32 ` Greg KH
2010-08-04 5:09 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100803195308.GA2525@kroah.com \
--to=greg@kroah.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).