pci_types::capability

Struct MsiCapability

Source
pub struct MsiCapability { /* private fields */ }

Implementations§

Source§

impl MsiCapability

Source

pub fn has_per_vector_masking(&self) -> bool

Does device supports masking individual vectors?

Source

pub fn is_64bit(&self) -> bool

Is device using 64-bit addressing?

Source

pub fn multiple_message_capable(&self) -> MultipleMessageSupport

How many interrupts this device has?

Source

pub fn ctrl(&self, access: impl ConfigRegionAccess) -> u32

Source

pub fn is_enabled(&self, access: impl ConfigRegionAccess) -> bool

Is MSI capability enabled?

Source

pub fn set_enabled(&self, enabled: bool, access: impl ConfigRegionAccess)

Enable or disable MSI capability

Source

pub fn set_multiple_message_enable( &self, data: MultipleMessageSupport, access: impl ConfigRegionAccess, )

Set how many interrupts the device will use. If requested count is bigger than supported count, the second will be used.

Source

pub fn multiple_message_enable( &self, access: impl ConfigRegionAccess, ) -> MultipleMessageSupport

Return how many interrupts the device is using

Source

pub fn set_message_info( &self, address: u64, data: u32, access: impl ConfigRegionAccess, )

Set the memory address that will be written to when the interrupt fires, and the data that will be written to it.

Source

pub fn set_message_info_lapic( &self, address: u64, vector: u8, trigger_mode: TriggerMode, access: impl ConfigRegionAccess, )

Set the memory address that will be written to when the interrupt fires, and the data that will be written to it, specialised for the message format the LAPIC expects.

§Arguments
  • address - Target Local APIC address (if not changed, can be calculated with 0xfee00000 | (processor << 12))
  • vector - Which interrupt vector should be triggered on LAPIC
  • trigger_mode - When interrupt should be triggered
  • access - PCI Configuration Space accessor
Source

pub fn message_mask(&self, access: impl ConfigRegionAccess) -> u32

Get interrupt mask

§Note

Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise returns 0

Source

pub fn set_message_mask(&self, mask: u32, access: impl ConfigRegionAccess)

Set interrupt mask

§Note

Only supported on when device supports 64-bit addressing and per-vector masking. Otherwise will do nothing

Source

pub fn is_pending(&self, access: impl ConfigRegionAccess) -> u32

Get pending interrupts

§Note

Only supported on when device supports 64-bit addressing. Otherwise will return 0

Trait Implementations§

Source§

impl Clone for MsiCapability

Source§

fn clone(&self) -> MsiCapability

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MsiCapability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for MsiCapability

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.