crosvm/usb_util/src/lib.rs
Daniel Verkamp ccb95543ee usb_util: add raw access to descriptors
Also allow querying the offset of each descriptor within the raw slice
of bytes.

BUG=b:180238956
BUG=chromium:1030778
TEST=cargo test -p usb_util

Change-Id: I1e7de89e075b78b3675c8f95c992d247e8f83ce3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2811861
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2021-04-22 17:25:24 +00:00

20 lines
808 B
Rust

// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
mod descriptor;
mod device;
mod error;
mod types;
pub use self::descriptor::{
parse_usbfs_descriptors, ConfigDescriptorTree, DeviceDescriptorTree, InterfaceDescriptorTree,
};
pub use self::device::{Device, Transfer, TransferStatus};
pub use self::error::{Error, Result};
pub use self::types::{
control_request_type, ConfigDescriptor, ControlRequestDataPhaseTransferDirection,
ControlRequestRecipient, ControlRequestType, DescriptorHeader, DescriptorType,
DeviceDescriptor, EndpointDescriptor, EndpointDirection, EndpointType, InterfaceDescriptor,
StandardControlRequest, UsbRequestSetup, ENDPOINT_DIRECTION_OFFSET,
};