diff options
author | Elliott Hughes <enh@google.com> | 2014-12-08 19:23:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-12-08 19:23:30 +0000 |
commit | a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13 (patch) | |
tree | f0998ec9771029be03c63bd571f34a8d7eb5afbc /adb | |
parent | 51248395626ceb9f54016e78ebb4adee17b290c1 (diff) | |
parent | d6ee9f26a5163af4121f4380264fcbd4e6851a17 (diff) | |
download | system_core-a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13.zip system_core-a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13.tar.gz system_core-a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13.tar.bz2 |
Merge "adb: enable superspeed support"
Diffstat (limited to 'adb')
-rw-r--r-- | adb/usb_linux_client.c | 63 |
1 files changed, 56 insertions, 7 deletions
diff --git a/adb/usb_linux_client.c b/adb/usb_linux_client.c index 8426e0e..70d2ad0 100644 --- a/adb/usb_linux_client.c +++ b/adb/usb_linux_client.c @@ -33,6 +33,7 @@ #define MAX_PACKET_SIZE_FS 64 #define MAX_PACKET_SIZE_HS 512 +#define MAX_PACKET_SIZE_SS 1024 #define cpu_to_le16(x) htole16(x) #define cpu_to_le32(x) htole32(x) @@ -56,19 +57,33 @@ struct usb_handle }; static const struct { - struct usb_functionfs_descs_head header; + __le32 magic; + __le32 length; + __le32 flags; + __le32 fs_count; + __le32 hs_count; + __le32 ss_count; struct { struct usb_interface_descriptor intf; struct usb_endpoint_descriptor_no_audio source; struct usb_endpoint_descriptor_no_audio sink; } __attribute__((packed)) fs_descs, hs_descs; + struct { + struct usb_interface_descriptor intf; + struct usb_endpoint_descriptor_no_audio source; + struct usb_ss_ep_comp_descriptor source_comp; + struct usb_endpoint_descriptor_no_audio sink; + struct usb_ss_ep_comp_descriptor sink_comp; + } __attribute__((packed)) ss_descs; } __attribute__((packed)) descriptors = { - .header = { - .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), - .length = cpu_to_le32(sizeof(descriptors)), - .fs_count = 3, - .hs_count = 3, - }, + .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2), + .length = cpu_to_le32(sizeof(descriptors)), + .flags = cpu_to_le32(FUNCTIONFS_HAS_FS_DESC | + FUNCTIONFS_HAS_HS_DESC | + FUNCTIONFS_HAS_SS_DESC), + .fs_count = 3, + .hs_count = 3, + .ss_count = 5, .fs_descs = { .intf = { .bLength = sizeof(descriptors.fs_descs.intf), @@ -121,6 +136,40 @@ static const struct { .wMaxPacketSize = MAX_PACKET_SIZE_HS, }, }, + .ss_descs = { + .intf = { + .bLength = sizeof(descriptors.ss_descs.intf), + .bDescriptorType = USB_DT_INTERFACE, + .bInterfaceNumber = 0, + .bNumEndpoints = 2, + .bInterfaceClass = ADB_CLASS, + .bInterfaceSubClass = ADB_SUBCLASS, + .bInterfaceProtocol = ADB_PROTOCOL, + .iInterface = 1, /* first string from the provided table */ + }, + .source = { + .bLength = sizeof(descriptors.ss_descs.source), + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = 1 | USB_DIR_OUT, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = MAX_PACKET_SIZE_SS, + }, + .source_comp = { + .bLength = sizeof(descriptors.ss_descs.source_comp), + .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + }, + .sink = { + .bLength = sizeof(descriptors.ss_descs.sink), + .bDescriptorType = USB_DT_ENDPOINT, + .bEndpointAddress = 2 | USB_DIR_IN, + .bmAttributes = USB_ENDPOINT_XFER_BULK, + .wMaxPacketSize = MAX_PACKET_SIZE_SS, + }, + .sink_comp = { + .bLength = sizeof(descriptors.ss_descs.sink_comp), + .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + }, + }, }; #define STR_INTERFACE_ "ADB Interface" |