From 753a20368b2ab4b27b893eb44d7a7a5bdd840394 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Fri, 10 Jun 2022 15:40:19 +0200 Subject: [PATCH] docs: add no-copy user API description Add short description of the no-copy user interface. Add some sub-chapters to increase the readability. Signed-off-by: Arnaud Pouliquen --- docs/rpmsg-design.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/rpmsg-design.md b/docs/rpmsg-design.md index 2bf2f959e..2c80afb01 100644 --- a/docs/rpmsg-design.md +++ b/docs/rpmsg-design.md @@ -36,6 +36,7 @@ running on two processors. ``` struct rpmsg_device *rpmsg_virtio_get_rpmsg_device(struct rpmsg_virtio_device *rvdev) ``` +### RPMsg virtio endpoint APIs * Create RPMsg endpoint: ``` int rpmsg_create_ept(struct rpmsg_endpoint *ept, @@ -52,6 +53,7 @@ running on two processors. ``` int is_rpmsg_ept_ready(struct rpmsg_endpoint *ept) ``` +### RPMsg messaging APIs * Send message with RPMsg endpoint default binding: ``` int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len) @@ -88,6 +90,43 @@ running on two processors. const void *data, int len)` ``` +* Hold the rx buffer for usage outside the receive callback: + ``` + void rpmsg_hold_rx_buffer(struct rpmsg_endpoint *ept, void *rxbuf) + ``` + +* Release the rx buffer held thanks to the rpmsg_hold_rx_buffer() function: + ``` + void rpmsg_release_rx_buffer(struct rpmsg_endpoint *ept, void *rxbuf) + + ``` +* Gets the tx buffer for message payload. + ``` + void *rpmsg_get_tx_payload_buffer(struct rpmsg_endpoint *ept, + uint32_t *len, int wait) + ``` + +* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function, + Send a message with the RPMsg endpoint default binding: + ``` + int rpmsg_send_nocopy(struct rpmsg_endpoint *ept, + const void *data, int len) + ``` + +* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function, + send a message with RPMsg endpoint, specifying the destination address: + ``` + int rpmsg_sendto_nocopy(struct rpmsg_endpoint *ept, + const void *data, int len, uint32_t dst) + ``` + +* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function, + send a message with RPMsg endpoint using explicit source and destination addresses: + ``` + int rpmsg_send_offchannel_nocopy(struct rpmsg_endpoint *ept, uint32_t src, + uint32_t dst, const void *data, int len) + ``` + * Releases unused Tx buffer reserved by rpmsg_get_tx_payload_buffer() function: ``` int rpmsg_release_tx_buffer(struct rpmsg_endpoint *ept, void *txbuf)