Trait devices::pci::pcie::pcie_device::PcieDevice
source · pub trait PcieDevice: Send {
Show 14 methods
// Required methods
fn get_device_id(&self) -> u16;
fn debug_label(&self) -> String;
fn allocate_address(
&mut self,
resources: &mut SystemAllocator
) -> Result<PciAddress, PciDeviceError>;
fn read_config(&self, reg_idx: usize, data: &mut u32);
fn write_config(&mut self, reg_idx: usize, offset: u64, data: &[u8]);
fn handle_cap_write_result(&mut self, res: Box<dyn PciCapConfigWriteResult>);
fn clone_interrupt(&mut self, msi_config: Arc<Mutex<MsiConfig>>);
fn get_caps(
&self
) -> Vec<(Box<dyn PciCapability>, Option<Box<dyn PciCapConfig>>)>;
fn get_removed_devices(&self) -> Vec<PciAddress>;
fn hotplug_implemented(&self) -> bool;
fn hotplugged(&self) -> bool;
fn get_bridge_window_size(&self) -> (u64, u64);
// Provided methods
fn preferred_address(&self) -> Option<PciAddress> { ... }
fn get_bus_range(&self) -> Option<PciBridgeBusRange> { ... }
}
Required Methods§
fn get_device_id(&self) -> u16
fn debug_label(&self) -> String
fn allocate_address( &mut self, resources: &mut SystemAllocator ) -> Result<PciAddress, PciDeviceError>
fn read_config(&self, reg_idx: usize, data: &mut u32)
fn write_config(&mut self, reg_idx: usize, offset: u64, data: &[u8])
fn handle_cap_write_result(&mut self, res: Box<dyn PciCapConfigWriteResult>)
fn clone_interrupt(&mut self, msi_config: Arc<Mutex<MsiConfig>>)
fn get_caps( &self ) -> Vec<(Box<dyn PciCapability>, Option<Box<dyn PciCapConfig>>)>
fn get_removed_devices(&self) -> Vec<PciAddress>
sourcefn hotplug_implemented(&self) -> bool
fn hotplug_implemented(&self) -> bool
Hotplug capability is implemented on this bridge or not. Return true, the children pci devices could be connected through hotplug Return false, the children pci devices should be connected statically
sourcefn hotplugged(&self) -> bool
fn hotplugged(&self) -> bool
This function returns true if this pcie device is hotplugged into the system
sourcefn get_bridge_window_size(&self) -> (u64, u64)
fn get_bridge_window_size(&self) -> (u64, u64)
Get bridge window size to cover children’s mmio size (u64, u64) -> (non_prefetchable window size, prefetchable_window_size)