net/rpmsg: add support for new rpmsg sockets
authorSuman Anna <s-anna@ti.com>
Fri, 5 Oct 2018 20:19:23 +0000 (15:19 -0500)
committerSuman Anna <s-anna@ti.com>
Thu, 3 Jan 2019 00:50:49 +0000 (18:50 -0600)
commit01b8b679d69dc466aa741169d3cbb8abd81df2d0
treec0ea6c9e0817107442873635b5ae377dfc728f4a
parent437fe589254aa649b0b348b11c760b78abe3006f
net/rpmsg: add support for new rpmsg sockets

Add the support for a new socket address and protocol family -
remote-processor messaging sockets. This rpmsg protocol driver
provides the necessary support to expose a rpmsg communication
channel through the socket API to userspace under the AF_RPMSG
address family. The usage relies on leveraging the socket API's
connect() for Tx sockets and bind() for Rx sockets to exchange
messages to/from a remote processor. All message communication
is performed using the userspace created sockets, and even though
the probed rpmsg proto devices do create an embedded rpmsg endpoint
for receiving messages, they are not really designed to process
any such unexpected Rx messages.

This driver forms the kernel transport portion of the the TI
IPC MessageQ stack. The MessageQ stack usage of the AF_RPMSG
socket interface is not really designed to handle multiple
rpmsg-proto devices published from the same remote processor,
so a restriction is imposed to allow only a single rpmsg device
even though there are no such restrictions imposed by the
rpmsg bus infrastructure. This can be scaled to make it more
generic if needed but probably will require some userspace
interface adjustments.

This patch is based on some quite an old rpmsg socket support
patch from Ohad and some work by Rob Tivy. This has been updated
rather heavily to work with all the rpmsg framework changes in
4.9+ kernels.

Signed-off-by: Ohad Ben Cohen <ohad@wizery.com>
[s-anna@ti.com: adapted, improved and modified for latest kernel]
Signed-off-by: Suman Anna <s-anna@ti.com>
include/linux/socket.h
include/uapi/linux/rpmsg_socket.h [new file with mode: 0644]
net/Kconfig
net/Makefile
net/core/sock.c
net/rpmsg/Kconfig [new file with mode: 0644]
net/rpmsg/Makefile [new file with mode: 0644]
net/rpmsg/rpmsg_proto.c [new file with mode: 0644]
security/selinux/hooks.c
security/selinux/include/classmap.h