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); dcc_slice(self.buffer);
self.entry.word1.modify(|_, w| w.used(false)); self.entry.word1.modify(|_, w| w.used(false));
if ! self.regs.tx_status.read().tx_go() { // start tcp transfer
// Start TX if not already running
self.regs.net_ctrl.modify(|_, w| w.start_tx(true)); self.regs.net_ctrl.modify(|_, w| w.start_tx(true));
} }
}
} }
impl<'a> Deref for PktRef<'a> { impl<'a> Deref for PktRef<'a> {
@ -166,10 +164,7 @@ impl<'a> smoltcp::phy::TxToken for Token<'a> {
None => None =>
Err(smoltcp::Error::Exhausted), Err(smoltcp::Error::Exhausted),
Some(mut pktref) => { Some(mut pktref) => {
let result = f(pktref.deref_mut()); f(pktref.deref_mut())
// TODO: on result.is_err() don;t send
drop(pktref);
result
} }
} }
} }