From 378755a0cebbbf2eae0abe15bc1f5a27722a7e0f Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 29 Sep 2019 01:39:57 +0200 Subject: [PATCH] main: bump RX_LEN/TX_LEN to 2 --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a204a4d..783af93 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,10 +92,12 @@ fn main() { println!("Eth on"); eth.reset_phy(); - const RX_LEN: usize = 1; + const RX_LEN: usize = 2; let mut rx_descs: [eth::rx::DescEntry; RX_LEN] = unsafe { uninitialized() }; let mut rx_buffers = [[0u8; eth::MTU]; RX_LEN]; - const TX_LEN: usize = 1; + // Number of transmission buffers (minimum is two because with + // one, duplicate packet transmission occurs) + const TX_LEN: usize = 2; let mut tx_descs: [eth::tx::DescEntry; TX_LEN] = unsafe { uninitialized() }; let mut tx_buffers = [[0u8; eth::MTU]; TX_LEN]; let eth = eth.start_rx(&mut rx_descs, &mut rx_buffers);