diff options
author | Christopher Ferris <cferris@google.com> | 2015-01-26 21:28:05 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-26 21:28:06 +0000 |
commit | fb538fb13d930a7398695d1044ceaaf854949018 (patch) | |
tree | b75adc802a06bd5f7e9c5b823ae8cd3190dba33d /adb | |
parent | 5abd3d0b79d4f4690058f9d70bf723ebaa99616e (diff) | |
parent | c49f51c451516bf06afc6d71947eb11cc4627273 (diff) | |
download | system_core-fb538fb13d930a7398695d1044ceaaf854949018.zip system_core-fb538fb13d930a7398695d1044ceaaf854949018.tar.gz system_core-fb538fb13d930a7398695d1044ceaaf854949018.tar.bz2 |
Merge "Fix the v2 descriptor handling."
Diffstat (limited to 'adb')
-rw-r--r-- | adb/usb_linux_client.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/adb/usb_linux_client.c b/adb/usb_linux_client.c index fd566f4..ee6b37c 100644 --- a/adb/usb_linux_client.c +++ b/adb/usb_linux_client.c @@ -73,14 +73,10 @@ struct desc_v1 { } __attribute__((packed)); struct desc_v2 { - struct usb_functionfs_descs_head_v2 { - __le32 magic; - __le32 length; - __le32 flags; - __le32 fs_count; - __le32 hs_count; - __le32 ss_count; - } __attribute__((packed)) header; + struct usb_functionfs_descs_head_v2 header; + // The rest of the structure depends on the flags in the header. + __le32 fs_count; + __le32 hs_count; struct func_desc fs_descs, hs_descs; } __attribute__((packed)); @@ -284,9 +280,8 @@ static void init_functionfs(struct usb_handle *h) v2_descriptor.header.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2); v2_descriptor.header.length = cpu_to_le32(sizeof(v2_descriptor)); v2_descriptor.header.flags = FUNCTIONFS_HAS_FS_DESC | FUNCTIONFS_HAS_HS_DESC; - v2_descriptor.header.fs_count = 3; - v2_descriptor.header.hs_count = 3; - v2_descriptor.header.ss_count = 0; + v2_descriptor.fs_count = 3; + v2_descriptor.hs_count = 3; v2_descriptor.fs_descs = fs_descriptors; v2_descriptor.hs_descs = hs_descriptors; |