On Tue, 11 Jun 2002, Svein E. Seldal wrote: | Randy.Dunlap wrote: | > On Tue, 11 Jun 2002, Svein E. Seldal wrote: | > | > | If I ask for a invalid string, lets say index 100, the USB device stalls | > | (as it should), an USB exeption is printed into the syslog from the UCHI | > | driver, but the functions usb_string() or usb_get_string() functions | > | still returns 0. This leaves my driver totally unaware that the last | > | string request failed. Isnt this a bug? | > | > I guess that your driver could treat a string length of 0 as | > an error. | | Yes, it will suffice as a fix to the problem, but IMHO its a hack, not a | fix...
Yes, I didn't suggest that it is the best solution; it's just a workaround for this case. | I know that string descriptors must be at least two bytes because of the | header, which will make usb_get_string() safe. But the usb_string() | request would return 0 in both cases where empty string descriptor data | are returned and where a non-existent (stalled) string descriptor is | requested. | | > What kernel version? | > What USB exception is logged? | > Can you post the log messages? | > | > I don't see a path for usb_string() or usb_get_string() to | > return 0 unless the device returns 0 for the string length | > (instead of returning an error). | | Kernel 2.4.18. The driver is a custom, unofficial driver made by me. | BTW: Maybe I wasnt clear enough. Exception is probably the wrong term. | Something-has-stalled is maybe better :) | | Anyway, the kernel messages are as follows: | | usb.c: registered new driver avrusb | avrusb: driver started | hub.c: USB new device connect on bus1/1, assigned device number 6 | avrusb: probe vendor id 0x4242, device id 0x1201 ifnum: 0 | usb.c: ignoring set_interface for dev 6, iface 0, alt 0 | avrusb: device attach on 0 | avrusb: ioctl(0) | avrusb: cmd=Get string | avrusb: String index: 1 | avrusb: String result: 35 | avrusb: ioctl(0) | avrusb: cmd=Get string | avrusb: String index: 100 | usb-uhci.c: interrupt, status 2, frame# 983 | avrusb: String result: 0 So the host controller (and driver) saw an error (status = 2) at frame 983. Do you have a USB protocol analyzer so that you can see what the device and bus are doing? You know that the device is stalling on this request (get string index = 100)? I guess that I would use some of the DEBUG code in usb-uhci.c to see what is happening. And have you tried the "alternate" uhci.c driver? Does it behave the same way? Georg, how does one enable DEBUG in usb-uhci.c ? Looks like: a. remove #undef DEBUG (near line 69) b. remove #undef dbg() and #define dbg() (~ lines 70-71) c. I would uncomment the call to uhci_show_status(s); in uhci_interrupt() (near line 2757) to see what it tells you. HTH. -- ~Randy _______________________________________________________________ Multimillion Dollar Computer Inventory Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
