pub struct E1000Nic { /* private fields */ }Expand description
E1000 NIC structure with DMA-safe rings
Implementations§
Source§impl E1000Nic
impl E1000Nic
Sourcepub fn init(mmio_base: u64, alloc: &dyn DmaAllocator) -> Result<Self, NetError>
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.
Sourcepub fn mac_address(&self) -> [u8; 6]
pub fn mac_address(&self) -> [u8; 6]
Performs the mac address operation.
Sourcepub fn check_link(&mut self) -> bool
pub fn check_link(&mut self) -> bool
Check and update link status
Sourcepub fn receive(&mut self, buf: &mut [u8]) -> Result<usize, NetError>
pub fn receive(&mut self, buf: &mut [u8]) -> Result<usize, NetError>
Performs the receive operation.
Sourcepub fn transmit(
&mut self,
buf: &[u8],
alloc: &dyn DmaAllocator,
) -> Result<(), NetError>
pub fn transmit( &mut self, buf: &[u8], alloc: &dyn DmaAllocator, ) -> Result<(), NetError>
Performs the transmit operation.
Sourcepub fn is_transmit_complete(&self) -> bool
pub fn is_transmit_complete(&self) -> bool
Check if last transmission is complete (non-blocking)
Sourcepub fn wait_for_transmit(&self)
pub fn wait_for_transmit(&self)
Wait for transmission to complete (blocking)
Sourcepub fn handle_interrupt(&self)
pub fn handle_interrupt(&self)
Handles interrupt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for E1000Nic
impl RefUnwindSafe for E1000Nic
impl !Sync for E1000Nic
impl Unpin for E1000Nic
impl UnsafeUnpin for E1000Nic
impl UnwindSafe for E1000Nic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more