pub struct Xhci {
fail_handle: Arc<dyn FailHandle>,
regs: XhciRegs,
interrupter: Arc<Mutex<Interrupter>>,
command_ring_controller: Arc<RingBufferController<CommandRingTrbHandler>>,
device_slots: DeviceSlots,
event_loop: Arc<EventLoop>,
event_loop_join_handle: Option<JoinHandle<()>>,
intr_resample_handler: Arc<IntrResampleHandler>,
device_provider: Box<dyn XhciBackendDeviceProvider>,
pending_usb_devices: Mutex<Vec<File>>,
}Expand description
xHCI controller implementation.
Fields§
§fail_handle: Arc<dyn FailHandle>§regs: XhciRegs§interrupter: Arc<Mutex<Interrupter>>§command_ring_controller: Arc<RingBufferController<CommandRingTrbHandler>>§device_slots: DeviceSlots§event_loop: Arc<EventLoop>§event_loop_join_handle: Option<JoinHandle<()>>§intr_resample_handler: Arc<IntrResampleHandler>§device_provider: Box<dyn XhciBackendDeviceProvider>§pending_usb_devices: Mutex<Vec<File>>USB device files to attach once the guest XHCI driver is ready (writes USBCMD Run bit).
Implementations§
Source§impl Xhci
impl Xhci
Sourcepub fn new(
fail_handle: Arc<dyn FailHandle>,
mem: GuestMemory,
device_provider: Box<dyn XhciBackendDeviceProvider>,
interrupt_evt: IrqLevelEvent,
regs: XhciRegs,
) -> Result<Arc<Self>, Error>
pub fn new( fail_handle: Arc<dyn FailHandle>, mem: GuestMemory, device_provider: Box<dyn XhciBackendDeviceProvider>, interrupt_evt: IrqLevelEvent, regs: XhciRegs, ) -> Result<Arc<Self>, Error>
Create a new xHCI controller.
Sourcepub fn new_with_devices(
fail_handle: Arc<dyn FailHandle>,
mem: GuestMemory,
device_provider: Box<dyn XhciBackendDeviceProvider>,
interrupt_evt: IrqLevelEvent,
regs: XhciRegs,
initial_usb_devices: Vec<File>,
) -> Result<Arc<Self>, Error>
pub fn new_with_devices( fail_handle: Arc<dyn FailHandle>, mem: GuestMemory, device_provider: Box<dyn XhciBackendDeviceProvider>, interrupt_evt: IrqLevelEvent, regs: XhciRegs, initial_usb_devices: Vec<File>, ) -> Result<Arc<Self>, Error>
Create a new xHCI controller with USB devices to attach at startup.
fn init_reg_callbacks(xhci: &Arc<Xhci>)
fn handle_register_callback_result<T>(&self, r: Result<T, Error>, t: T) -> T
fn usbcmd_callback(&self, value: u32) -> Result<u32, Error>
fn crcr_callback(&self, value: u64) -> u64
fn portsc_callback(&self, index: u32, value: u32) -> Result<u32, Error>
fn doorbell_callback(&self, index: u32, value: u32) -> Result<(), Error>
fn iman_callback(&self, value: u32) -> Result<(), Error>
fn imod_callback(&self, value: u32) -> Result<(), Error>
fn erstsz_callback(&self, value: u32) -> Result<(), Error>
fn erstba_callback(&self, value: u64) -> Result<(), Error>
fn erdp_callback(&self, value: u64) -> Result<(), Error>
fn reset(&self)
fn halt(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Xhci
impl !RefUnwindSafe for Xhci
impl Send for Xhci
impl Sync for Xhci
impl Unpin for Xhci
impl !UnwindSafe for Xhci
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more