Greg KH | 30 Aug 2002 01:35
Gravatar

Re: config questions - the hub

On Wed, Aug 28, 2002 at 02:59:47PM +0100, Ajay wrote:
> 
> So my thought process was this:
> 1. Communicate with the hub and check the devices
> plugged in at present.

No, you can not talk to a USB hub directly.  Look for the devices
themselves, if they are present, you can talk to them.

> 2. Check if any of them are storage devices (is this
> possible using ioctls?)

Look at the info in /proc/bus/usb/devices (the descriptor).  That will
tell you if they are storage devices.  You can also read the USB
descriptor through usbfs by doing a simple read().

> But /proc/devices lists 180 usb and 180 is the major
> device number. I did not have any other usb device
> plugged in at the time, so I reasoned it must have
> been the hub. Guess I was wrong :(.

Heh, the USB core registers that number, and then doles out the minor
numbers as they are needed (or when drivers that need them are
registered.)  It doesn't mean that someone is actually using that number
at that time.

Hope this helps,

greg k-h

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Gmane