Struct devices::PcieDownstreamPort
source · pub struct PcieDownstreamPort {
pcie_port: PciePort,
hotplugged: bool,
downstream_devices: BTreeMap<PciAddress, HotPlugKey>,
hotplug_out_begin: bool,
removed_downstream: Vec<PciAddress>,
}
Fields§
§pcie_port: PciePort
§hotplugged: bool
§downstream_devices: BTreeMap<PciAddress, HotPlugKey>
§hotplug_out_begin: bool
§removed_downstream: Vec<PciAddress>
Implementations§
source§impl PcieDownstreamPort
impl PcieDownstreamPort
sourcepub fn new(primary_bus_num: u8, secondary_bus_num: u8, hotplugged: bool) -> Self
pub fn new(primary_bus_num: u8, secondary_bus_num: u8, hotplugged: bool) -> Self
Constructs a new PCIE downstream port
pub fn new_from_host( pcie_host: PcieHostPort, hotplugged: bool ) -> Result<Self, PciDeviceError>
Trait Implementations§
source§impl HotPlugBus for PcieDownstreamPort
impl HotPlugBus for PcieDownstreamPort
source§fn hot_plug(&mut self, addr: PciAddress) -> Result<Option<Event>>
fn hot_plug(&mut self, addr: PciAddress) -> Result<Option<Event>>
Request hot plug event. Returns error if the request is not sent. Upon success, optionally
returns an event, which is triggerred once when the guest OS completes the request (by
sending PCI_EXP_SLTCTL_CCIE). Returns None if no such mechanism is provided. Read more
source§fn hot_unplug(&mut self, addr: PciAddress) -> Result<Option<Event>>
fn hot_unplug(&mut self, addr: PciAddress) -> Result<Option<Event>>
Request hot unplug event. Returns error if the request is not sent. Upon success, optionally
returns an event, which is triggerred once when the guest OS completes the request (by
sending PCI_EXP_SLTCTL_CCIE). Returns None if no such mechanism is provided. Read more
source§fn get_ready_notification(&mut self) -> Result<Event>
fn get_ready_notification(&mut self) -> Result<Event>
Get a notification event when the HotPlugBus is ready for hot plug commands. If the port is
already ready, then the notification event is triggerred immediately.
source§fn get_address(&self) -> Option<PciAddress>
fn get_address(&self) -> Option<PciAddress>
Gets the upstream PCI Address of the hotplug bus
source§fn get_secondary_bus_number(&self) -> Option<u8>
fn get_secondary_bus_number(&self) -> Option<u8>
Gets the secondary bus number of this bus
source§fn is_match(&self, host_addr: PciAddress) -> Option<u8>
fn is_match(&self, host_addr: PciAddress) -> Option<u8>
Check whether the hotplug bus is available to add the new device Read more
source§fn add_hotplug_device(
&mut self,
hotplug_key: HotPlugKey,
guest_addr: PciAddress
)
fn add_hotplug_device( &mut self, hotplug_key: HotPlugKey, guest_addr: PciAddress )
Add hotplug device into this bus Read more
source§fn get_hotplug_device(&self, hotplug_key: HotPlugKey) -> Option<PciAddress>
fn get_hotplug_device(&self, hotplug_key: HotPlugKey) -> Option<PciAddress>
get guest pci address from the specified hotplug_key
source§fn get_hotplug_key(&self) -> Option<HotPlugKey>
fn get_hotplug_key(&self) -> Option<HotPlugKey>
Get hotplug key of this hotplug bus
source§impl PciePortVariant for PcieDownstreamPort
impl PciePortVariant for PcieDownstreamPort
fn get_pcie_port(&self) -> &PciePort
fn get_pcie_port_mut(&mut self) -> &mut PciePort
source§fn get_removed_devices_impl(&self) -> Vec<PciAddress>
fn get_removed_devices_impl(&self) -> Vec<PciAddress>
Called via PcieDevice.get_removed_devices
source§fn hotplug_implemented_impl(&self) -> bool
fn hotplug_implemented_impl(&self) -> bool
Called via PcieDevice.hotplug_implemented
source§fn hotplugged_impl(&self) -> bool
fn hotplugged_impl(&self) -> bool
Called via PcieDevice.hotplug
Auto Trait Implementations§
impl RefUnwindSafe for PcieDownstreamPort
impl Send for PcieDownstreamPort
impl Sync for PcieDownstreamPort
impl Unpin for PcieDownstreamPort
impl UnwindSafe for PcieDownstreamPort
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> PcieDevice for Twhere
T: PciePortVariant,
impl<T> PcieDevice for Twhere
T: PciePortVariant,
fn get_device_id(&self) -> u16
fn debug_label(&self) -> String
fn preferred_address(&self) -> Option<PciAddress>
fn allocate_address( &mut self, resources: &mut SystemAllocator ) -> Result<PciAddress, Error>
fn clone_interrupt(&mut self, msi_config: Arc<Mutex<MsiConfig>>)
fn read_config(&self, reg_idx: usize, data: &mut u32)
fn write_config(&mut self, reg_idx: usize, offset: u64, data: &[u8])
fn get_caps( &self ) -> Vec<(Box<dyn PciCapability>, Option<Box<dyn PciCapConfig>>)>
fn handle_cap_write_result(&mut self, res: Box<dyn PciCapConfigWriteResult>)
fn get_bus_range(&self) -> Option<PciBridgeBusRange>
fn get_removed_devices(&self) -> Vec<PciAddress>
source§fn 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
source§fn hotplugged(&self) -> bool
fn hotplugged(&self) -> bool
This function returns true if this pcie device is hotplugged into the system
source§fn 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)