diff --git a/arch/sim/src/sim/up_netdriver.c b/arch/sim/src/sim/up_netdriver.c index 7697ce9579..93c294d5d1 100644 --- a/arch/sim/src/sim/up_netdriver.c +++ b/arch/sim/src/sim/up_netdriver.c @@ -72,6 +72,12 @@ #include "up_internal.h" +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void netdriver_txdone_interrupt(void *priv); + /**************************************************************************** * Private Data ****************************************************************************/ @@ -290,6 +296,17 @@ static int netdriver_txpoll(struct net_driver_s *dev) netdev_send(devidx, dev->d_buf, dev->d_len); NETDEV_TXDONE(dev); } + else + { + /* Calling txdone callback after loopback. NETDEV_TXDONE macro is + * already called in devif_loopback. + * + * TODO: Maybe a unified interface with txdone callback registered + * is needed, then we can let devif_loopback call this callback. + */ + + netdriver_txdone_interrupt(dev); + } } /* If zero is returned, the polling will continue until all connections