On Fri, 24 Sep 2004, Duncan Sands wrote:

> The Freebox is a USB modem popular in France.  It returns bogus string
> descriptors: while the string part is there, the length and type bytes
> are both zero.  This patch detects that case and tries to recover a
> sensible string by scanning for printable Latin characters.  This not
> only causes the modem to spring to life (because usbnet gets a valid
> MAC address) - it also means you get the correct Product and Manufacturer
> strings in sysfs and elsewhere.  This patch is in the "mostly harmless"
> category.

Just a couple of minor comments:

It's not really necessary to restrict yourself to printable Latin
characters (although it is safer).  After all, properly-formed string
descriptors may contain arbitrary UCS-16 characters.  You could just
terminate the scanning when you find \u0000.

Stylistically, I disapprove of

> +                     usb_try_string_workarounds(buf, &rc);

when you could just as easily write

> +                     rc = usb_try_string_workarounds(buf, rc);

But on the whole I approve of the patch.

Alan Stern



-------------------------------------------------------
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

Reply via email to