From 2d4f852da4881b543c11f82de4af44db88bdf306 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 13 Aug 2015 15:01:18 -0700 Subject: [PATCH] Start iterating USB pipe endpoints from 1. Bug: http://b/22829602 Change-Id: I5051880730ba8fadae5d78f1d19b5d527610d4a5 --- adb/usb_osx.cpp | 11 +++++------ fastboot/usb_osx.cpp | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/adb/usb_osx.cpp b/adb/usb_osx.cpp index b3b3a2f2f..afa08c1e3 100644 --- a/adb/usb_osx.cpp +++ b/adb/usb_osx.cpp @@ -316,11 +316,10 @@ static bool ClearPipeStallBothEnds(IOUSBInterfaceInterface190** interface, UInt8 static usb_handle* CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 product) { - usb_handle* handle = NULL; - IOReturn kr; - UInt8 interfaceNumEndpoints, interfaceClass, interfaceSubClass, interfaceProtocol; - UInt8 endpoint; - + usb_handle* handle; + IOReturn kr; + UInt8 interfaceNumEndpoints, interfaceClass, interfaceSubClass, interfaceProtocol; + UInt8 endpoint; //* Now open the interface. This will cause the pipes associated with //* the endpoints in the interface descriptor to be instantiated @@ -356,7 +355,7 @@ CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 pro //* Iterate over the endpoints for this interface and find the first //* bulk in/out pipes available. These will be our read/write pipes. - for (endpoint = 0; endpoint <= interfaceNumEndpoints; endpoint++) { + for (endpoint = 1; endpoint <= interfaceNumEndpoints; endpoint++) { UInt8 transferType; UInt16 maxPacketSize; UInt8 interval; diff --git a/fastboot/usb_osx.cpp b/fastboot/usb_osx.cpp index abd6eb950..7ae2aa5f5 100644 --- a/fastboot/usb_osx.cpp +++ b/fastboot/usb_osx.cpp @@ -181,7 +181,7 @@ static int try_interfaces(IOUSBDeviceInterface182 **dev, usb_handle *handle) { // Iterate over the endpoints for this interface and see if there // are any that do bulk in/out. - for (UInt8 endpoint = 0; endpoint <= interfaceNumEndpoints; endpoint++) { + for (UInt8 endpoint = 1; endpoint <= interfaceNumEndpoints; endpoint++) { UInt8 transferType; UInt16 maxPacketSize; UInt8 interval;