[][src]Struct sunrise_ahci::pci::PciDevice

struct PciDevice {
    bus: u8,
    slot: u8,
    function: u8,
    did: u16,
    vid: u16,
    class: u8,
    subclass: u8,
    prog_if: u8,
    rev_id: u8,
    header_type: u8,
    latency_timer: u8,
    cache_line_size: u8,
    header: PciHeader,
}

A pci device, addressed by its bus number, slot, and function.

Fields

bus: u8

The device's bus number.

slot: u8

The device's slot number on its bus.

function: u8

The device's function number.

did: u16

Device id.

vid: u16

Vendor id.

class: u8subclass: u8prog_if: u8rev_id: u8header_type: u8latency_timer: u8cache_line_size: u8header: PciHeader

Remaining registers values, based on header type.

Implementations

impl PciDevice[src]

fn probe(bus: u8, slot: u8, function: u8) -> Option<Self>[src]

Checks if a device exists on given bus>slot>function.

This is done by reading the Device ID - Vendor ID register (register 0). If 0xFFFF_FFFF is read back, this means that the device was non-existent, and we return None.

fn read_config_register(&self, register: u8) -> u32[src]

Reads a configuration space register.

fn write_config_register(&self, register: u8, value: u32)[src]

Writes to a configuration space register.

fn status(&self) -> u16[src]

Reads the status register.

fn command(&self) -> u16[src]

Reads the command register.

Trait Implementations

impl Clone for PciDevice[src]

impl Copy for PciDevice[src]

impl Debug for PciDevice[src]

Auto Trait Implementations

impl RefUnwindSafe for PciDevice

impl Send for PciDevice

impl Sync for PciDevice

impl Unpin for PciDevice

impl UnwindSafe for PciDevice

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.