summaryrefslogtreecommitdiff
path: root/fastboot/usb_linux.cpp
AgeCommit message (Collapse)Author
2020-05-28fastboot: Allow fastboot to asynchronously differentiate between fastboot ↵David Anderson
and fastbootd. It's not possible to programmatically determine which fastboot mode a device is in, without sending a getvar:is-userspace query. Unfortunately this is not possible asynchronously, and may interrupt other queries being processed. This patch changes fastbootd's USB interface name to "fastbootd". Note that tools use the protocol number/class and not this string, so it should be safe to extend. When using "fastboot devices", the interface name is now listed if set. Note that currently only the Linux version of the fastboot tool is capable of reading the interface name. Bug: 156966319 Test: fastboot devices on Linux Change-Id: I57ccf2bec1dda573fe3ac628a646624b76f45905
2018-09-04fastbootd: Fix transport ownership.David Anderson
This change moves Transport ownership back out of FastBootDriver. Callers of set_transport must ensure that the previous transport is destroyed. In addition, deleting a transport now ensures that it is closed. Bug: 78793464 Test: fastboot, fuzzy_fastboot works Change-Id: I8f9ed2f7d5b09fd0820b2677d087a027378f26db
2018-07-26Add support for fastboot transport timeouts and USB Reset() on linuxAaron Wisner
USB Reset() allows simulating unplugging and replugging device. Test: build and run fastboot on mac 10.13.3 Test: glinux build and run fastboot Change-Id: Id924d063e549a4cca9dda03afd8f8fe266f6d2ab
2018-07-25Revert "Add derived UsbTransport class with USB reset method"Tobias Thierer
This reverts commit ceb7cbf5fde0ff26a35d442135d01e52b0ef0771. Reason for revert: Broke mac builds: system/core/fastboot/usb_osx.cpp:513:35: error: use of undeclared identifier 'USB_TRANSACTION_TIMEOUT' USB_TRANSACTION_TIMEOUT, USB_TRANSACTION_TIMEOUT); ^ Change-Id: Ibe2f9ff2d5c63f9d33f4bd6d9ba962604cf8caeb
2018-07-24Add derived UsbTransport class with USB reset methodAaron Wisner
For testing there needs to be a way to simulate unplugging and replugging a device. This change adds support for a USB reset method that does this. Also add timeouts, so USB reads/writes don't block forever on an unresponsive device. Test: glinux, fastboot tool still works Test: Reset confirmed working via wireshark Linux URB captures Change-Id: I7213a2395d4ef1c0238810e4929ab966e78c8b55
2018-07-19Refactor libfastbootAaron Wisner
This change creates a nice and clean API for issuing fastboot commands without using the fastboot tool itself. Test: fastboot tool itself (now using libfastboot2) on sailfish, walleye, and other devices. Test: flash bootloader bootloader.img Test: flash radio radio.img Test: -w update img.zip Test: Manually getvar and reboot commands. Bug: 111126621 Change-Id: I0022536b204ce0c5ad8329367fd522fa3c57877d
2016-11-14Switch fastboot/init/libprocessgroup to std::this_thread::sleep_for.Elliott Hughes
Bug: http://b/32878766 Test: boots Change-Id: Ie0ddfb7e60f2da5f6eefbb10c83a92e88c137ae3
2016-04-29Fix google-explicit-constructor warnings.Chih-Hung Hsieh
Bug: 28341362 Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-02-18system/core: Cleanup direct calls to opendir by containing in aJames Hawkins
std::unique_ptr. Bug: 26643633 Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2015-11-16fastboot: create Transport object (take 2).David Pursell
(Second upload of this CL; original upload had the wrong version of usb_windows.cpp that caused a compilation error. Fixed error and re-tested.) This CL creates a Transport object to provide a generic interface for various transports. Specifically this is designed to be able to add UDP support to fastboot in an upcoming CL without changing the main program logic. Also includes some minor code style fixes and replaces malloc/free in the USB implementation files with smart pointers and std::string. Bug: http://b/22029765 Change-Id: I1175bbce08690fbd15f51e68166be9b3e9973ea0
2015-11-14Revert "fastboot: create Transport object."David Pursell
This broke some stuff, will look into it Monday. This reverts commit 6f233a7799a681e65c539e9c8287db0814c8948f. Change-Id: I155bc85d21fda3b0ba1e5e17839059797fb15509
2015-11-13fastboot: create Transport object.David Pursell
This CL creates a Transport object to provide a generic interface for various transports. Specifically this is designed to be able to add UDP support to fastboot in an upcoming CL without changing the main program logic. Also includes some minor code style fixes and replaces malloc/free in the USB implementation files with smart pointers and std::string. Bug: http://b/22029765 Change-Id: I68641af0da7d13db4647f5e20a18d04d67f0b327
2015-07-28Document the current MAX_USBFS_BULK_SIZE situation.Elliott Hughes
Bug: http://b/22688598 Change-Id: I8e5b92996d635f6b939f3add4dda0b9023629a8b
2015-06-23Move fastboot to C++.Elliott Hughes
Minimal conversion. Change-Id: I32cbf125be481a8757720d10fa303c38a7fd5e38