summary refs log tree commit diff
path: root/usb_util
Commit message (Collapse)AuthorAge
* Remove redundant single-component importsDaniel Verkamp2020-04-26
| | | | | | | | | | | | | Fix clippy 1.43.0 clippy::single-component-path-imports warnings. BUG=None TEST=bin/clippy Change-Id: I3f4f54138bedce16dc1ca937bb8bc00a94594f69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2163203 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* devices: usb: temporarily disable resetsDaniel Verkamp2020-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a workaround for a bug encountered with newer Android phones - when connected to the Linux VM, resetting the USB device via USBDEVFS_RESET causes the device to disconnect from the host, preventing its use in the VM. This works around the issue by removing both paths that can cause a USB device reset (initial reset at device insertion plus reset when requested by the guest kernel). Both of these must be removed to restore functionality; if either is still in place, the failure is still observed. The workaround specifically exempts Edge TPU devices, which need a reset for firmware update; these devices will still issue a reset on connect and when requested by the guest. BUG=chromium:1058059 TEST=Connect Pixel 3 to eve, adb logcat Change-Id: I7a689da1120e1fb772d95e41a0d4debe64f7d6a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2105814 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
* usb: avoid setting configuration when unnecessaryDaniel Verkamp2020-03-24
| | | | | | | | | | | | | | | | | | | | | On devices with only one configuration, skip the code that attempts to change the device's active configuration, since it must always be the single available configuration. This works around an issue observed with some USB devices (e.g. Servo Micro) where the initial Get Configuration control request fails with -EPIPE. BUG=chromium:1061382 BUG=b:151408644 TEST=Attach servo micro, see /dev/ttyUSB[012], screen /dev/ttyUSB0 Change-Id: Ic3333e1d70a0c57b090de64e4d3b7932ce2cf81d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2108871 Reviewed-by: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: George Engelbrecht <engeg@google.com> Commit-Queue: George Engelbrecht <engeg@google.com>
* crosvm: move vec_with_array_field to data_modelGurchetan Singh2019-12-11
| | | | | | | | | | | | | | Move it to the newly created flexible array file. BUG=chromium:892806 TEST=compiles Change-Id: I6c423a885cec17e376b0da87a4adbd17c71ff6f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1325510 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* usb_util: use sys_util::vec_with_array_fieldDaniel Verkamp2019-10-23
| | | | | | | | | | | | | Drop the copy of vec_with_array_field now that it is available in a common location. BUG=None TEST=cargo build Change-Id: Ia272803737a4cb3e4e84213c48aa8e28c17bab2c Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1865680 Reviewed-by: Stephen Barber <smbarber@chromium.org>
* fuzz: add USB descriptor parsing fuzzerDaniel Verkamp2019-10-17
| | | | | | | | | | | | | | | The new USB descriptor parsing code is a nice candidate for a fuzzer, since it takes an arbitrary stream of bytes as input and parses it. BUG=chromium:987833 TEST=`USE='asan fuzzer' emerge-nami crosvm` Cq-Depend: chromium:1863465 Change-Id: I3bbdbf081e9a9dd590c781467f8bd44fa1dcab64 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1862117 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* usb: replace libusb with Rust usb_util libraryDaniel Verkamp2019-10-17
| | | | | | | | | | | | | | | | | | | | | Drop the dependency on libusb and reimplement the host USB backend using usb_sys to wrap the Linux usbdevfs ioctls. This allows sandboxing to work without any dependency on libusb patches, and it gives us the flexibility to modify and update the USB backend without depending on an external third-party library. BUG=chromium:987833 TEST=`adb logcat` on nami with Nexus 5 attached TEST=deploy app to phone with Android Studio TEST=Run EdgeTPU USB accelerator demo (including DFU mode transition) Cq-Depend: chromium:1773695 Change-Id: I4321c2b6142caac15f48f197795a37d59d268831 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1783601 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* usb: clarify transfer cancellation APIDaniel Verkamp2019-09-09
| | | | | | | | | | | | | | | Rather than having a get_canceller() function on UsbTransfer, make the submit function return the canceller. This makes it clear that the transfer can't be cancelled before it is submitted. BUG=None TEST=None Change-Id: Ice36c3096a1f8a5aafe93b5d5e27eb371183c19f Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1783599 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
* usb: switch to new libusb_wrap_sys_device APIDaniel Verkamp2019-06-27
| | | | | | | | | | | | | | | | | | | | Replace use of our custom, patched libusb APIs with the new libusb_wrap_sys_device() function, which has been submitted to libusb upstream. This allows us to drop the bindings for the custom APIs (and will also allow us to drop the libusb patch that introduces them). For now, keep this path behind the sandboxed-libusb feature to allow crosvm to build against older libusb versions that do not have the new API. This should be cleaned up eventually once we are comfortable with raising the minimum libusb version required. BUG=b:133773289 TEST=Attach Android device to Linux VM; deploy app via adb Change-Id: Ie249c6f3f3b4c63210dd163ca7ad03e2de8a8872 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1676601 Tested-by: kokoro <noreply+kokoro@google.com>
* eliminate usage of uninitializedZach Reizner2019-05-23
| | | | | | | | | | | | | | | | | uninitialized is deprecated and considered too dangerous to use for any of the use cases we were using. BUG=None TEST=passes smoke_test Change-Id: I5392cb8ec132f374d9b5590f72eb2cb329a82421 Reviewed-on: https://chromium-review.googlesource.com/1626795 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* usb: refactor intercepted control request handlingDaniel Verkamp2019-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* usb: remove pointless Options in UsbRequestSetupDaniel Verkamp2019-05-10
| | | | | | | | | | | | | | | | | | | | The get_type and get_direction helpers return Options, even though they can only possibly return a non-None value; all bit patterns of the fields they are interpreting are defined. Drop the Options and return the enum values directly to simplify callers and remove dead code. Fix up a typo ("recipienet" -> "recipient") while we're in the neighborhood. BUG=chromium:831850 TEST=Test adb in Crostini Change-Id: Ie26a1ed1c15f5f17b5ae80be78ce5f8ff51fab28 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1593713 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>
* usb: fix serial devices by removing device context verificationJingkui Wang2019-05-01
| | | | | | | | | | | | | | | | | | | | | 1. Removed for device slot reset and evaluate context. The verification was unnecessary and may cause some guest kernel operations to fail. 2. The context was updated after dequeue pointer set 3. Reset device when it's attached. 4. Add seccomp rules to allow the above reset. The verification was copied from another implementation which works for adb, but does not work with serial devices. The verification is also not part of the spec, so we removed it here. BUG=b:131336977 TEST=local build and test Change-Id: Ifd7994ff5512346d1bab27654e60c97a602da8a6 Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Signed-off-by: Zach Reizner <zachr@google.com> Reviewed-on: https://chromium-review.googlesource.com/1558934 Tested-by: kokoro <noreply+kokoro@google.com>
* crosvm: add license blurb to all filesStephen Barber2019-04-24
| | | | | | | | | | | | | | A few files were missing license blurbs at the top, so update them all to include them. BUG=none TEST=none Change-Id: Ida101be2e5c255b8cffeb15f5b93f63bfd1b130b Reviewed-on: https://chromium-review.googlesource.com/1577900 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* clippy: Resolve clone_on_copyDavid Tolnay2019-04-17
| | | | | | | | | | | TEST=bin/clippy Change-Id: Ia9f58fd7ba0b7af6eee455f52b3b9004547aa25e Reviewed-on: https://chromium-review.googlesource.com/1566659 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* clippy: Switch to tool attributes for suppressing lintsDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | Tool attributes were stabilized in Rust 1.31: https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html#tool-lints Before: #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment)] After: #[allow(clippy::cast_ptr_alignment)] TEST=cargo check --all-features Change-Id: If2f1511f6231d60578b5e0d5bd4210a68eb08caf Reviewed-on: https://chromium-review.googlesource.com/1566651 Commit-Ready: David Tolnay <dtolnay@chromium.org> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* edition: Remove extern crate linesDavid Tolnay2019-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rust 2018 edition, `extern crate` is no longer required for importing from other crates. Instead of writing: extern crate dep; use dep::Thing; we write: use dep::Thing; In this approach, macros are imported individually from the declaring crate rather than through #[macro_use]. Before: #[macro_use] extern crate sys_util; After: use sys_util::{debug, error}; The only place that `extern crate` continues to be required is in importing the compiler's proc_macro API into a procedural macro crate. This will hopefully be fixed in a future Rust release. extern crate proc_macro; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293 Reviewed-on: https://chromium-review.googlesource.com/1565302 Commit-Ready: David Tolnay <dtolnay@chromium.org> Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* edition: Update usb_util to 2018 editionDavid Tolnay2019-04-09
| | | | | | | | | | | | | | | | | | Separated out of CL:1513058 to make it possible to land parts individually while the affected crate has no other significant CLs pending. This avoids repeatedly introducing non-textual conflicts with new code that adds `use` statements. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: Ibe8274ab3494d3562e3bc79bfd88193db88679c7 Reviewed-on: https://chromium-review.googlesource.com/1520071 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* edition: Use dyn syntax for trait objectsDavid Tolnay2019-04-08
| | | | | | | | | | | | | | | | | | | | | Found by running: `cargo rustc -- -D bare_trait_objects` Bare trait objects like `&Trait` and `Box<Trait>` are soft-deprecated in 2018 edition and will start warning at some point. As part of this, I replaced `Box<Trait + 'static>` with `Box<dyn Trait>` because the 'static bound is implied for boxed trait objects. TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I41c4f13530bece8a34a8ed1c1afd7035b8f86f19 Reviewed-on: https://chromium-review.googlesource.com/1513059 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* usb_util: silence unused code warningDaniel Verkamp2019-03-20
| | | | | | | | | | | | | | The RawFd import is only used when sandboxed-libusb is set, so put it behind a cfg check. BUG=None TEST=cargo build passes without warnings Change-Id: Iaae6131dabff2205f86dac2bf3a4e7ad08e66eac Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1531093 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* edition: Update absolute paths to 2018 styleDavid Tolnay2019-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an easy step toward adopting 2018 edition eventually, and will make any future CL that sets `edition = "2018"` this much smaller. The module system changes in Rust 2018 are described here: https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html Generated by running: cargo fix --edition --all in each workspace, followed by bin/fmt. TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu Change-Id: I000ab5e69d69aa222c272fae899464bbaf65f6d8 Reviewed-on: https://chromium-review.googlesource.com/1513054 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
* usb_utils: Add hotplug interfaceJingkui Wang2019-03-08
| | | | | | | | | | | | | | Hotplug callback would be invoked when device attach or detach TEST=run crosvm locally BUG=chromium:831850 CQ-DEPEND=CL:1506826 Change-Id: Ifc1acc00a12c32dd00abbb5467874632e94f60b4 Reviewed-on: https://chromium-review.googlesource.com/1506827 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: Add libusb jailed apiJingkui Wang2019-03-08
| | | | | | | | | | | | | | This patch add bindings for libusb_init_jailed, and libusb_get_device_from_fd. TEST=run crosvm locally BUG=chromium:831850 Change-Id: I948594c8293b185bd873fd98b497ea9171b84c86 Reviewed-on: https://chromium-review.googlesource.com/1506826 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: fix documentation commentJianxun Zhang2019-02-19
| | | | | | | | | | | | BUG=none (found during code review) TEST=none Change-Id: I5343297a85c52a9b97f3839fde6a38c205b31cc1 Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1474737 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* usb_util: add sandboxed-libusb featureJingkui Wang2018-12-20
| | | | | | | | | | | | | | | | make open_fd patch optional. if sandboxed-libusb feature is not selected, open_fd is not required. In this case, the code must have access to /dev/bus/usb, and not external fd is needed. BUG=chromium:831850 TEST=cargo test Change-Id: I21fa87dd15d08a03c2fe2b190559abbe6f63dcd5 Reviewed-on: https://chromium-review.googlesource.com/1375019 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: add open fd patch to libusbJingkui Wang2018-12-20
| | | | | | | | | | | | | open fd allow sandbox libusb. BUG=chromium:831850 TEST=local build Change-Id: Icda555936dbee3e9a56321ae616845c4310f20da Reviewed-on: https://chromium-review.googlesource.com/1327512 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* usb_util: implement usb_transferJingkui Wang2018-12-14
| | | | | | | | | | | | | Wrap libusb_transfer and callback. BUG=chromium:831850 TEST=local build Change-Id: I1bc84e68cb36796e919f647e3a072f1599f80a4a Reviewed-on: https://chromium-review.googlesource.com/1138643 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
* assertions: Use compile-time assertion macroDavid Tolnay2018-12-09
| | | | | | | | | | | | | | | This depends on the `assertions` crate added in CL:1366819. `const_assert!(boolean expression)` is a compile-time assertion that fails to compile if the expression is false. TEST=`cargo check` each of the modified crates Change-Id: I559884baf2275b1b506619693cd100a4ffc8adcd Reviewed-on: https://chromium-review.googlesource.com/1368364 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* sync: Mutex type with methods that panic instead of return errorDavid Tolnay2018-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a crate `sync` containing a type sync::Mutex which wraps the standard library Mutex and mirrors the same methods, except that they panic where the standard library would return a PoisonError. This API codifies our error handling strategy around poisoned mutexes in crosvm. - Crosvm releases are built with panic=abort so poisoning never occurs. A panic while a mutex is held (or ever) takes down the entire process. Thus we would like for code not to have to consider the possibility of poison. - We could ask developers to always write `.lock().unwrap()` on a standard library mutex. However, we would like to stigmatize the use of unwrap. It is confusing to permit unwrap but only on mutex lock results. During code review it may not always be obvious whether a particular unwrap is unwrapping a mutex lock result or a different error that should be handled in a more principled way. Developers should feel free to use sync::Mutex anywhere in crosvm that they would otherwise be using std::sync::Mutex. TEST=boot linux Change-Id: I9727b6f8fee439edb4a8d52cf19d59acf04d990f Reviewed-on: https://chromium-review.googlesource.com/1359923 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* lint: Resolve the easier clippy lintsDavid Tolnay2018-12-03
| | | | | | | | | | | | | | | | | | | | Hopefully the changes are self-explanatory and uncontroversial. This eliminates much of the noise from `cargo clippy` and, for my purposes, gives me a reasonable way to use it as a tool when writing and reviewing code. Here is the Clippy invocation I was using: cargo +nightly clippy -- -W clippy::correctness -A renamed_and_removed_lints -Aclippy::{blacklisted_name,borrowed_box,cast_lossless,cast_ptr_alignment,enum_variant_names,identity_op,if_same_then_else,mut_from_ref,needless_pass_by_value,new_without_default,new_without_default_derive,or_fun_call,ptr_arg,should_implement_trait,single_match,too_many_arguments,trivially_copy_pass_by_ref,unreadable_literal,unsafe_vector_initialization,useless_transmute} TEST=cargo check --features wl-dmabuf,gpu,usb-emulation TEST=boot linux Change-Id: I55eb1b4a72beb2f762480e3333a921909314a0a2 Reviewed-on: https://chromium-review.googlesource.com/1356911 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
* usb_util: Add descriptorsJingkui Wang2018-12-01
| | | | | | | | | | | | | | add config descriptors, endpoint descriptors, interface descriptors. BUG=chromium:831850 TEST=cargo test CQ-DEPEND=CL:1135783 Change-Id: If74c407f198725bdc6a3096b03d6fe02dcd29ec8 Reviewed-on: https://chromium-review.googlesource.com/1299716 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* usb_util: Add pollfd change handler.Jingkui Wang2018-12-01
| | | | | | | | | | | | | | Allow user to hander pollfd change events. BUG=chromium:831850 TEST=local build CQ-DEPEND=CL:1124870 Change-Id: I013104e7dfae8f9ae94803f99f435039cd53925c Reviewed-on: https://chromium-review.googlesource.com/1135783 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>
* usb_util: Create libusb wrapperJingkui Wang2018-12-01
This wrapper will be part of usb emulation backend. BUG=chromium:831850 TEST=local build Change-Id: I084b15201941e4c16c4e3ff9b967e55db09db567 Reviewed-on: https://chromium-review.googlesource.com/1124870 Commit-Ready: Jingkui Wang <jkwang@google.com> Tested-by: Jingkui Wang <jkwang@google.com> Reviewed-by: Jingkui Wang <jkwang@google.com>