diff --git a/drivers/virtio/virtio-mmio-net.c b/drivers/virtio/virtio-mmio-net.c index 4433a596ec..7e5ac7713c 100644 --- a/drivers/virtio/virtio-mmio-net.c +++ b/drivers/virtio/virtio-mmio-net.c @@ -435,11 +435,9 @@ static int virtnet_txpoll(FAR struct net_driver_s *dev) virtnet_reply(priv); - /* If zero is returned, the polling will continue until all connections - * have been examined. - */ + /* Stop the poll now because we only have one tx buffer (g_pktbuf) */ - return 0; + return -EBUSY; } /**************************************************************************** @@ -591,6 +589,7 @@ static void virtnet_rxdispatch(FAR struct virtnet_driver_s *priv) static void virtnet_receive(FAR struct virtnet_driver_s *priv) { + FAR uint8_t *buf = priv->vnet_dev.d_buf; uint16_t used = priv->rxq->used->idx; uint16_t idx; @@ -632,6 +631,8 @@ static void virtnet_receive(FAR struct virtnet_driver_s *priv) priv->rxq->last_used_idx = used; vrtinfo("+++ rxq->last_used_idx=%d\n", priv->rxq->last_used_idx); + + priv->vnet_dev.d_buf = buf; } /****************************************************************************