Struct devices::usb::xhci::command_ring_controller::CommandRingTrbHandler
source · pub struct CommandRingTrbHandler {
slots: DeviceSlots,
interrupter: Arc<Mutex<Interrupter>>,
}
Fields§
§slots: DeviceSlots
§interrupter: Arc<Mutex<Interrupter>>
Implementations§
source§impl CommandRingTrbHandler
impl CommandRingTrbHandler
fn new(slots: DeviceSlots, interrupter: Arc<Mutex<Interrupter>>) -> Self
fn slot(&self, slot_id: u8) -> Result<Arc<DeviceSlot>, Error>
fn command_completion_callback( interrupter: &Arc<Mutex<Interrupter>>, completion_code: TrbCompletionCode, slot_id: u8, trb_addr: u64, event: &Event ) -> Result<(), Error>
fn enable_slot(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn disable_slot(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn address_device(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn configure_endpoint( &self, atrb: &AddressedTrb, event: Event ) -> Result<(), Error>
fn evaluate_context( &self, atrb: &AddressedTrb, event: Event ) -> Result<(), Error>
fn reset_device(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn stop_endpoint(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn reset_endpoint(&self, atrb: &AddressedTrb, event: Event) -> Result<(), Error>
fn set_tr_dequeue_ptr( &self, atrb: &AddressedTrb, event: Event ) -> Result<(), Error>
Trait Implementations§
source§impl TransferDescriptorHandler for CommandRingTrbHandler
impl TransferDescriptorHandler for CommandRingTrbHandler
source§fn handle_transfer_descriptor(
&self,
descriptor: Vec<AddressedTrb>,
complete_event: Event
) -> Result<()>
fn handle_transfer_descriptor( &self, descriptor: Vec<AddressedTrb>, complete_event: Event ) -> Result<()>
Process descriptor asynchronously, write complete_event when done.
source§fn stop(&self) -> bool
fn stop(&self) -> bool
Stop is called when trying to stop ring buffer controller. Returns true when stop must be
performed asynchronously. This happens because the handler is handling some descriptor
asynchronously, the stop callback of ring buffer controller must be called after the
async
part is handled or canceled. If the TransferDescriptorHandler decide it could stop
immediately, it could return false.
For example, if a handler submitted a transfer but the transfer has not yet finished. Then
guest kernel requests to stop the ring buffer controller. Transfer descriptor handler will
return true, thus RingBufferController would transfer to Stopping state. It will be stopped
when all pending transfer completed.
On the other hand, if hander does not have any pending transfers, it would return false.Auto Trait Implementations§
impl !RefUnwindSafe for CommandRingTrbHandler
impl Send for CommandRingTrbHandler
impl Sync for CommandRingTrbHandler
impl Unpin for CommandRingTrbHandler
impl !UnwindSafe for CommandRingTrbHandler
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.