PERFORCE change 160056 for review

Hans Petter Selasky hselasky at FreeBSD.org
Tue Mar 31 07:59:46 PDT 2009


http://perforce.freebsd.org/chv.cgi?CH=160056

Change 160056 by hselasky at hselasky_laptop001 on 2009/03/31 14:59:03

	USB core:
	  - remove code for unused and unlikely quirk, "uq_power_claim"

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_device.c#22 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_device.h#14 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_device.c#22 (text+ko) ====

@@ -431,7 +431,6 @@
 usb2_set_config_index(struct usb2_device *udev, uint8_t index)
 {
 	struct usb2_status ds;
-	struct usb2_hub_descriptor hd;
 	struct usb2_config_descriptor *cdp;
 	uint16_t power;
 	uint16_t max_power;
@@ -484,38 +483,16 @@
 		/* May be self powered. */
 		if (cdp->bmAttributes & UC_BUS_POWERED) {
 			/* Must ask device. */
-			if (udev->flags.uq_power_claim) {
-				/*
-				 * HUB claims to be self powered, but isn't.
-				 * It seems that the power status can be
-				 * determined by the HUB characteristics.
-				 */
-				err = usb2_req_get_hub_descriptor
-				    (udev, NULL, &hd, 1);
-				if (err) {
-					DPRINTFN(0, "could not read "
-					    "HUB descriptor: %s\n",
-					    usb2_errstr(err));
-
-				} else if (UGETW(hd.wHubCharacteristics) &
-				    UHD_PWR_INDIVIDUAL) {
-					selfpowered = 1;
-				}
-				DPRINTF("characteristics=0x%04x\n",
-				    UGETW(hd.wHubCharacteristics));
-			} else {
-				err = usb2_req_get_device_status
-				    (udev, NULL, &ds);
-				if (err) {
-					DPRINTFN(0, "could not read "
-					    "device status: %s\n",
-					    usb2_errstr(err));
-				} else if (UGETW(ds.wStatus) & UDS_SELF_POWERED) {
-					selfpowered = 1;
-				}
-				DPRINTF("status=0x%04x \n",
-				    UGETW(ds.wStatus));
+			err = usb2_req_get_device_status(udev, NULL, &ds);
+			if (err) {
+				DPRINTFN(0, "could not read "
+				    "device status: %s\n",
+				    usb2_errstr(err));
+			} else if (UGETW(ds.wStatus) & UDS_SELF_POWERED) {
+				selfpowered = 1;
 			}
+			DPRINTF("status=0x%04x \n",
+				UGETW(ds.wStatus));
 		} else
 			selfpowered = 1;
 	}
@@ -1633,9 +1610,6 @@
 	if (usb2_test_quirk(&uaa, UQ_BUS_POWERED)) {
 		udev->flags.uq_bus_powered = 1;
 	}
-	if (usb2_test_quirk(&uaa, UQ_POWER_CLAIM)) {
-		udev->flags.uq_power_claim = 1;
-	}
 	if (usb2_test_quirk(&uaa, UQ_NO_STRINGS)) {
 		udev->flags.no_strings = 1;
 	}

==== //depot/projects/usb/src/sys/dev/usb/usb_device.h#14 (text+ko) ====

@@ -90,7 +90,6 @@
 					 * strings */
 	uint8_t	remote_wakeup:1;	/* set if remote wakeup is enabled */
 	uint8_t	uq_bus_powered:1;	/* set if BUS powered quirk is present */
-	uint8_t	uq_power_claim:1;	/* set if power claim quirk is present */
 };
 
 /*


More information about the p4-projects mailing list