Skip to content

Commit

Permalink
rpmsg: notify the user when the remote address is received
Browse files Browse the repository at this point in the history
without this notificaiton, user has to call is_rpmsg_ept_ready in a busy loop

Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 committed May 9, 2022
1 parent 8c93bff commit 0c70377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/include/openamp/rpmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ typedef void (*rpmsg_ns_bind_cb)(struct rpmsg_device *rdev,
* @dest_addr: address of the default remote endpoint binded.
* @cb: user rx callback, return value of this callback is reserved
* for future use, for now, only allow RPMSG_SUCCESS as return value.
* @ns_bind_cb: end point service bind callback, called when remote
* ept address is received.
* @ns_unbind_cb: end point service unbind callback, called when remote
* ept is destroyed.
* @node: end point node.
Expand All @@ -75,6 +77,7 @@ struct rpmsg_endpoint {
uint32_t addr;
uint32_t dest_addr;
rpmsg_ept_cb cb;
rpmsg_ns_unbind_cb ns_bind_cb;
rpmsg_ns_unbind_cb ns_unbind_cb;
struct metal_list node;
void *priv;
Expand Down
3 changes: 3 additions & 0 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
} else {
_ept->dest_addr = dest;
metal_mutex_release(&rdev->lock);
/* notify application the endpoint has been bound */
if (_ept->ns_bind_cb)
_ept->ns_bind_cb(_ept);
}
}

Expand Down

0 comments on commit 0c70377

Please sign in to comment.