E1000Device

Struct E1000Device 

Source
pub struct E1000Device<'a, K: KernelFunc> { /* private fields */ }
Expand description

E1000Device 网卡驱动的主要结构体

Implementations§

Source§

impl<'a, K: KernelFunc> E1000Device<'a, K>

Source

pub fn new(kfn: K, mapped_regs: usize) -> Result<Self, i32>

New an e1000 device by Allocating memory

Source

pub fn e1000_init(&mut self)

Initialize e1000 driver
mapped_regs is the memory address at which the e1000’s registers are mapped.

Source

pub fn e1000_transmit(&mut self, packet: &[u8]) -> i32

Transmitting network packets

Source

pub fn e1000_recv(&mut self) -> Option<Vec<Vec<u8>>>

Receiving network packets

Source

pub fn e1000_irq_disable(&mut self)

Clear Interrupt

Source

pub fn e1000_irq_enable(&mut self)

Enable Interrupts

Source

pub fn e1000_write_flush(&mut self)

flush e1000 status

Source

pub fn e1000_cause_lsc_int(&mut self)

Cause a link status change interrupt

Source

pub fn e1000_intr(&mut self) -> u32

To handle e1000 interrupt

Auto Trait Implementations§

§

impl<'a, K> Freeze for E1000Device<'a, K>
where K: Freeze,

§

impl<'a, K> RefUnwindSafe for E1000Device<'a, K>
where K: RefUnwindSafe,

§

impl<'a, K> Send for E1000Device<'a, K>
where K: Send,

§

impl<'a, K> Sync for E1000Device<'a, K>
where K: Sync,

§

impl<'a, K> Unpin for E1000Device<'a, K>
where K: Unpin,

§

impl<'a, K> !UnwindSafe for E1000Device<'a, K>

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.