summaryrefslogtreecommitdiffstats
path: root/adb/usb_linux.c
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-07-24 14:14:56 -0700
committerXavier Ducrohet <xav@android.com>2009-07-24 14:42:27 -0700
commitde6f62a609120c3d9e4e53689c3b309842ec874b (patch)
tree5ec4e9b1b4d0db94111112c1bd9fb09cc8acaead /adb/usb_linux.c
parentd52f54c4552d2f35b3c2c2ac60350ac83760222f (diff)
downloadsystem_core-de6f62a609120c3d9e4e53689c3b309842ec874b.tar.gz
system_core-de6f62a609120c3d9e4e53689c3b309842ec874b.tar.bz2
system_core-de6f62a609120c3d9e4e53689c3b309842ec874b.zip
Add support for Samsung and Motorola devices.
Also update the linux code. Some devices have more complex USB descriptors which can't be parsed with the simple assumption of just skipping the endpoint descriptors.
Diffstat (limited to 'adb/usb_linux.c')
-rw-r--r--adb/usb_linux.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/adb/usb_linux.c b/adb/usb_linux.c
index 95c2ce60f..537122d1a 100644
--- a/adb/usb_linux.c
+++ b/adb/usb_linux.c
@@ -318,9 +318,13 @@ static int find_usb_device(const char *base,
found_device = 1;
break;
} else {
- // skip to next interface
- bufptr += (interface->bNumEndpoints * USB_DT_ENDPOINT_SIZE);
- }
+ // seek next interface descriptor
+ if (i < interfaces - 1) {
+ while (bufptr[1] != USB_DT_INTERFACE) {
+ bufptr += bufptr[0];
+ }
+ }
+ }
} // end of for
adb_close(fd);