• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Révision32e78e649e7ac330db4cd3b057a18f94c645a583 (tree)
l'heure2019-05-21 12:00:30
Auteurandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Message de Log

Snap for 5587054 from b28857eee628de9ee6bbae63d745727c5bc81988 to qt-qpr1-release

Change-Id: I6cd23141447ccbcb16663ef921842ce89e79801b

Change Summary

Modification

--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -58,10 +58,12 @@ using android::base::StringPrintf;
5858 static std::optional<bool> gFfsAioSupported;
5959
6060 // Not all USB controllers support operations larger than 16k, so don't go above that.
61-static constexpr size_t kUsbReadQueueDepth = 32;
61+// Also, each submitted operation does an allocation in the kernel of that size, so we want to
62+// minimize our queue depth while still maintaining a deep enough queue to keep the USB stack fed.
63+static constexpr size_t kUsbReadQueueDepth = 8;
6264 static constexpr size_t kUsbReadSize = 4 * PAGE_SIZE;
6365
64-static constexpr size_t kUsbWriteQueueDepth = 32;
66+static constexpr size_t kUsbWriteQueueDepth = 8;
6567 static constexpr size_t kUsbWriteSize = 4 * PAGE_SIZE;
6668
6769 static const char* to_string(enum usb_functionfs_event_type type) {
@@ -314,11 +316,13 @@ struct UsbFfsConnection : public Connection {
314316 if (bound) {
315317 LOG(WARNING) << "received FUNCTIONFS_BIND while already bound?";
316318 running = false;
319+ break;
317320 }
318321
319322 if (enabled) {
320323 LOG(WARNING) << "received FUNCTIONFS_BIND while already enabled?";
321324 running = false;
325+ break;
322326 }
323327
324328 bound = true;
@@ -328,11 +332,13 @@ struct UsbFfsConnection : public Connection {
328332 if (!bound) {
329333 LOG(WARNING) << "received FUNCTIONFS_ENABLE while not bound?";
330334 running = false;
335+ break;
331336 }
332337
333338 if (enabled) {
334339 LOG(WARNING) << "received FUNCTIONFS_ENABLE while already enabled?";
335340 running = false;
341+ break;
336342 }
337343
338344 enabled = true;
@@ -364,6 +370,33 @@ struct UsbFfsConnection : public Connection {
364370 bound = false;
365371 running = false;
366372 break;
373+
374+ case FUNCTIONFS_SETUP: {
375+ LOG(INFO) << "received FUNCTIONFS_SETUP control transfer: bRequestType = "
376+ << static_cast<int>(event.u.setup.bRequestType)
377+ << ", bRequest = " << static_cast<int>(event.u.setup.bRequest)
378+ << ", wValue = " << static_cast<int>(event.u.setup.wValue)
379+ << ", wIndex = " << static_cast<int>(event.u.setup.wIndex)
380+ << ", wLength = " << static_cast<int>(event.u.setup.wLength);
381+
382+ if ((event.u.setup.bRequestType & USB_DIR_IN)) {
383+ LOG(WARNING) << "received a device-to-host control transfer, ignoring";
384+ } else {
385+ std::string buf;
386+ buf.resize(event.u.setup.wLength + 1);
387+
388+ ssize_t rc = adb_read(control_fd_.get(), buf.data(), buf.size());
389+ if (rc != event.u.setup.wLength) {
390+ LOG(ERROR)
391+ << "read " << rc
392+ << " bytes when trying to read control request, expected "
393+ << event.u.setup.wLength;
394+ }
395+
396+ LOG(INFO) << "control request contents: " << buf;
397+ break;
398+ }
399+ }
367400 }
368401 }
369402