On Saturday 24 July 2004 21:45, Alan Stern wrote: > On Sat, 24 Jul 2004, Duncan Sands wrote: > > > I have a "freebox", an ADSL modem. When reading various string > > descriptors, the bLength and bDescriptorType fields are both zero, > > yet appropriate data follows, see the examples below: > > > > # Format is: bLength bDescriptorType - DATA > > # where DATA is a sequence of printable characters. > > # Wierdo characters are replaced by ? (none here), > > # and null by !. So 0 0 - F!r!e!e!B!o!X!!!!... means > > # bLength=0, bDescriptorType=0, then > > # F(null)r(null)e(null)e(null)B(null)o(null)X(null)(null)(null)...) > > > > Product: > > > > 0 0 - F!r!e!e!B!o!X!!!!... > > > > Manufacturer: > > > > 0 0 - F!r!e!e!b!o!x! !S!A!!!... > > > > Serial number?: > > > > 0 0 - 1!.!0!0!!!... > > > > Any idea how to handle these strange strings? Could these > > guys be using an unofficial convention for sending null terminated > > strings? > > > > Thanks, > > > > Duncan. > > > > PS: The modem happily returns 255 bytes (the amount asked for). > > All the trailing bytes are zero. > > It's possible that this is more than just a private convention. In > principle we could try to support it: If the descriptor type and length > are both 0 then request 255 bytes and assume it's a null-terminated > string. > > I'm concerned because this is so contrary to the specification and subject > to errors. (If the descriptor type is 0, how can you be sure you're > looking at the right sort of descriptor?) > > If there's any evidence that more than one device or vendor uses this > convention, then we ought to adopt it. Otherwise I say to forget about > it.
Hi Alan, my plan is to have a config option (CONFIG_USB_STRING_WORKAROUNDS) and a device black/white list. With the config option selected, there are three cases: (A) device in the blacklist. Strings with type and length both 0 give an error -EINVAL as now. (B) device in the whitelist. Scans the "string" for printable characters in the US plane. If it finds something of positive length, returns it, otherwise -EINVAL. (C) device not in black/whitelist. Scans as in (B), and if it finds a string of positive length, sends a message to the system log describing the string and the device, and suggests sending an email to the list. Returns -EINVAL. This is the most conservative setup, but maybe it is overkill. What do you think? All the best, Duncan. ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel