Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: device/usb/usb_device_impl.cc

Issue 673283002: Bit shift the bmAttributes field to interpret isochronous endpoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_impl.cc
diff --git a/device/usb/usb_device_impl.cc b/device/usb/usb_device_impl.cc
index 17e9c13f4d4456f9e0216b0d151641cca75d4005..961e93b524a0a7eba55634d209899003701ffc73 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698