PERFORCE change 154796 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Dec 16 07:55:23 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=154796
Change 154796 by hselasky at hselasky_laptop001 on 2008/12/16 15:55:15
Bugfix for USB devices without any configuration.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#37 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#37 (text+ko) ====
@@ -1588,11 +1588,19 @@
err = usb2_set_config_index(udev, config_index);
sx_unlock(udev->default_sx + 1);
if (err) {
- DPRINTFN(0, "Failure selecting "
- "configuration index %u: %s, port %u, addr %u\n",
- config_index, usb2_errstr(err), udev->port_no,
- udev->address);
-
+ if (udev->ddesc.bNumConfigurations != 0) {
+ DPRINTFN(0, "Failure selecting "
+ "configuration index %u: %s, port %u, "
+ "addr %u (ignored)\n",
+ config_index, usb2_errstr(err), udev->port_no,
+ udev->address);
+ }
+ /*
+ * Some USB devices does not have any
+ * configurations. Ignore any set config
+ * failures!
+ */
+ err = 0;
} else if (config_quirk) {
/* user quirk selects configuration index */
} else if ((config_index + 1) < udev->ddesc.bNumConfigurations) {
More information about the p4-projects
mailing list