Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Dec 2008 15:55:22 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 154796 for review
Message-ID:  <200812161555.mBGFtMHB081930@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=154796

Change 154796 by hselasky@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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812161555.mBGFtMHB081930>