arch/sim/sim_cansock.c: drain all pending TX frames per txavail

Loop devif_poll() until it reports nothing more
to send, matching the batch-drain behaviour of the upper-half CAN
drivers, so a transfer completes on one notification.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz 2026-06-08 15:10:29 +02:00 • committed by Xiang Xiao
parent 1f17f72e3d
commit 501bf8634d

View file

@ -137,7 +137,11 @@ static int sim_can_txavail(struct net_driver_s *dev)
netdev_lock(dev);
if (IFF_IS_UP(priv->dev.d_flags))
{
devif_poll(&priv->dev, sim_can_txpoll);
/* Drain all pending TX frames */
while (devif_poll(&priv->dev, sim_can_txpoll) > 0)
{
}
}
netdev_unlock(dev);