Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2008 19:16:43 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 155193 for review
Message-ID:  <200812231916.mBNJGh5m026912@repoman.freebsd.org>

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

Change 155193 by hselasky@hselasky_laptop001 on 2008/12/23 19:16:34

	
	Be more persistant towards set config failures.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#41 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#41 (text+ko) ====

@@ -1556,6 +1556,7 @@
 	if (udev->flags.usb2_mode == USB_MODE_HOST) {
 		uint8_t config_index;
 		uint8_t config_quirk;
+		uint8_t set_config_failed = 0;
 
 		/*
 		 * Most USB devices should attach to config index 0 by
@@ -1591,6 +1592,14 @@
 		sx_unlock(udev->default_sx + 1);
 		if (err) {
 			if (udev->ddesc.bNumConfigurations != 0) {
+				if (!set_config_failed) {
+					set_config_failed = 1;
+					/* XXX try to re-enumerate the device */
+					err = usb2_req_re_enumerate(
+					    udev, &Giant);
+					if (err == 0)
+					    goto repeat_set_config;
+				}
 				DPRINTFN(0, "Failure selecting "
 				    "configuration index %u: %s, port %u, "
 				    "addr %u (ignored)\n",
@@ -1598,7 +1607,7 @@
 				    udev->address);
 			}
 			/*
-			 * Some USB devices does not have any
+			 * Some USB devices do not have any
 			 * configurations. Ignore any set config
 			 * failures!
 			 */



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