diff options
author | Mike Lockwood <lockwood@google.com> | 2014-10-29 18:29:12 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-29 18:29:12 +0000 |
commit | 841daebc75fbf5e7fb4dd71cab559b8f4d7150ae (patch) | |
tree | 691d23d6dc2577d4847e00e730900b017c7fff6b /media/mtp | |
parent | e2a168b2ec3f96fe39d84e4f1553881efd691c38 (diff) | |
parent | 686a0c4db5e90b811b1fbe1dba3638522ef4b7a1 (diff) | |
download | frameworks_av-841daebc75fbf5e7fb4dd71cab559b8f4d7150ae.zip frameworks_av-841daebc75fbf5e7fb4dd71cab559b8f4d7150ae.tar.gz frameworks_av-841daebc75fbf5e7fb4dd71cab559b8f4d7150ae.tar.bz2 |
am 686a0c4d: Merge "MTP Device: Parse USB3 descriptor for MTP initor;"
* commit '686a0c4db5e90b811b1fbe1dba3638522ef4b7a1':
MTP Device: Parse USB3 descriptor for MTP initor;
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; |