diff options
author | Andiry Xu <andiry.xu@amd.com> | 2011-09-24 01:19:48 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-27 02:51:08 +0400 |
commit | 1ff4df56846d10379939166713bb2908e6a5ee0e (patch) | |
tree | a2cacc55c0496016be4a44f72b96a0717ba91948 /drivers/usb/core | |
parent | 3148bf041d169a083aa31bd69bedd5bfb7ffe215 (diff) | |
download | linux-1ff4df56846d10379939166713bb2908e6a5ee0e.tar.xz |
usbcore: check device's LPM capability
Check device's LPM capability by examining the bmAttibutes field of the
USB2.0 Extension Descriptor.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 7a2514322bfd..4ffc3d1bd9e7 100644 --- a/drivers/usb/core/hub.c +++ b/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 */ |