pub trait DeviceBacking:
'static
+ Send
+ Inspect {
type Registers: 'static + DeviceRegisterIo + Inspect;
// Required methods
fn id(&self) -> &str;
fn map_bar(&mut self, n: u8) -> Result<Self::Registers>;
fn dma_client(&self) -> Arc<dyn DmaClient>;
fn max_interrupt_count(&self) -> u32;
fn map_interrupt(&mut self, msix: u32, cpu: u32) -> Result<DeviceInterrupt>;
}
Expand description
An interface to access device hardware.
Required Associated Types§
Sourcetype Registers: 'static + DeviceRegisterIo + Inspect
type Registers: 'static + DeviceRegisterIo + Inspect
An object for accessing device registers.
Required Methods§
Sourcefn dma_client(&self) -> Arc<dyn DmaClient>
fn dma_client(&self) -> Arc<dyn DmaClient>
DMA Client for the device.
Sourcefn max_interrupt_count(&self) -> u32
fn max_interrupt_count(&self) -> u32
Returns the maximum number of interrupts that can be mapped.
Sourcefn map_interrupt(&mut self, msix: u32, cpu: u32) -> Result<DeviceInterrupt>
fn map_interrupt(&mut self, msix: u32, cpu: u32) -> Result<DeviceInterrupt>
Maps a MSI-X interrupt for use, returning an object that can be used to wait for the interrupt to be signaled by the device.
cpu
is the CPU that the device should target with this interrupt.
This can be called multiple times for the same interrupt without disconnecting
previous mappings. The last cpu
value will be used as the target CPU.