crosvm/devices
Daniel Verkamp 9fb20d9c53 usb: refactor intercepted control request handling
Certain control requests need to be intercepted for special handling
rather than being passed through directly to the device.  Clean up the
implementation of these intercepted requests by getting rid of the
confusing intermediate analyze_request_setup function and merging it
with the actual handling of each intercepted request in the new
execute_control_transfer function.  This keeps the custom handling all
in one place rather than scattered around the file and removes the need
for the extra HostToDeviceControlRequest enum.

Also add a check in get_standard_request to verify that the request is
indeed a standard control request so that the caller does not need to
check.

BUG=chromium:831850
TEST=Test adb on Crostini

Change-Id: I73b1db76941c39f124cfd0f51f14c15017ba9141
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1593714
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-05-10 15:26:01 -07:00
..
src usb: refactor intercepted control request handling 2019-05-10 15:26:01 -07:00
Cargo.toml edition: Update devices crate to 2018 edition 2019-04-15 02:06:04 -07:00