···2525#define to_rpmsg_device(d) container_of(d, struct rpmsg_device, dev)2626#define to_rpmsg_driver(d) container_of(d, struct rpmsg_driver, drv)27272828+/**2929+ * struct rpmsg_device_ops - indirection table for the rpmsg_device operations3030+ * @create_ept: create backend-specific endpoint, requried3131+ * @announce_create: announce presence of new channel, optional3232+ * @announce_destroy: announce destruction of channel, optional3333+ *3434+ * Indirection table for the operations that a rpmsg backend should implement.3535+ * @announce_create and @announce_destroy are optional as the backend might3636+ * advertise new channels implicitly by creating the endpoints.3737+ */3838+struct rpmsg_device_ops {3939+ struct rpmsg_endpoint *(*create_ept)(struct rpmsg_device *rpdev,4040+ rpmsg_rx_cb_t cb, void *priv,4141+ struct rpmsg_channel_info chinfo);4242+4343+ int (*announce_create)(struct rpmsg_device *ept);4444+ int (*announce_destroy)(struct rpmsg_device *ept);4545+};4646+4747+/**4848+ * struct rpmsg_endpoint_ops - indirection table for rpmsg_endpoint operations4949+ * @destroy_ept: destroy the given endpoint, required5050+ * @send: see @rpmsg_send(), required5151+ * @sendto: see @rpmsg_sendto(), optional5252+ * @send_offchannel: see @rpmsg_send_offchannel(), optional5353+ * @trysend: see @rpmsg_trysend(), required5454+ * @trysendto: see @rpmsg_trysendto(), optional5555+ * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional5656+ *5757+ * Indirection table for the operations that a rpmsg backend should implement.5858+ * In addition to @destroy_ept, the backend must at least implement @send and5959+ * @trysend, while the variants sending data off-channel are optional.6060+ */6161+struct rpmsg_endpoint_ops {6262+ void (*destroy_ept)(struct rpmsg_endpoint *ept);6363+6464+ int (*send)(struct rpmsg_endpoint *ept, void *data, int len);6565+ int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);6666+ int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,6767+ void *data, int len);6868+6969+ int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);7070+ int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);7171+ int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,7272+ void *data, int len);7373+};7474+2875int rpmsg_register_device(struct rpmsg_device *rpdev);2976int rpmsg_unregister_device(struct device *parent,3077 struct rpmsg_channel_info *chinfo);
-47
include/linux/rpmsg.h
···138138typedef void (*rpmsg_rx_cb_t)(struct rpmsg_device *, void *, int, void *, u32);139139140140/**141141- * struct rpmsg_device_ops - indirection table for the rpmsg_device operations142142- * @create_ept: create backend-specific endpoint, requried143143- * @announce_create: announce presence of new channel, optional144144- * @announce_destroy: announce destruction of channel, optional145145- *146146- * Indirection table for the operations that a rpmsg backend should implement.147147- * @announce_create and @announce_destroy are optional as the backend might148148- * advertise new channels implicitly by creating the endpoints.149149- */150150-struct rpmsg_device_ops {151151- struct rpmsg_endpoint *(*create_ept)(struct rpmsg_device *rpdev,152152- rpmsg_rx_cb_t cb, void *priv,153153- struct rpmsg_channel_info chinfo);154154-155155- int (*announce_create)(struct rpmsg_device *ept);156156- int (*announce_destroy)(struct rpmsg_device *ept);157157-};158158-159159-/**160141 * struct rpmsg_endpoint - binds a local rpmsg address to its user161142 * @rpdev: rpmsg channel device162143 * @refcount: when this drops to zero, the ept is deallocated···169188 void *priv;170189171190 const struct rpmsg_endpoint_ops *ops;172172-};173173-174174-/**175175- * struct rpmsg_endpoint_ops - indirection table for rpmsg_endpoint operations176176- * @destroy_ept: destroy the given endpoint, required177177- * @send: see @rpmsg_send(), required178178- * @sendto: see @rpmsg_sendto(), optional179179- * @send_offchannel: see @rpmsg_send_offchannel(), optional180180- * @trysend: see @rpmsg_trysend(), required181181- * @trysendto: see @rpmsg_trysendto(), optional182182- * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional183183- *184184- * Indirection table for the operations that a rpmsg backend should implement.185185- * In addition to @destroy_ept, the backend must at least implement @send and186186- * @trysend, while the variants sending data off-channel are optional.187187- */188188-struct rpmsg_endpoint_ops {189189- void (*destroy_ept)(struct rpmsg_endpoint *ept);190190-191191- int (*send)(struct rpmsg_endpoint *ept, void *data, int len);192192- int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);193193- int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,194194- void *data, int len);195195-196196- int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);197197- int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);198198- int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,199199- void *data, int len);200191};201192202193/**