STRUCT RPMSG_ENDPOINT(9)
β¨ NAME β¨
ok so welcome to the Kernel API Manual bestie π this page is all about struct rpmsg_endpoint β and what it does is literally bind a local rpmsg address to its user. that's the whole vibe. π
πΈ SYNOPSIS πΈ
here's the struct in all its iconic glory, copy it exactly bestie, no typos:
struct rpmsg_endpoint {
struct rpmsg_device *rpdev;
struct kref refcount;
rpmsg_rx_cb_t cb;
rpmsg_flowcontrol_cb_t flow_cb;
struct mutex cb_lock;
u32 addr;
void *priv;
const struct rpmsg_endpoint_ops *ops;
};
π Members π
okay let's go through every single one, no skipping, we don't do that here:
rpdevβ the rpmsg channel device. the device bestie. π«Άrefcountβ when this drops to zero, the ept is deallocated. so likeβ¦ when the count hits 0, it's over, the endpoint is gone, bye. literally. πcbβ the rx callback handler. πflow_cbβ the remote flow control callback handler. πcb_lockβ a mutex that must be taken before accessing/changingcb. not optional, not a suggestion, take the lock fr fr πaddrβ local rpmsg address. πprivβ private data for the driver's use. that's the driver's own little stash, hands off. πopsβ the ops pointer,const struct rpmsg_endpoint_ops *. β¨
π¦ Description π¦
so in essence (love that word), an rpmsg endpoint represents a listener on the rpmsg bus, because it binds an rpmsg address with an rx callback handler. that's the whole point of it. it's literally giving "address + callback = besties". π
and here's the part that matters: simple rpmsg drivers shouldn't use this struct directly, because things just work. like, the kernel handles it. every rpmsg driver provides an rx callback upon registering to the bus, and that callback is then bound to its rpmsg address when the driver is probed. then when relevant inbound messages arrive β i.e. messages which their dst address equals to the src address of the rpmsg channel β the driver's handler is invoked to process it. so you never even have to think about it. slay. π
ngl, if you're a simple driver, do NOT touch this struct. it's already handled. stay in your lane (affectionately). π«Ά
but the more complicated drivers though β the ones that do need to allocate additional rpmsg addresses, and bind them to different rx callbacks β those must explicitly create additional endpoints by themselves (see rpmsg_create_ept). that's you, main character energy, you gotta do it manually. π₯
β SEE ALSO β
go read these next, iykyk:
- Kernel file
./include/linux/rpmsg.h struct rpmsg_channel_info(9)struct rpmsg_driver(9)module_rpmsg_driver(9)
and that's the page bestie!! π it lives over in ./include/linux, stamped October 2026, and it's all about struct rpmsg_endpoint(9) β go forth and bind those addresses πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms