Skip to main content

Rtl8139Device

Struct Rtl8139Device 

Source
pub struct Rtl8139Device {
    ports: Mutex<Ports>,
    rx_buffer: *mut u8,
    rx_phys: u64,
    rx_offset: AtomicUsize,
    tx_buffers: [*mut u8; 4],
    tx_phys: [u64; 4],
    tx_id: AtomicUsize,
    mac: [u8; 6],
    name: String,
}

Fields§

§ports: Mutex<Ports>§rx_buffer: *mut u8§rx_phys: u64§rx_offset: AtomicUsize§tx_buffers: [*mut u8; 4]§tx_phys: [u64; 4]§tx_id: AtomicUsize§mac: [u8; 6]§name: String

Implementations§

Source§

impl Rtl8139Device

Source

pub unsafe fn new(pci_dev: PciDevice) -> Result<Self, &'static str>

Creates a new instance.

Source

fn init(&mut self)

Performs the init operation.

Source

fn receive_packet(&self) -> Option<Vec<u8>>

Performs the receive packet operation.

Source

fn transmit_packet(&self, data: &[u8]) -> Result<(), NetError>

Performs the transmit packet operation.

Source

fn receive_inner(&self) -> Option<Vec<u8>>

Performs the receive inner operation.

Source

fn transmit_inner(&self, data: &[u8]) -> Result<(), NetError>

Performs the transmit inner operation.

Trait Implementations§

Source§

impl NetworkDevice for Rtl8139Device

Source§

fn name(&self) -> &str

Performs the name operation.

Source§

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

Performs the mac address operation.

Performs the link up operation.

Source§

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

Performs the receive operation.

Source§

fn transmit(&self, data: &[u8]) -> Result<(), NetError>

Performs the transmit operation.

Source§

fn handle_interrupt(&self)

Source§

fn poll(&self)

Periodic housekeeping called from the timer path (or interrupt context). Default is a no-op; drivers that need a watchdog or buffer-reclamation cycle override this.
Source§

impl Send for Rtl8139Device

Source§

impl Sync for Rtl8139Device

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.