summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2019-04-16 11:20:04 -0700
committerJosh Gao <jmgao@google.com>2019-04-17 17:53:34 -0700
commit08ccc735a386bdfb410538c714ec7871fda21537 (patch)
tree940299b975cf1a8111bcc8ca551f8c6a40bae433 /adb
parent6569f35ae08b5de4323ae52be47f73e4ecb58ae1 (diff)
downloadsystem_core-08ccc735a386bdfb410538c714ec7871fda21537.tar.gz
system_core-08ccc735a386bdfb410538c714ec7871fda21537.tar.bz2
system_core-08ccc735a386bdfb410538c714ec7871fda21537.zip
adbd: reduce the USB buffer sizes to 16k.
Some USB controllers only support 16k writes, so drop down to that. Bug: http://b/130622010 Test: treehugger Change-Id: I836d5b2d0d6fcae05f290af11a6a19c6e8d7c1ba (cherry picked from commit 770a6a4d46343dcb5b8ba5c584245c8fc369ac6a)
Diffstat (limited to 'adb')
-rw-r--r--adb/daemon/usb.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/adb/daemon/usb.cpp b/adb/daemon/usb.cpp
index 8c33ca580..3b29ab5fc 100644
--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -57,11 +57,12 @@ using android::base::StringPrintf;
// We can't find out whether we have support for AIO on ffs endpoints until we submit a read.
static std::optional<bool> gFfsAioSupported;
+// Not all USB controllers support operations larger than 16k, so don't go above that.
static constexpr size_t kUsbReadQueueDepth = 32;
-static constexpr size_t kUsbReadSize = 8 * PAGE_SIZE;
+static constexpr size_t kUsbReadSize = 4 * PAGE_SIZE;
static constexpr size_t kUsbWriteQueueDepth = 32;
-static constexpr size_t kUsbWriteSize = 8 * PAGE_SIZE;
+static constexpr size_t kUsbWriteSize = 4 * PAGE_SIZE;
static const char* to_string(enum usb_functionfs_event_type type) {
switch (type) {