pci-info 0.3.1

A crate to enumerate PCI devices on desktop operating systems and/or parse PCI configuration headers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(target_os = "freebsd")]
mod pcidev;

use crate::{PciEnumerator, PciInfo, PciInfoError};

/// A PCI Enumerator for FreeBSD that uses `ioctl(..., PCIOCGETCONF, ...)`
/// operations over `/dev/pci` to extract partial PCI information
pub struct FreeBsdDevPciEnumerator;

impl PciEnumerator for FreeBsdDevPciEnumerator {
    fn enumerate_pci(self) -> Result<PciInfo, PciInfoError> {
        unsafe { pcidev::enumerate_devices() }
    }
}

test_enumerator!(FreeBsdDevPciEnumerator, FreeBsdDevPciEnumerator);