[PATCH 05/13] rpmsg: uapi: add service param for create destroy ioctls

From: Arnaud Pouliquen
Date: Fri Jul 31 2020 - 08:11:22 EST


To allow to associate an endpoint creation to a service, add
a new parameter in rpmsg_endpoint_info struct.
For each RPMsg service driver that want to support the ioctl interface
a new service will have to be added.
The RPMSG_START_PRIVATE_SERVICES is used to allow developer to add is
own services with ID higher or equal to 1024.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@xxxxxx>
---
include/uapi/linux/rpmsg.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/include/uapi/linux/rpmsg.h b/include/uapi/linux/rpmsg.h
index e14c6dab4223..2ccc10ffacd4 100644
--- a/include/uapi/linux/rpmsg.h
+++ b/include/uapi/linux/rpmsg.h
@@ -9,16 +9,32 @@
#include <linux/ioctl.h>
#include <linux/types.h>

+/**
+ * enum rpmsg_services - list of supported RPMsg services
+ *
+ * @RPMSG_RAW_SERVICE: char device RPMSG service
+ * @RPMSG_START_PRIVATE_SERVICES: private services have to be declared after.
+ */
+enum rpmsg_services {
+ /* Reserved services */
+ RPMSG_RAW_SERVICE = 0,
+
+ /* Private services */
+ RPMSG_START_PRIVATE_SERVICES = 1024,
+};
+
/**
* struct rpmsg_endpoint_info - endpoint info representation
* @name: name of service
* @src: local address
* @dst: destination address
+ * @service: associated RPMsg service
*/
struct rpmsg_endpoint_info {
char name[32];
__u32 src;
__u32 dst;
+ __u32 service;
};

#define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x1, struct rpmsg_endpoint_info)
--
2.17.1