Indeed, that was the problem:
Wrong code in at91_eth_deliver():
if (tsr&AT91_EMAC_TSR_COMP) //5
{
at91_reset_tbd(priv);
_eth_drv_tx_done(sc,priv->curr_tx_key,0);
priv->tx_busy = false;
}
Correct code:
{
at91_reset_tbd(priv, b_reset_tbd_idx);
priv->tx_busy = false;
_eth_drv_tx_done(sc,priv->curr_tx_key,0);
}
If the low-level driver is available (can_send() returns not zero) then
the first packet is sent.
If the low-level driver is not available it stops here. It is supposed
that the low-level driver will inform then the middleware when it is ready
by calling tx_done.
eth_drv_tx_done on its turn calls eth_drv_send() which then checks again
can_send()
The AT91 driver first called tx_done, calling send calling can_send which
returns 0 of course.
And afterwards - too late - busy is set to true, so that can_send can
return 1...