diff options
author | Igor Opaniuk <igor.opaniuk@toradex.com> | 2019-11-28 19:03:57 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2020-02-12 11:06:10 +0100 |
commit | eee5f39635d2dd15ab3eec88273790be2f7cab9a (patch) | |
tree | 21bbc8eca6a80547023ccfa46444b067eb06e4a9 /crypto/crc32_generic.c | |
parent | 63e33323d571b4103dd8a863451233ef610bca8d (diff) |
rpmsg: virtio rpmsg: Add RPMsg char driver support
virtio rpmsg was not implemented to use RPMsg char driver.
Each virtio ns announcement will create a new RPMsg device which
is supposed to bound to a RPMsg driver. It doesn't support
dynamic endpoints with name service per RPMsg device.
With RPMsg char driver, you can have multiple endpoints per
RPMsg device.
Here is the change from this patch:
* Introduce a macro to indicate if want to use RPMsg char driver
for virtio RPMsg. The RPMsg device can either be bounded to
a simple RPMsg driver or the RPMsg char driver.
* Create Virtio RPMsg char device when the virtio RPMsg driver is
probed.
* when there is a remote service announced, keep it in the virtio
proc remote services list.
* when there is an endpoint created, bind it to a remote service
from the remote services list. If the service doesn't exist yet,
create one and mark the service address as ANY.
That patch ported to our 4.14 kernel + additional fixes added [1].
Example of usage from userspace app:
```
char data_buf [] = {'a', 'b', 'c', 'd', '\0'};
struct rpmsg_endpoint_info ept_info = {"rpmsg-openamp-demo-channel", 0x2, 0x1};
int fd = open("/dev/rpmsg_ctrl0", O_RDWR);
/* create endpoint interface */
ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &ept_info);
/* create endpoint */
int fd_ept = open("/dev/rpmsg0", O_RDWR);
/* receive data from remote device */
read(fd_ept, &data_buf, sizeof(data_buf));
/* send data to remote device */
write(fd_ept, &data_buf, sizeof(data_buf));
/* destroy endpoint */
ioctl(fd_ept, RPMSG_DESTROY_EPT_IOCTL);
close(fd_ept);
close(fd);
```
[1] https://patchwork.kernel.org/patch/10145779/
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Diffstat (limited to 'crypto/crc32_generic.c')
0 files changed, 0 insertions, 0 deletions