aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/adb
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-11-19 14:37:24 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2019-12-23 00:22:07 +0100
commitd034a1f4577108a465e8347d11a51dc0e5a29298 (patch)
tree5784b29aa5f3f900fb17ac716a4a7385e6e3569d /package/utils/adb
parentdd299805ad18472a8245b4524a25e4381e166057 (diff)
downloadupstream-d034a1f4577108a465e8347d11a51dc0e5a29298.tar.gz
upstream-d034a1f4577108a465e8347d11a51dc0e5a29298.tar.bz2
upstream-d034a1f4577108a465e8347d11a51dc0e5a29298.zip
adb: fix for SuperSpeed devices
The USB descriptor parsing in adb fails to detect SuperSpeed devices because of the SuperSpeed Endpoint Companion Descriptor. This cherry-picks the upstream fix for the problem. Unfortunately there never were a release with this fix before the conversion to C++, so upgrading to a newer version isn't an option. This makes adb work with SuperSpeed devices like the Sierra Wireless EM7565. Tested and verified. Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'package/utils/adb')
-rw-r--r--package/utils/adb/Makefile2
-rw-r--r--package/utils/adb/patches/001-create_Makefile.patch2
-rw-r--r--package/utils/adb/patches/020-cherry-picked-superspeed-fix.patch39
3 files changed, 41 insertions, 2 deletions
diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile
index 7be8ee9a1c..0482a40da1 100644
--- a/package/utils/adb/Makefile
+++ b/package/utils/adb/Makefile
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adb
PKG_VERSION:=android.5.0.2_r1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://android.googlesource.com/platform/system/core
diff --git a/package/utils/adb/patches/001-create_Makefile.patch b/package/utils/adb/patches/001-create_Makefile.patch
index be9f5f497a..d7fa00cb4c 100644
--- a/package/utils/adb/patches/001-create_Makefile.patch
+++ b/package/utils/adb/patches/001-create_Makefile.patch
@@ -1,5 +1,5 @@
--- /dev/null
-+++ b/adb/Makefile 2016-10-19 15:28:03.421194137 +0200
++++ b/adb/Makefile
@@ -0,0 +1,42 @@
+SRCS+= adb.c
+SRCS+= adb_auth_host.c
diff --git a/package/utils/adb/patches/020-cherry-picked-superspeed-fix.patch b/package/utils/adb/patches/020-cherry-picked-superspeed-fix.patch
new file mode 100644
index 0000000000..4dbcc58056
--- /dev/null
+++ b/package/utils/adb/patches/020-cherry-picked-superspeed-fix.patch
@@ -0,0 +1,39 @@
+From 58b01e01875e2f6ae593ded197430bc23713dd0a Mon Sep 17 00:00:00 2001
+From: Ingo Rohloff <lundril@gmx.de>
+Date: Fri, 16 May 2014 21:51:41 +0200
+Subject: [PATCH] ADB on linux: Handle USB SuperSpeed extra Descriptors
+
+Under Linux, ADB manually parses USB Descriptors to check for
+possible ADB USB Interfaces. USB Devices connected with SuperSpeed
+will exhibit extra USB SuperSpeed Endpoint Companion Descriptors.
+This patch handles these USB SuperSpeed specific USB Descriptors.
+
+Change-Id: Icd1e5fdde0b324c7df4f933583499f2c52a922f3
+Signed-off-by: Ingo Rohloff <lundril@gmx.de>
+---
+ adb/usb_linux.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/adb/usb_linux.c
++++ b/adb/usb_linux.c
+@@ -238,8 +238,20 @@ static void find_usb_device(const char *
+ // looks like ADB...
+ ep1 = (struct usb_endpoint_descriptor *)bufptr;
+ bufptr += USB_DT_ENDPOINT_SIZE;
++ // For USB 3.0 SuperSpeed devices, skip potential
++ // USB 3.0 SuperSpeed Endpoint Companion descriptor
++ if (bufptr+2 <= devdesc + desclength &&
++ bufptr[0] == USB_DT_SS_EP_COMP_SIZE &&
++ bufptr[1] == USB_DT_SS_ENDPOINT_COMP) {
++ bufptr += USB_DT_SS_EP_COMP_SIZE;
++ }
+ ep2 = (struct usb_endpoint_descriptor *)bufptr;
+ bufptr += USB_DT_ENDPOINT_SIZE;
++ if (bufptr+2 <= devdesc + desclength &&
++ bufptr[0] == USB_DT_SS_EP_COMP_SIZE &&
++ bufptr[1] == USB_DT_SS_ENDPOINT_COMP) {
++ bufptr += USB_DT_SS_EP_COMP_SIZE;
++ }
+
+ if (bufptr > devdesc + desclength ||
+ ep1->bLength != USB_DT_ENDPOINT_SIZE ||