svn commit: r190743 - head/sys/dev/usb
Andrew Thompson
thompsa at FreeBSD.org
Sun Apr 5 11:22:17 PDT 2009
Author: thompsa
Date: Sun Apr 5 18:22:13 2009
New Revision: 190743
URL: http://svn.freebsd.org/changeset/base/190743
Log:
MFp4 //depot/projects/usb at 160056
Remove code for unused and unlikely quirk, "uq_power_claim"
Submitted by: Hans Petter Selasky
Modified:
head/sys/dev/usb/usb_device.c
head/sys/dev/usb/usb_device.h
Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c Sun Apr 5 18:22:03 2009 (r190742)
+++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:22:13 2009 (r190743)
@@ -431,7 +431,6 @@ usb2_error_t
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 @@ usb2_set_config_index(struct usb2_device
/* 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;
}
@@ -1631,9 +1608,6 @@ usb2_alloc_device(device_t parent_dev, s
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;
}
Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h Sun Apr 5 18:22:03 2009 (r190742)
+++ head/sys/dev/usb/usb_device.h Sun Apr 5 18:22:13 2009 (r190743)
@@ -90,7 +90,6 @@ struct usb2_device_flags {
* 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 svn-src-head
mailing list