⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

PciBus

Struct PciBus 

Source
pub struct PciBus { /* private fields */ }
Expand description

PCI bus implementation

Implementations§

Source§

impl PciBus

Source

pub fn new() -> Self

Create a new PCI bus

Source

pub fn enumerate_devices(&self) -> Result<(), KernelError>

Enumerate all PCI devices

Source

pub fn get_device(&self, location: PciLocation) -> Option<PciDevice>

Get device by location

Source

pub fn get_all_devices(&self) -> Vec<PciDevice>

Get all devices

Source

pub fn find_devices_by_class(&self, class_code: u8) -> Vec<PciDevice>

Find devices by class

Source

pub fn find_devices_by_id( &self, vendor_id: u16, device_id: u16, ) -> Vec<PciDevice>

Find devices by vendor and device ID

Trait Implementations§

Source§

impl Bus for PciBus

Source§

fn name(&self) -> &str

Get bus name
Source§

fn scan(&mut self) -> Vec<DeviceInfo>

Scan for devices
Source§

fn read_config( &self, device: &DeviceInfo, offset: u16, size: u8, ) -> Result<u32, KernelError>

Read configuration space
Source§

fn write_config( &mut self, device: &DeviceInfo, offset: u16, value: u32, size: u8, ) -> Result<(), KernelError>

Write configuration space
Source§

fn enable_device(&mut self, device: &DeviceInfo) -> Result<(), KernelError>

Enable device
Source§

fn disable_device(&mut self, device: &DeviceInfo) -> Result<(), KernelError>

Disable device
Source§

impl Default for PciBus

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for PciBus

§

impl !RefUnwindSafe for PciBus

§

impl Send for PciBus

§

impl Sync for PciBus

§

impl Unpin for PciBus

§

impl UnwindSafe for PciBus

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.