mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-02-05 18:51:28 +08:00
rpmsg: Allow private endpoint data to be set in rpmsg_register_endpoint
There is a private data member in the endpoint struct that is passed into the callback, but there is no way to populate it. Add this to the endpoint register function. Signed-off-by: Andrew Davis <afd@ti.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
a5d7f13538
commit
9905d67bd9
@@ -303,7 +303,7 @@ void rpmsg_register_endpoint(struct rpmsg_device *rdev,
|
||||
const char *name,
|
||||
uint32_t src, uint32_t dest,
|
||||
rpmsg_ept_cb cb,
|
||||
rpmsg_ns_unbind_cb ns_unbind_cb)
|
||||
rpmsg_ns_unbind_cb ns_unbind_cb, void *priv)
|
||||
{
|
||||
strncpy(ept->name, name ? name : "", sizeof(ept->name));
|
||||
ept->refcnt = 1;
|
||||
@@ -311,6 +311,7 @@ void rpmsg_register_endpoint(struct rpmsg_device *rdev,
|
||||
ept->dest_addr = dest;
|
||||
ept->cb = cb;
|
||||
ept->ns_unbind_cb = ns_unbind_cb;
|
||||
ept->priv = priv;
|
||||
ept->rdev = rdev;
|
||||
metal_list_add_tail(&rdev->endpoints, &ept->node);
|
||||
}
|
||||
@@ -353,7 +354,7 @@ int rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,
|
||||
*/
|
||||
}
|
||||
|
||||
rpmsg_register_endpoint(rdev, ept, name, addr, dest, cb, unbind_cb);
|
||||
rpmsg_register_endpoint(rdev, ept, name, addr, dest, cb, unbind_cb, NULL);
|
||||
metal_mutex_release(&rdev->lock);
|
||||
|
||||
/* Send NS announcement to remote processor */
|
||||
|
||||
@@ -103,7 +103,7 @@ void rpmsg_register_endpoint(struct rpmsg_device *rdev,
|
||||
const char *name,
|
||||
uint32_t src, uint32_t dest,
|
||||
rpmsg_ept_cb cb,
|
||||
rpmsg_ns_unbind_cb ns_unbind_cb);
|
||||
rpmsg_ns_unbind_cb ns_unbind_cb, void *priv);
|
||||
|
||||
static inline struct rpmsg_endpoint *
|
||||
rpmsg_get_ept_from_addr(struct rpmsg_device *rdev, uint32_t addr)
|
||||
|
||||
@@ -991,7 +991,7 @@ int rpmsg_init_vdev_with_config(struct rpmsg_virtio_device *rvdev,
|
||||
if (rdev->support_ns) {
|
||||
rpmsg_register_endpoint(rdev, &rdev->ns_ept, "NS",
|
||||
RPMSG_NS_EPT_ADDR, RPMSG_NS_EPT_ADDR,
|
||||
rpmsg_virtio_ns_callback, NULL);
|
||||
rpmsg_virtio_ns_callback, NULL, NULL);
|
||||
}
|
||||
|
||||
#ifndef VIRTIO_DEVICE_ONLY
|
||||
|
||||
Reference in New Issue
Block a user