From 9e0d1e88fc18b856f7f32b04e071922aae282a03 Mon Sep 17 00:00:00 2001 From: Andiry Xu Date: Fri, 23 Sep 2011 14:19:48 -0700 Subject: [PATCH] --- yaml --- r: 265019 b: refs/heads/master c: 1ff4df56846d10379939166713bb2908e6a5ee0e h: refs/heads/master i: 265017: e90435651b69fb4fe5820e50632d6cbaa0aa8da4 265015: debbf5801c2a963e486dd079e995aaf544081e97 v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/hub.c | 10 ++++++++-- trunk/include/linux/usb.h | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9d794b9c5dd6..d7520a5d9e3d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3148bf041d169a083aa31bd69bedd5bfb7ffe215 +refs/heads/master: 1ff4df56846d10379939166713bb2908e6a5ee0e diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 7a2514322bfd..4ffc3d1bd9e7 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -3083,8 +3083,14 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, goto fail; } - if (udev->wusb == 0 && le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201) - usb_get_bos_descriptor(udev); + 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; + } + } retval = 0; /* notify HCD that we have a device connected and addressed */ diff --git a/trunk/include/linux/usb.h b/trunk/include/linux/usb.h index 90ab9dc1f080..1d00d9bc5d65 100644 --- a/trunk/include/linux/usb.h +++ b/trunk/include/linux/usb.h @@ -410,6 +410,7 @@ struct usb_tt; * FIXME -- complete doc * @authenticated: Crypto authentication passed * @wusb: device is Wireless USB + * @lpm_capable: device supports LPM * @string_langid: language ID for strings * @product: iProduct string, if present (static) * @manufacturer: iManufacturer string, if present (static) @@ -472,6 +473,7 @@ struct usb_device { unsigned authorized:1; unsigned authenticated:1; unsigned wusb:1; + unsigned lpm_capable:1; int string_langid; /* static strings from the device */