MCPcopy Create free account
hub / github.com/apache/nuttx / rpmsg_virtio_start

Function rpmsg_virtio_start

drivers/rpmsg/rpmsg_virtio.c:541–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539 ****************************************************************************/
540
541static int rpmsg_virtio_start(FAR struct rpmsg_virtio_priv_s *priv)
542{
543 FAR struct virtio_device *vdev = priv->vdev;
544 int ret;
545
546 ret = rpmsg_init_vdev(&priv->rvdev, vdev, rpmsg_ns_bind,
547 metal_io_get_region(), priv->pool);
548 if (ret < 0)
549 {
550 rpmsgerr("rpmsg_init_vdev failed, ret=%d\n", ret);
551 return ret;
552 }
553
554 priv->cbrx = priv->rvdev.rvq->callback;
555 priv->cbtx = priv->rvdev.svq->callback;
556 priv->notifytx = priv->rvdev.svq->notify;
557 priv->rvdev.rvq->callback = rpmsg_virtio_rx_callback;
558 priv->rvdev.svq->callback = rpmsg_virtio_tx_callback;
559 priv->rvdev.svq->notify = rpmsg_virtio_tx_notify;
560 priv->rvdev.notify_wait_cb = rpmsg_virtio_notify_wait;
561 priv->rvdev.rdev.ns_unbind_cb = rpmsg_ns_unbind;
562
563 /* Wake up the rx thread to process message */
564
565 rpmsg_virtio_wakeup_rx(priv);
566
567 /* Broadcast device_created to all registers */
568
569 rpmsg_device_created(&priv->rpmsg);
570
571 return ret;
572}
573
574/****************************************************************************
575 * Name: rpmsg_virtio_thread

Callers 1

rpmsg_virtio_threadFunction · 0.85

Calls 2

rpmsg_virtio_wakeup_rxFunction · 0.85
rpmsg_device_createdFunction · 0.85

Tested by

no test coverage detected