pub struct PcieRootPort {
    pcie_port: PciePort,
    downstream_devices: BTreeMap<PciAddress, HotPlugKey>,
    hotplug_out_begin: bool,
    removed_downstream: Vec<PciAddress>,
}

Fields§

§pcie_port: PciePort§downstream_devices: BTreeMap<PciAddress, HotPlugKey>§hotplug_out_begin: bool§removed_downstream: Vec<PciAddress>

Implementations§

source§

impl PcieRootPort

source

pub fn new(secondary_bus_num: u8, slot_implemented: bool) -> Self

Constructs a new PCIE root port

source

pub fn new_from_host( pcie_host: PcieHostPort, slot_implemented: bool ) -> Result<Self>

Constructs a new PCIE root port which associated with the host physical pcie RP

Trait Implementations§

source§

impl GpeNotify for PcieRootPort

source§

fn notify(&mut self)

source§

impl HotPlugBus for PcieRootPort

source§

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>>

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>

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>

Gets the upstream PCI Address of the hotplug bus
source§

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>

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 )

Add hotplug device into this bus Read more
source§

fn get_hotplug_device(&self, hotplug_key: HotPlugKey) -> Option<PciAddress>

get guest pci address from the specified hotplug_key
source§

fn is_empty(&self) -> bool

Check whether this hotplug bus is empty
source§

fn get_hotplug_key(&self) -> Option<HotPlugKey>

Get hotplug key of this hotplug bus
source§

impl PciePortVariant for PcieRootPort

source§

fn get_pcie_port(&self) -> &PciePort

source§

fn get_pcie_port_mut(&mut self) -> &mut PciePort

source§

fn get_removed_devices_impl(&self) -> Vec<PciAddress>

Called via PcieDevice.get_removed_devices
source§

fn hotplug_implemented_impl(&self) -> bool

Called via PcieDevice.hotplug_implemented
source§

fn hotplugged_impl(&self) -> bool

Called via PcieDevice.hotplug
source§

impl PmeNotify for PcieRootPort

source§

fn notify(&mut self, requester_id: u16)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: 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>

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)

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)

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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> PcieDevice for T
where T: PciePortVariant,

source§

fn get_device_id(&self) -> u16

source§

fn debug_label(&self) -> String

source§

fn preferred_address(&self) -> Option<PciAddress>

source§

fn allocate_address( &mut self, resources: &mut SystemAllocator ) -> Result<PciAddress, Error>

source§

fn clone_interrupt(&mut self, msi_config: Arc<Mutex<MsiConfig>>)

source§

fn read_config(&self, reg_idx: usize, data: &mut u32)

source§

fn write_config(&mut self, reg_idx: usize, offset: u64, data: &[u8])

source§

fn get_caps( &self ) -> Vec<(Box<dyn PciCapability>, Option<Box<dyn PciCapConfig>>)>

source§

fn handle_cap_write_result(&mut self, res: Box<dyn PciCapConfigWriteResult>)

source§

fn get_bus_range(&self) -> Option<PciBridgeBusRange>

source§

fn get_removed_devices(&self) -> Vec<PciAddress>

source§

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

This function returns true if this pcie device is hotplugged into the system
source§

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)
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V