mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
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:
parent
1f17f72e3d
commit
501bf8634d
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue