Alan Stern wrote: > On Fri, 27 May 2005, Wakko Warner wrote: > As far as I know, there is no way to do this reliably. Probably the most > direct approach would be to check the capacity of the device, since a > floppy will have a capacity of only a few MB. But that's not possible if > no medium is loaded. > > In general, USB floppy devices do not report any special values to > indicate that they are floppies.
I found this out. I don't know yet how to query a scsi disk device to see if it has media loaded. The ioctl commands I've read through in the kernel seems to indicate that I need to use SG_IO because the ones that I want to use are obsolete. I do know that Windows can detect if a usb device is floppy or other media. There has to be some way to tell this. Of course, windows may just have a list of ids or something to do this. I'm not exactly sure what information is in the sysfs for each usb device. I can see InterfaceClass and other stuff, but I have no idea what the numbers are. Is there a place for this information? > > Another question (not related, not worth a seperate message either), is it > > possible to detect a usb2.0 device plugged into a usb1.1 port? > > Yes. In fact you can see it directly just by reading > /proc/bus/usb/devices. The USB version of the device is the "Ver=" field I did this on my machine that is my gateway. My internet device is a NETGEAR EA101 USB Ethernet Adapter (P: Vendor=0846 ProdID=1001 Rev= 2.02) When I cat this file, it hung for a few seconds and this device went into a bad state (quit working) until I unplugged and replugged. This is not the first time I've hit this problem (2.6.10, I plan to upgrade to 2.6.12-rc5 or newer next week) > on the D: line. To find the USB version of the port, use the "Bus=" field > on the T: line, and search the file for an entry with the same Bus value > and with "Lev=00" (or "Prnt=00", they mean the same thing). That's the > entry for the computer's USB controller, and its "Ver=" value will tell > you what sort of port it is. Found it on my box, ver= was blank for that bus. > Your question suggests that you might be more interested in the device's > speed rather than its USB version. (Note that it's perfectly legal for a > USB 2.0 device to run only at low or full speed, although a USB 1.1 device > will never support high speed.) The kernel will print a message in the > system log if a high-speed device is plugged into a full-speed port when a > high-speed port exists. Unfortunately it's not so easy to tell from > /proc/bus/usb/devices or from sysfs whether or not a USB 2.00 device > supports high speed. You can tell that the device is USB 2.00 and that > it's currently running at full speed, but then the only way to know > whether it supports high speed is by reading the DEVICE QUALIFIER > descriptor. You can probably write a program to do that using usbfs. Any pointers on how to write this? I will be writing this in perl. The target system is mostly perl based (it's sorta like embedded but runs off a tmpfs filesystem) -- Lab tests show that use of micro$oft causes cancer in lab animals ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
