diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-10-21 13:45:39 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-21 13:45:39 -0700 |
commit | 5fa7fcf89a978678bcf96730b89f9aad7b6ec97c (patch) | |
tree | 8baa75c847410928d3492849b821b2563f278e98 /adb | |
parent | 5985f6ceee15979beee6baa608098f80fc388ccd (diff) | |
parent | 34961b266773006ec6643446e7b5a1558d82e4f4 (diff) | |
download | system_core-5fa7fcf89a978678bcf96730b89f9aad7b6ec97c.zip system_core-5fa7fcf89a978678bcf96730b89f9aad7b6ec97c.tar.gz system_core-5fa7fcf89a978678bcf96730b89f9aad7b6ec97c.tar.bz2 |
am 34961b26: am 6713a2e0: Merge "Fix USB endianness bugs on Linux."
Merge commit '34961b266773006ec6643446e7b5a1558d82e4f4'
* commit '34961b266773006ec6643446e7b5a1558d82e4f4':
Fix USB endianness bugs on Linux.
Diffstat (limited to 'adb')
-rw-r--r-- | adb/usb_linux.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/adb/usb_linux.c b/adb/usb_linux.c index bb86813..2f7f870 100644 --- a/adb/usb_linux.c +++ b/adb/usb_linux.c @@ -191,9 +191,8 @@ static void find_usb_device(const char *base, continue; } - vid = __le16_to_cpu(device->idVendor); - pid = __le16_to_cpu(device->idProduct); - pid = devdesc[10] | (devdesc[11] << 8); + vid = device->idVendor; + pid = device->idProduct; DBGX("[ %s is V:%04x P:%04x ]\n", devname, vid, pid); // should have config descriptor next @@ -617,7 +616,7 @@ static void register_device(const char *dev_name, ctrl.bRequestType = USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE; ctrl.bRequest = USB_REQ_GET_DESCRIPTOR; ctrl.wValue = (USB_DT_STRING << 8) | serial_index; - ctrl.wIndex = languages[i]; + ctrl.wIndex = __le16_to_cpu(languages[i]); ctrl.wLength = sizeof(buffer); ctrl.data = buffer; @@ -627,7 +626,7 @@ static void register_device(const char *dev_name, // skip first word, and copy the rest to the serial string, changing shorts to bytes. result /= 2; for (i = 1; i < result; i++) - serial[i - 1] = buffer[i]; + serial[i - 1] = __le16_to_cpu(buffer[i]); serial[i - 1] = 0; break; } |