Help with USB storage program and USB 3.0
OK, I admit I'm a newbie at this - especially the linux part. I have inherited a USB storage program that tests USB hard disk drives. Up to now, I have been successful at making updates to the code when needed because accessing the USB device has never been a problem.
First, I am running Slackware 12.1.0 with Linux Kernel 2.6.24.5. The program basically monitors the USB devices via /proc/bus/usb/devices and when there's a new device, checks to see if the vendor ID is one it should test. If so, the first thing it does is go out and do a read capacity via the usb_bulk_write (eventually), which I assume is in the usb library located in /usr/include (please verify). I know that usb.h is in the includes in the usb_storage.c that is part of the program code. Anyway, this has always worked on USB 2.0 devices, but now that I have a USB 3.0 device, it errors out at the usb_bulk_write command (return code is 31). I was under the impression that USB 3.0 was backward compatible. Also, if I just plug in the drive without running my program, the system sees it just fine. I am just plugging the USB 3.0 device into a USB 2.0 bus. I am kind of at a loss as to what would be causing this. Seems to me if it worked on USB 2.0, it would work on 3.0. Any ideas would be appreciated. Thanks, Equinn |
Guys and Gals,
I have done some more digging around and have more information. This program is using libusb v0.1.12. Also, I made a mistake in my statement above. It's not failing at usb_bulk_write (the return code from that is 31, which is the correct number of bytes transferred). It's actually failing on the subsequent usb_bulk_read. It's supposed to return 8 bytes and its returning 0. After some searching on the net, I found some information on libusb. I found there is a bit of test software that's distributed with libusb that identifies information about the devices attached to the bus. I ran this little test on both types of drives and found that there are some differences. Quote:
Thanks, Equinn |
All times are GMT -5. The time now is 12:37 PM. |