config questions - the hub
Quoted 5 lines
Why do you want to talk to the root uhci hub? Why would you want to
talk to _any_ hub for that matter? You can't really do anything with
them.
I am trying to make a utility that is VID-PID independent, checks if a device is a storage device, issues SCSI commands to check the number of LUNS, issues SCSI commands to check media presence, and mounts the media. This is because I had trouble with a SCM Orca reader - I had to enter a vid - pid match in usb.usermap and a corresponding driver in /etc/hotplug/usb, but I dont want to do that for every storage device. This is simply because my system _has_ the necessary driver (usb-storage) that works for most storage devices. I wasnted to go the extra step and automate everything - mount the media and put the icon on the desktop and anything else necessary without the (naive) user having to do anything, provided the device is a storage device.
I'm not sure if this can be achieved in hotplug straightaway - AFAICS we have to enter the VID-PID (if the system doesn't have it already.)
So my thought process was this:
1. Communicate with the hub and check the devices plugged in at present.
2. Check if any of them are storage devices (is this possible using ioctls?)
3. Check if a corresponding SCSI enumeration is found in /proc/scsi/usb-strorage-#.
4. Then issue SCSI commands and verify stuff - LUNs, Media presence, etc.
5. Mount, put icon , do whatever necessary.
I wanted to communicate with the hub simply because I thought it would be faster than opening /proc/bus/usb/devices everytime and reading each line. I'm not sure if I'm right in this regard though.
I would appreciate any insight into this.
Quoted 6 lines
And device 180 0 is for a USB printer, not a USB
hub. See the list at:
http://www.linux-usb.org/usb.devices.txt
for more info on the reserved USB major:minor
numbers.
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 :(.
Thanks and regards
- Ajay
==/*------------------------------*\
*----A Ajay Srinivasan ----*
* [email protected] *
\*------------------------------*/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines · Ajay
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.
Quoted 2 lines
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().
Quoted 4 lines
But
/proc/deviceslists 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
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel