eth-igb

Crates.ioeth-igb
lib.rseth-igb
version0.1.1
created_at2025-07-18 08:03:26.463057+00
updated_at2025-07-18 08:09:06.589802+00
descriptionIntel IGB Ethernet driver
homepage
repositoryhttps://github.com/drivercraft/ethernet-intel
max_upload_size
id1758720
size162,116
周睿 (ZR233)

documentation

README

Intel IGB Ethernet Driver

A Rust-based Intel IGB Ethernet driver supporting 82576 series network controllers.

Features

  • Hardware Support: Supports Intel 82576 series Ethernet controllers
  • Ring Buffers: Efficient transmit and receive ring buffer implementation
  • Zero-Copy: DMA-based zero-copy data transfer

Supported Devices

  • Vendor ID: 0x8086 (Intel)
  • Device ID:
    • 0x10C9 (82576 Gigabit Network Connection)
    • 0x1533 (I210 Gigabit Network Connection)

Usage Examples

Basic Initialization

First impl dma-api

use eth_igb::{Igb, Request};

struct KernelImpl;

eth_igb::impl_trait! {
    impl Kernel for KernelImpl {
        fn sleep(duration: Duration) {
            your_os::spin_delay(duration);
        }
    }
}


// Create driver instance
let mut igb = Igb::new(iobase)?;

// Open device
igb.open()?;

// Create transmit and receive rings
let (tx_ring, rx_ring) = igb.new_ring()?;

Sending Packets

// Prepare transmission data
let data = vec![0u8; 1500];
let request = Request::new_tx(data);

// Send packet
tx_ring.send(request)?;

Receiving Packets

// Prepare receive buffer
let buff = vec![0u8; rx_ring.packet_size()];
let request = Request::new_rx(buff);
rx_ring.submit(request)?;

// Receive packet
if let Some(packet) = rx_ring.next_pkt() {
    println!("Received packet: {} bytes", packet.len());
}

Testing

The project includes a comprehensive test suite:

# Run all tests
cargo test --test test -- tests --show-output

# Testing with U-Boot development board
cargo test --test test -- tests --show-output --uboot

References

License

This project is licensed under an appropriate open source license. Please see the LICENSE file for details.

Commit count: 0

cargo fmt