Date: Wed, 5 Dec 2007 19:10:43 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 130284 for review Message-ID: <200712051910.lB5JAhsB007237@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=130284 Change 130284 by hselasky@hselasky_laptop001 on 2007/12/05 19:10:08 Workaround for buggy USB devices that have no strings. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#66 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#66 (text+ko) ==== @@ -1471,9 +1471,29 @@ udev->no_strings = 1; } #endif + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { /* setup language ID */ err = usbreq_get_string_desc(udev, &usb_global_lock, buf, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USBD_INVAL; + } + if (err || (buf[0] < 4)) { udev->no_strings = 1; } else {help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712051910.lB5JAhsB007237>
