Trait TransferDescriptorHandler

Source
pub trait TransferDescriptorHandler {
    // Required method
    fn handle_transfer_descriptor(
        &self,
        descriptor: TransferDescriptor,
        trigger_event: Event,
    ) -> Result<()>;

    // Provided method
    fn cancel_transfers(&self, _callback: RingBufferStopCallback) { ... }
}
Expand description

TransferDescriptorHandler handles transfer descriptor. User should implement this trait and build a ring buffer controller with the struct.

Required Methods§

Source

fn handle_transfer_descriptor( &self, descriptor: TransferDescriptor, trigger_event: Event, ) -> Result<()>

Process descriptor asynchronously, signal trigger_event when ready to proceed.

Provided Methods§

Source

fn cancel_transfers(&self, _callback: RingBufferStopCallback)

Cancel transfers. This is used to stop the ring activity as soon as possible when we process a Stop Endpoint command. xHCI spec 4.6.9 states we need to stop the USB activity for the pipe before sending the completion event. Use the callback to ensure that all the in-flight transfers are gone before sending the event, if the backend cannot immediately cancel them.

Implementors§