pub trait Device: AsRef<Device<Core>> {
// Provided methods
unsafe fn dma_set_mask(&self, mask: DmaMask) -> Result { ... }
unsafe fn dma_set_coherent_mask(&self, mask: DmaMask) -> Result { ... }
unsafe fn dma_set_mask_and_coherent(&self, mask: DmaMask) -> Result { ... }
}
Expand description
Trait to be implemented by DMA capable bus devices.
The dma::Device
trait should be implemented by bus specific device representations,
where the underlying bus is DMA capable, such as pci::Device
or
platform::Device
.
Provided Methods§
Sourceunsafe fn dma_set_mask(&self, mask: DmaMask) -> Result
unsafe fn dma_set_mask(&self, mask: DmaMask) -> Result
Set up the device’s DMA streaming addressing capabilities.
This method is usually called once from probe()
as soon as the device capabilities are
known.
§Safety
This method must not be called concurrently with any DMA allocation or mapping primitives,
such as CoherentAllocation::alloc_attrs
.
Sourceunsafe fn dma_set_coherent_mask(&self, mask: DmaMask) -> Result
unsafe fn dma_set_coherent_mask(&self, mask: DmaMask) -> Result
Set up the device’s DMA coherent addressing capabilities.
This method is usually called once from probe()
as soon as the device capabilities are
known.
§Safety
This method must not be called concurrently with any DMA allocation or mapping primitives,
such as CoherentAllocation::alloc_attrs
.
Sourceunsafe fn dma_set_mask_and_coherent(&self, mask: DmaMask) -> Result
unsafe fn dma_set_mask_and_coherent(&self, mask: DmaMask) -> Result
Set up the device’s DMA addressing capabilities.
This is a combination of Device::dma_set_mask
and Device::dma_set_coherent_mask
.
This method is usually called once from probe()
as soon as the device capabilities are
known.
§Safety
This method must not be called concurrently with any DMA allocation or mapping primitives,
such as CoherentAllocation::alloc_attrs
.