Skip to main content

E1000Nic

Struct E1000Nic 

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

E1000 NIC structure with DMA-safe rings

Implementations§

Source§

impl E1000Nic

Source

pub fn init(mmio_base: u64, alloc: &dyn DmaAllocator) -> Result<Self, NetError>

Initialise the E1000 hardware.

mmio_base is the virtual address of the mapped BAR0 region. The caller must ensure the MMIO region (>=128 KiB) is identity-mapped.

Source

pub fn mac_address(&self) -> [u8; 6]

Performs the mac address operation.

Performs the link up operation.

Check and update link status

Source

pub fn receive(&mut self, buf: &mut [u8]) -> Result<usize, NetError>

Performs the receive operation.

Source

pub fn transmit( &mut self, buf: &[u8], alloc: &dyn DmaAllocator, ) -> Result<(), NetError>

Performs the transmit operation.

Source

pub fn is_transmit_complete(&self) -> bool

Check if last transmission is complete (non-blocking)

Source

pub fn wait_for_transmit(&self)

Wait for transmission to complete (blocking)

Source

pub fn handle_interrupt(&self)

Handles interrupt.

Trait Implementations§

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, 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.