Struct devices::usb::host_backend::host_device::HostDevice
source · pub struct HostDevice {
fail_handle: Arc<dyn FailHandle>,
endpoints: Vec<UsbEndpoint>,
device: Arc<Mutex<Device>>,
ctl_ep_state: ControlEndpointState,
alt_settings: HashMap<u8, u8>,
claimed_interfaces: Vec<u8>,
control_request_setup: UsbRequestSetup,
executed: bool,
initialized: bool,
job_queue: Arc<AsyncJobQueue>,
}
Expand description
Host device is a device connected to host.
Fields§
§fail_handle: Arc<dyn FailHandle>
§endpoints: Vec<UsbEndpoint>
§device: Arc<Mutex<Device>>
§ctl_ep_state: ControlEndpointState
§alt_settings: HashMap<u8, u8>
§claimed_interfaces: Vec<u8>
§control_request_setup: UsbRequestSetup
§executed: bool
§initialized: bool
§job_queue: Arc<AsyncJobQueue>
Implementations§
source§impl HostDevice
impl HostDevice
sourcepub fn new(
fail_handle: Arc<dyn FailHandle>,
job_queue: Arc<AsyncJobQueue>,
device: Arc<Mutex<Device>>
) -> Result<HostDevice>
pub fn new(
fail_handle: Arc<dyn FailHandle>,
job_queue: Arc<AsyncJobQueue>,
device: Arc<Mutex<Device>>
) -> Result<HostDevice>
Create a new host device.
fn intercepted_control_transfer(
&mut self,
xhci_transfer: &XhciTransfer,
buffer: &Option<ScatterGatherBuffer>
) -> Result<bool>
fn execute_control_transfer(
&mut self,
xhci_transfer: Arc<XhciTransfer>,
buffer: Option<ScatterGatherBuffer>
) -> Result<()>
fn handle_control_transfer(&mut self, transfer: XhciTransfer) -> Result<()>
fn set_config(&mut self) -> Result<TransferStatus>
fn set_interface(&mut self) -> Result<TransferStatus>
fn clear_feature(&mut self) -> Result<TransferStatus>
fn get_config_descriptor_filtered(
&mut self,
buffer: &ScatterGatherBuffer
) -> Result<(TransferStatus, u32)>
fn claim_interfaces(&mut self, config_descriptor: &ConfigDescriptorTree)
fn create_endpoints(
&mut self,
config_descriptor: &ConfigDescriptorTree
) -> Result<()>
fn release_interfaces(&mut self)
fn submit_transfer_helper(&mut self, transfer: XhciTransfer) -> Result<()>
Trait Implementations§
source§impl Drop for HostDevice
impl Drop for HostDevice
source§impl XhciBackendDevice for HostDevice
impl XhciBackendDevice for HostDevice
source§fn get_backend_type(&self) -> BackendType
fn get_backend_type(&self) -> BackendType
Returns the type of USB device provided by this device.
source§fn submit_transfer(&mut self, transfer: XhciTransfer) -> Result<()>
fn submit_transfer(&mut self, transfer: XhciTransfer) -> Result<()>
Submit a xhci transfer to backend.
source§fn set_address(&mut self, _address: UsbDeviceAddress)
fn set_address(&mut self, _address: UsbDeviceAddress)
Set address of this backend.
source§fn get_speed(&self) -> Option<DeviceSpeed>
fn get_speed(&self) -> Option<DeviceSpeed>
Get speed of this device.
Auto Trait Implementations§
impl !RefUnwindSafe for HostDevice
impl Send for HostDevice
impl Sync for HostDevice
impl Unpin for HostDevice
impl !UnwindSafe for HostDevice
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.