Skip to content

Commit c0cdc19

Browse files
committed
rpmsg: Driver for user space endpoint interface
This driver allows rpmsg instances to expose access to rpmsg endpoints to user space processes. It provides a control interface, allowing userspace to export endpoints and an endpoint interface for each exposed endpoint. The implementation is based on prior art by Texas Instrument, Google, PetaLogix and was derived from a FreeRTOS performance statistics driver written by Michal Simek. The control interface provides a "create endpoint" ioctl, which is fed a name, source and destination address. The three values are used to create the endpoint, in a backend-specific way, and a rpmsg endpoint device is created - with the three parameters are available in sysfs for udev usage. E.g. to create an endpoint device for one of the Qualcomm SMD channel related to DIAG one would issue: struct rpmsg_endpoint_info info = { "DIAG_CNTL", 0, 0 }; int fd = open("/dev/rpmsg_ctrl0", O_RDWR); ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &info); Each created endpoint device shows up as an individual character device in /dev, allowing permission to be controlled on a per-endpoint basis. The rpmsg endpoint will be created and destroyed following the opening and closing of the endpoint device, allowing rpmsg backends to open and close the physical channel, if supported by the wire protocol. Cc: Marek Novak <[email protected]> Cc: Matteo Sartori <[email protected]> Cc: Michal Simek <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
1 parent adaa11b commit c0cdc19

File tree

6 files changed

+645
-0
lines changed

6 files changed

+645
-0
lines changed

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Code Seq#(hex) Include File Comments
321321
0xB1 00-1F PPPoX <mailto:[email protected]>
322322
0xB3 00 linux/mmc/ioctl.h
323323
0xB4 00-0F linux/gpio.h <mailto:[email protected]>
324+
0xB5 00-0F uapi/linux/rpmsg.h <mailto:[email protected]>
324325
0xC0 00-0F linux/usb/iowarrior.h
325326
0xCA 00-0F uapi/misc/cxl.h
326327
0xCA 80-8F uapi/scsi/cxlflash_ioctl.h

drivers/rpmsg/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ menu "Rpmsg drivers"
44
config RPMSG
55
tristate
66

7+
config RPMSG_CHAR
8+
tristate "RPMSG device interface"
9+
depends on RPMSG
10+
help
11+
Say Y here to export rpmsg endpoints as device files, usually found
12+
in /dev. They make it possible for user-space programs to send and
13+
receive rpmsg packets.
14+
715
config RPMSG_QCOM_SMD
816
tristate "Qualcomm Shared Memory Driver (SMD)"
917
depends on QCOM_SMEM

drivers/rpmsg/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
obj-$(CONFIG_RPMSG) += rpmsg_core.o
2+
obj-$(CONFIG_RPMSG_CHAR) += rpmsg_char.o
23
obj-$(CONFIG_RPMSG_QCOM_SMD) += qcom_smd.o
34
obj-$(CONFIG_RPMSG_VIRTIO) += virtio_rpmsg_bus.o

0 commit comments

Comments
 (0)