Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/include/openamp/rpmsg_virtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ __deprecated static inline int deprecated_rpmsg_slave(void)
return RPMSG_REMOTE;
}

/**
* @brief Set the virtio callback to manage the wait for TX buffer availability.
*
* @param rvdev Pointer to rpmsg virtio device.
* @param notify_wait_cb Callback handler to wait buffer notification.
*
* @return RPMSG_REMOTE or RPMSG_HOST
*/
static inline void rpmsg_virtio_set_wait_cb(struct rpmsg_virtio_device *rvdev,
rpmsg_virtio_notify_wait_cb notify_wait_cb)
{
rvdev->notify_wait_cb = notify_wait_cb;
}

/**
* @brief Get rpmsg virtio device role.
*
Expand Down
1 change: 1 addition & 0 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ int rpmsg_init_vdev_with_config(struct rpmsg_virtio_device *rvdev,
return RPMSG_ERR_PARAM;

rdev = &rvdev->rdev;
rvdev->notify_wait_cb = NULL;
memset(rdev, 0, sizeof(*rdev));
metal_mutex_init(&rdev->lock);
rvdev->vdev = vdev;
Expand Down