From 671968bac32ad4e98b1cbd6a117f41461cd44971 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Mon, 24 Aug 2020 15:51:01 +0800 Subject: [PATCH] libboard_zynq/eth: fixed tx lost packet --- libboard_zynq/src/eth/tx.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libboard_zynq/src/eth/tx.rs b/libboard_zynq/src/eth/tx.rs index a5b215c..8114751 100644 --- a/libboard_zynq/src/eth/tx.rs +++ b/libboard_zynq/src/eth/tx.rs @@ -132,10 +132,8 @@ impl<'a> Drop for PktRef<'a> { dcc_slice(self.buffer); self.entry.word1.modify(|_, w| w.used(false)); - if ! self.regs.tx_status.read().tx_go() { - // Start TX if not already running - self.regs.net_ctrl.modify(|_, w| w.start_tx(true)); - } + // start tcp transfer + self.regs.net_ctrl.modify(|_, w| w.start_tx(true)); } } @@ -166,10 +164,7 @@ impl<'a> smoltcp::phy::TxToken for Token<'a> { None => Err(smoltcp::Error::Exhausted), Some(mut pktref) => { - let result = f(pktref.deref_mut()); - // TODO: on result.is_err() don;t send - drop(pktref); - result + f(pktref.deref_mut()) } } }