Skip to content

Commit

Permalink
docs: add no-copy user API description
Browse files Browse the repository at this point in the history
Add short description of the no-copy user interface.
Add some sub-chapters to increase the readability.

Signed-off-by: Arnaud Pouliquen <[email protected]>
  • Loading branch information
arnopo committed Oct 18, 2022
1 parent 4e1fa03 commit 753a203
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/rpmsg-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 753a203

Please sign in to comment.