pub struct PcieUpstreamPort {
    pcie_port: PciePort,
    hotplugged: bool,
    downstream_devices: BTreeMap<PciAddress, HotPlugKey>,
}

Fields§

§pcie_port: PciePort§hotplugged: bool§downstream_devices: BTreeMap<PciAddress, HotPlugKey>

Implementations§

source§

impl PcieUpstreamPort

source

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

Constructs a new PCIE upstream port

source

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

Trait Implementations§

source§

impl HotPlugBus for PcieUpstreamPort

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_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_address(&self) -> Option<PciAddress>

Gets the upstream PCI Address of the hotplug bus
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 PcieUpstreamPort

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

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, Global>) -> Rc<dyn Any, Global>

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

§

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

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 Twhere 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 Twhere 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>, Global>)

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, Global>, Option<Box<dyn PciCapConfig, Global>>), Global>

source§

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

source§

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

source§

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

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 Twhere 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 Twhere 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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V