pub struct PciDevice { /* private fields */ }
Expand description
A struct representing the data of a PCI device as discovered through
the OS APIs by the enumerator in use. An enumerator is not required
to fill all the fields of a PciDevice
object. As such most members
are optional and only the vendor_id()
and device_id()
are
required to be valid. Check the documentation of the enumerator in
use to see what values are expected to be filled.
Implementations§
Source§impl PciDevice
impl PciDevice
pub fn from_pci_header_set( header: PciCommonHeader, specialized: Option<PciSpecializedHeader>, ) -> Self
Sourcepub fn vendor_id(&self) -> u16
pub fn vendor_id(&self) -> u16
Returns the id of the vendor of this device. The vendor is usually the provider of the chipset or technology upon which the device is based.
For example, the 3D Blaster Banshee is a graphic card from Diamond
Multimedia based on 3dfx Banshee chipset.
The subsystem_vendor_id
for that card is the one for Diamond Multimedia,
while vendor_id
is the one for 3dfx, the provider of the graphic chipset.
Sourcepub fn location(&self) -> Result<PciLocation, &PciInfoPropertyError>
pub fn location(&self) -> Result<PciLocation, &PciInfoPropertyError>
Returs an optional PciLocation
object that contains the location of
the device on the PCI bus (in terms of bus, device and function)
Sourcepub fn subsystem_vendor_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>
pub fn subsystem_vendor_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>
Returns the vendor id of the manufacturer of this device. The vendor is usually the provider of the actual card/device.
For example, the 3D Blaster Banshee is a graphic card from Diamond
Multimedia based on 3dfx Banshee chipset.
The subsystem_vendor_id
for that card is the one for Diamond Multimedia,
while vendor_id
is the one for 3dfx, the provider of the graphic chipset.
Sourcepub fn subsystem_device_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>
pub fn subsystem_device_id(&self) -> Result<Option<u16>, &PciInfoPropertyError>
Returns the subsystem_device_id
. See the documentation for
subsystem_vendor_id
for the difference between normal ids and
subsystem ids.
Sourcepub fn revision(&self) -> Result<u8, &PciInfoPropertyError>
pub fn revision(&self) -> Result<u8, &PciInfoPropertyError>
Returns the revision of the device.
Sourcepub fn device_class_code(&self) -> Result<u8, &PciInfoPropertyError>
pub fn device_class_code(&self) -> Result<u8, &PciInfoPropertyError>
Returns the code of the PCI device class.
Use device_class
if an intelligible enumeration
is preferred.
Sourcepub fn device_subclass_code(&self) -> Result<u8, &PciInfoPropertyError>
pub fn device_subclass_code(&self) -> Result<u8, &PciInfoPropertyError>
Returns the code of the PCI device subclass.
Use device_subclass
if an intelligible enumeration
is preferred.
Sourcepub fn device_iface_code(&self) -> Result<u8, &PciInfoPropertyError>
pub fn device_iface_code(&self) -> Result<u8, &PciInfoPropertyError>
Returns the code of the PCI interface function.
Use device_iface
if an intelligible enumeration
is preferred.
Sourcepub fn device_class(&self) -> Result<PciDeviceClass, &PciInfoPropertyError>
pub fn device_class(&self) -> Result<PciDeviceClass, &PciInfoPropertyError>
Returns the PCI device class of this device.
Sourcepub fn device_subclass(
&self,
) -> Result<PciDeviceSubclass, &PciInfoPropertyError>
pub fn device_subclass( &self, ) -> Result<PciDeviceSubclass, &PciInfoPropertyError>
Returns the PCI device subclass of this device.
Sourcepub fn device_iface(
&self,
) -> Result<PciDeviceInterfaceFunc, &PciInfoPropertyError>
pub fn device_iface( &self, ) -> Result<PciDeviceInterfaceFunc, &PciInfoPropertyError>
Returns the PCI interface function of this device.
Sourcepub fn os_irq(&self) -> Result<Option<u8>, &PciInfoPropertyError>
pub fn os_irq(&self) -> Result<Option<u8>, &PciInfoPropertyError>
Returns the IRQ that the OS has associated to the device.
Sourcepub fn os_driver(&self) -> Result<&Option<String>, &PciInfoPropertyError>
pub fn os_driver(&self) -> Result<&Option<String>, &PciInfoPropertyError>
Returns the name of the driver that handles the device in the OS.