On Tue, 18 Feb 2003 10:24:43 -0500 (EST)
"Charles Lepple" <[EMAIL PROTECTED]> wrote:

| (I can't seem to get to the usbutils site right now to see if there's a
| separate list for user-space USB programs, so please excuse me if this is
| not the right list.)
| 
| While writing USB firmware for the PIC16C765, I noticed that lsusb can't
| read the string descriptors from even the stock Microchip firmware. This
| seems to be limited to lsusb, as the strings show up in
| /proc/bus/usb/devices and in the HID driver's initialization message.
| 
| Here's the output of 'lsusb' run as root (ignore the bogus VID/PID-- just
| testing another set of HID descriptors):
| 
| [...]
| Bus 001 Device 003: ID 04b4:0316 Cypress Semiconductor
|   Language IDs: none (invalid length string descriptor bf; len=0)
| string descriptor 1 invalid (bf bf; len=0)
| string descriptor 2 invalid (bf bf; len=0)
| string descriptor 3 invalid (bf bf; len=0)
| [...]
|   Language IDs: none (invalid length string descriptor bf; len=0)
| 
| This particular message came from usbutils-0.9, and also appears in the
| output of 'lsusb -v' in 0.11. The kernel is 2.4.18-19.8.0 (an update from
| RedHat 8.0), and I am using the 'uhci' HCD (not usb-uhci).
| 
| The only kernel message is "usbdevfs: process 11685 (lsusb) did not claim
| interface 0 before use". My first guess that this is not affecting the
| retrieval of the string descriptors, since the string descriptors listed
| above are present in the device descriptor (and not at the interface
| level).
| 
| Any ideas? Pointers to a usbutils-specific mailing list?

I agree with David's comments that some devices are just broken when
trying to perform short or long reads from them.  However, there
was also a bug identified in lsusb version 0.11 just a few weeks ago--
it might also be in version 0.9--don't know.
lsusb used (uses) language ID value 0 for reading strings, but it
should use a valid language ID for the device.  The patch is short.
Here it is via cut-and-paste (so it could have some whitespace
problems and not apply cleanly for you):

--- usbutils-0.11-backup/lsusb.c        Tue Aug  6 15:35:21 2002
+++ usbutils-0.11-new/lsusb.c   Thu Jan 23 15:06:49 2003
@@ -134,7 +134,7 @@
                return 0;
 
        b[0] = b[1] = 0xbf;
-       ret = usb_control_msg(fd, USB_DIR_IN, USB_REQ_GET_DESCRIPTOR, 
(USB_DT_STRING << 8) | id, 0, sizeof(b), b);
+       ret = usb_control_msg(fd, USB_DIR_IN, USB_REQ_GET_DESCRIPTOR, 
(USB_DT_STRING << 8) | id, lang, sizeof(b), b);
        if (ret < 0) {
                if (open_mode == O_RDWR)
                fprintf(stderr, "cannot get string descriptor %d, error 
%s(%d)\n", id, strerror(errno), errno);

        

--
~Randy


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to