Q <email@example.com> wrote:
You need to reg_tx_done() before tx_down().
Is it [callback to tx_done()] necessary to know
about tx_down() errors ?
/ tx_down() return codes:
#define TX_DOWN_AGAIN 1
#define TX_DOWN_OK 0
#define TX_DOWN_FAILED -1
Can I free tx buffer immediately after tx_down()?
/ or I have to wait for [registered] tx_done() ?
You have to wait. After tx_down() you packet is pass down to the module
below to you (the eth driver), and the driver will try to put packet
on the wire. Only when the hardware tells the driver the packet is sent,
then the driver will try to free the packet (by calling
io-net->tx_done(), which will in turn call your filter->tx_done()
function to let you free the packet, if you have reg_tx_done() it)
One thing (since you are writing a filter), you can only free the
packet that is allocate by yourself. If you only changed the packet
contents but haven’t add any net_buf into a packet. You don’t need
to reg_tx_done() and you don’t need to touch the packet when it