forked from M-Labs/zynq-rs
libboard_zynq/eth: fixed tx lost packet
This commit is contained in:
parent
39f672dde8
commit
671968bac3
@ -132,10 +132,8 @@ 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user