Trait PciDeviceStructure

Source
pub trait PciDeviceStructure: Send + Sync {
Show 15 methods // Required methods fn header_type(&self) -> HeaderType; fn common_header(&self) -> &PciDeviceStructureHeader; fn common_header_mut(&mut self) -> &mut PciDeviceStructureHeader; // Provided methods fn as_standard_device(&self) -> Option<&PciDeviceStructureGeneralDevice> { ... } fn as_pci_to_pci_bridge_device( &self, ) -> Option<&PciDeviceStructurePciToPciBridge> { ... } fn as_pci_to_carbus_bridge_device( &self, ) -> Option<&PciDeviceStructurePciToCardbusBridge> { ... } fn as_standard_device_mut( &mut self, ) -> Option<&mut PciDeviceStructureGeneralDevice> { ... } fn as_pci_to_pci_bridge_device_mut( &mut self, ) -> Option<&mut PciDeviceStructurePciToPciBridge> { ... } fn as_pci_to_carbus_bridge_device_mut( &mut self, ) -> Option<&mut PciDeviceStructurePciToCardbusBridge> { ... } fn capabilities(&self) -> Option<CapabilityIterator> { ... } fn status_command(&self) -> (Status, Command) { ... } fn set_command(&mut self, command: Command) { ... } fn bar_init(&mut self) -> Option<Result<u8, PciError>> { ... } fn msix_init(&mut self) -> Option<Result<u8, PciError>> { ... } fn enable_master(&mut self) { ... }
}
Expand description

This trait is implemented by PciDeviceStructureGeneralDevice,PciDeviceStructurePcitoPciBridge,PciDeviceStructurePcitoCardbusBridge

Required Methods§

Source

fn header_type(&self) -> HeaderType

Get the type of the device structure.

Source

fn common_header(&self) -> &PciDeviceStructureHeader

Return a immutable reference to the common header.

Source

fn common_header_mut(&mut self) -> &mut PciDeviceStructureHeader

Returns the mutable reference to the common header.

Provided Methods§

Source

fn as_standard_device(&self) -> Option<&PciDeviceStructureGeneralDevice>

This function returns a PciDeviceStructureGeneralDevice if the device structure is a standard device, and None otherwise.

Source

fn as_pci_to_pci_bridge_device( &self, ) -> Option<&PciDeviceStructurePciToPciBridge>

This function returns a PciDeviceStructurePciToPciBridge if the device structure is a pci to pci bridge, and None otherwise.

Source

fn as_pci_to_carbus_bridge_device( &self, ) -> Option<&PciDeviceStructurePciToCardbusBridge>

This function returns a PciDeviceStructurePciToCardbusBridge if the device structure is a pci to cardbus bridge, and None otherwise.

Source

fn as_standard_device_mut( &mut self, ) -> Option<&mut PciDeviceStructureGeneralDevice>

Return a mutable reference to the PciDeviceStructureGeneralDevice if the device structure is a standard device, and None otherwise.

Source

fn as_pci_to_pci_bridge_device_mut( &mut self, ) -> Option<&mut PciDeviceStructurePciToPciBridge>

Return a mutable reference to the PciDeviceStructurePciToPciBridge if the device structure is a pci to pci bridge, and None otherwise.

Source

fn as_pci_to_carbus_bridge_device_mut( &mut self, ) -> Option<&mut PciDeviceStructurePciToCardbusBridge>

Return a mutable reference to the PciDeviceStructurePciToCardbusBridge if the device structure is a pci to cardbus bridge, and None otherwise.

Source

fn capabilities(&self) -> Option<CapabilityIterator>

Returns the iterator of the Capabilities.

Source

fn status_command(&self) -> (Status, Command)

Gets the values of the Status and Command registers.

Source

fn set_command(&mut self, command: Command)

Set the value of the Command register.

Source

fn bar_init(&mut self) -> Option<Result<u8, PciError>>

@brief 读取standard设备的bar寄存器,映射后将结果加入结构体的standard_device_bar变量 @return 只有standard设备才返回成功或者错误,其余返回None

Source

fn msix_init(&mut self) -> Option<Result<u8, PciError>>

todo

Source

fn enable_master(&mut self)

Implementors§