libboard_zynq/eth: fixed tx lost packet

This commit is contained in:
pca006132 2020-08-24 15:51:01 +08:00
parent 39f672dde8
commit 671968bac3
1 changed files with 3 additions and 8 deletions

View File

@ -132,11 +132,9 @@ 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
// start tcp transfer
self.regs.net_ctrl.modify(|_, w| w.start_tx(true));
}
}
}
impl<'a> Deref for PktRef<'a> {
@ -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())
}
}
}