diff options
author | reillyg <reillyg@chromium.org> | 2014-10-24 12:25:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-24 19:26:08 +0000 |
commit | 8df07cfa2108991fb979c2b009ee1ace5b055c6f (patch) | |
tree | 548042600eb0a90f8100770b4deb9a1115c6ddb0 | |
parent | 93cdb0814cef0395b6db5efe55436de662aa13b9 (diff) | |
download | chromium_src-8df07cfa2108991fb979c2b009ee1ace5b055c6f.zip chromium_src-8df07cfa2108991fb979c2b009ee1ace5b055c6f.tar.gz chromium_src-8df07cfa2108991fb979c2b009ee1ace5b055c6f.tar.bz2 |
Bit shift the bmAttributes field to interpret isochronous endpoint.
The bit fields holding information about the synchronization mode and
intended usage of an isochronous pipe need to be shifted before they
are compared to the libusb enums. Otherwise a NOTREACHED is hit because
the unshifted values are out of range.
BUG=426910
Review URL: https://codereview.chromium.org/673283002
Cr-Commit-Position: refs/heads/master@{#301169}
-rw-r--r-- | device/usb/usb_device_impl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/device/usb/usb_device_impl.cc b/device/usb/usb_device_impl.cc index 36ddfe7..57f3d63 100644 --- a/device/usb/usb_device_impl.cc +++ b/device/usb/usb_device_impl.cc @@ -57,7 +57,7 @@ UsbEndpointDirection GetDirection( UsbSynchronizationType GetSynchronizationType( const libusb_endpoint_descriptor* descriptor) { - switch (descriptor->bmAttributes & LIBUSB_ISO_SYNC_TYPE_MASK) { + switch ((descriptor->bmAttributes & LIBUSB_ISO_SYNC_TYPE_MASK) >> 2) { case LIBUSB_ISO_SYNC_TYPE_NONE: return USB_SYNCHRONIZATION_NONE; case LIBUSB_ISO_SYNC_TYPE_ASYNC: @@ -89,7 +89,7 @@ UsbTransferType GetTransferType(const libusb_endpoint_descriptor* descriptor) { } UsbUsageType GetUsageType(const libusb_endpoint_descriptor* descriptor) { - switch (descriptor->bmAttributes & LIBUSB_ISO_USAGE_TYPE_MASK) { + switch ((descriptor->bmAttributes & LIBUSB_ISO_USAGE_TYPE_MASK) >> 4) { case LIBUSB_ISO_USAGE_TYPE_DATA: return USB_USAGE_DATA; case LIBUSB_ISO_USAGE_TYPE_FEEDBACK: |