Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303990
b: refs/heads/master
c: d9b2099
h: refs/heads/master
v: v3
  • Loading branch information
Sarah Sharp committed May 18, 2012
1 parent 6497b44 commit b83a77c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 448b6eb1e04cddc418d4b780ae19ca8cdb42d110
refs/heads/master: d9b2099cd66de3164f6e17a5c0e3f14cce24a9a3
22 changes: 17 additions & 5 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ static struct usb_hub *hdev_to_hub(struct usb_device *hdev)
return usb_get_intfdata(hdev->actconfig->interface[0]);
}

static int usb_device_supports_lpm(struct usb_device *udev)
{
/* USB 2.1 (and greater) devices indicate LPM support through
* their USB 2.0 Extended Capabilities BOS descriptor.
*/
if (udev->speed == USB_SPEED_HIGH) {
if (udev->bos->ext_cap &&
(USB_LPM_SUPPORT &
le32_to_cpu(udev->bos->ext_cap->bmAttributes)))
return 1;
return 0;
}
return 0;
}

/* USB 2.0 spec Section 11.24.4.5 */
static int get_hub_descriptor(struct usb_device *hdev, void *data)
{
Expand Down Expand Up @@ -3211,11 +3226,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,

if (udev->wusb == 0 && le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201) {
retval = usb_get_bos_descriptor(udev);
if (!retval) {
if (udev->bos->ext_cap && (USB_LPM_SUPPORT &
le32_to_cpu(udev->bos->ext_cap->bmAttributes)))
udev->lpm_capable = 1;
}
if (!retval)
udev->lpm_capable = usb_device_supports_lpm(udev);
}

retval = 0;
Expand Down

0 comments on commit b83a77c

Please sign in to comment.