Struct LcBarRequest

Source
pub struct LcBarRequest {
    pub bar: LcBar,
    pub tag: u8,
    pub be_first: u8,
    pub be_last: u8,
    pub is_64bit: bool,
    pub is_read: bool,
    pub is_write: bool,
    pub data_size: u32,
    pub data_offset: u64,
    pub data_write: Option<Vec<u8>>,
    /* private fields */
}
Expand description

PCIe BAR request struct.

§Created By

  • LeechCore PCIe BAR callback.

Fields§

§bar: LcBar

The PCIe BAR which this request is for.

§tag: u8

PCIe TLP packet tag.

§be_first: u8

first byte-enable.

§be_last: u8

last byte-enable.

§is_64bit: bool

is a 64-bit request.

§is_read: bool

is a read request.

§is_write: bool

is a write request.

§data_size: u32

data size in bytes.

§data_offset: u64

data byte offset within the BAR.

§data_write: Option<Vec<u8>>

data to write (if a write request).

Implementations§

Source§

impl LcBarRequest

Source

pub fn read_reply(&self, data_reply: &[u8]) -> ResultEx<()>

Send a valid read reply to the BAR request.

The read reply must be of the exact length of the BAR read request.

§Arguments
  • data_reply - The data to send as a reply.
Source

pub fn read_reply_fail(&self) -> ResultEx<()>

Send an invalid read reply to the BAR request indicating that the read failed. An Unsupported Request TLP will be sent to the host system in reponse to the failed read.

This function should normally not be called.

Trait Implementations§

Source§

impl Debug for LcBarRequest

Source§

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

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

impl Display for LcBarRequest

Source§

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

Formats the value using the given formatter. Read more

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.