Skip to content

rpmsg_ns_bind_cb context? #273

Answered by arnopo
infn-ke asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @infn-ke

It seems more a question than an issue. i convert it to discussions
Please, next time, open a discussion instead of an issue, for questions.

To retrieve your context you could implement something like the following.

struct my_ctx_struct {
	struct rpmsg_virtio_device rpmsg_vdev;
};

then in you init code

struct my_ctx_struct *my_ctx;

my_ctx = metal_allocate_memory(sizeof( *my_ctx));
rpmsg_init_vdev (my_ctx->rpmsg_vdev, ...);

In your rpmsg_ns_bind_cb callback

 struct my_ctx_struct *my_ctx;
 my_ctx  =    metal_container_of(rpmsg_vdev, struct my_ctx_struct, rpmsg_vdev); 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arnopo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #272 on March 10, 2021 14:45.