diff options
author | Bo Huang <bo.b.huang@intel.com> | 2013-06-09 08:53:21 +0800 |
---|---|---|
committer | Bo Huang <bo.b.huang@intel.com> | 2014-09-26 10:25:37 +0800 |
commit | 8023f3af62795b7816f36a9423f8e0a39e616e49 (patch) | |
tree | d59bc64da620e6e42fde66ce22410c4749e2823f /media/mtp | |
parent | 8f230382b86e7b431211ceb0263d06c4bba1bf6b (diff) | |
download | frameworks_av-8023f3af62795b7816f36a9423f8e0a39e616e49.zip frameworks_av-8023f3af62795b7816f36a9423f8e0a39e616e49.tar.gz frameworks_av-8023f3af62795b7816f36a9423f8e0a39e616e49.tar.bz2 |
MTP Device: Parse USB3 descriptor for MTP initor;
MTP initor in Android only support MTP responder based on USB2.
Add support for MTP device based on USB3.
Change-Id: I52b7a5ddff8ae3f8c2ce8a802c2cb2865f4e162a
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Diffstat (limited to 'media/mtp')
-rw-r--r-- | media/mtp/MtpDevice.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp index d6d5dd5..96331b5 100644 --- a/media/mtp/MtpDevice.cpp +++ b/media/mtp/MtpDevice.cpp @@ -131,13 +131,22 @@ MtpDevice* MtpDevice::open(const char* deviceName, int fd) { struct usb_endpoint_descriptor *ep_in_desc = NULL; struct usb_endpoint_descriptor *ep_out_desc = NULL; struct usb_endpoint_descriptor *ep_intr_desc = NULL; + //USB3 add USB_DT_SS_ENDPOINT_COMP as companion descriptor; + struct usb_ss_ep_comp_descriptor *ep_ss_ep_comp_desc = NULL; for (int i = 0; i < 3; i++) { ep = (struct usb_endpoint_descriptor *)usb_descriptor_iter_next(&iter); + if (ep && ep->bDescriptorType == USB_DT_SS_ENDPOINT_COMP) { + ALOGD("Descriptor type is USB_DT_SS_ENDPOINT_COMP for USB3 \n"); + ep_ss_ep_comp_desc = (usb_ss_ep_comp_descriptor*)ep; + ep = (struct usb_endpoint_descriptor *)usb_descriptor_iter_next(&iter); + } + if (!ep || ep->bDescriptorType != USB_DT_ENDPOINT) { ALOGE("endpoints not found\n"); usb_device_close(device); return NULL; } + if (ep->bmAttributes == USB_ENDPOINT_XFER_BULK) { if (ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ep_in_desc = ep; |