xref: /openbmc/linux/include/linux/rpmsg/ns.h (revision 950a7388)
1c435a041SMathieu Poirier /* SPDX-License-Identifier: GPL-2.0 */
2c435a041SMathieu Poirier 
3c435a041SMathieu Poirier #ifndef _LINUX_RPMSG_NS_H
4c435a041SMathieu Poirier #define _LINUX_RPMSG_NS_H
5c435a041SMathieu Poirier 
6c435a041SMathieu Poirier #include <linux/mod_devicetable.h>
7*950a7388SArnaud Pouliquen #include <linux/rpmsg.h>
8c435a041SMathieu Poirier #include <linux/rpmsg/byteorder.h>
9c435a041SMathieu Poirier #include <linux/types.h>
10c435a041SMathieu Poirier 
11c435a041SMathieu Poirier /**
12c435a041SMathieu Poirier  * struct rpmsg_ns_msg - dynamic name service announcement message
13c435a041SMathieu Poirier  * @name: name of remote service that is published
14c435a041SMathieu Poirier  * @addr: address of remote service that is published
15c435a041SMathieu Poirier  * @flags: indicates whether service is created or destroyed
16c435a041SMathieu Poirier  *
17c435a041SMathieu Poirier  * This message is sent across to publish a new service, or announce
18c435a041SMathieu Poirier  * about its removal. When we receive these messages, an appropriate
19c435a041SMathieu Poirier  * rpmsg channel (i.e device) is created/destroyed. In turn, the ->probe()
20c435a041SMathieu Poirier  * or ->remove() handler of the appropriate rpmsg driver will be invoked
21c435a041SMathieu Poirier  * (if/as-soon-as one is registered).
22c435a041SMathieu Poirier  */
23c435a041SMathieu Poirier struct rpmsg_ns_msg {
24c435a041SMathieu Poirier 	char name[RPMSG_NAME_SIZE];
25c435a041SMathieu Poirier 	__rpmsg32 addr;
26c435a041SMathieu Poirier 	__rpmsg32 flags;
27c435a041SMathieu Poirier } __packed;
28c435a041SMathieu Poirier 
29c435a041SMathieu Poirier /**
30c435a041SMathieu Poirier  * enum rpmsg_ns_flags - dynamic name service announcement flags
31c435a041SMathieu Poirier  *
32c435a041SMathieu Poirier  * @RPMSG_NS_CREATE: a new remote service was just created
33c435a041SMathieu Poirier  * @RPMSG_NS_DESTROY: a known remote service was just destroyed
34c435a041SMathieu Poirier  */
35c435a041SMathieu Poirier enum rpmsg_ns_flags {
36c435a041SMathieu Poirier 	RPMSG_NS_CREATE		= 0,
37c435a041SMathieu Poirier 	RPMSG_NS_DESTROY	= 1,
38c435a041SMathieu Poirier };
39c435a041SMathieu Poirier 
40c435a041SMathieu Poirier /* Address 53 is reserved for advertising remote services */
41c435a041SMathieu Poirier #define RPMSG_NS_ADDR			(53)
42c435a041SMathieu Poirier 
43*950a7388SArnaud Pouliquen int rpmsg_ns_register_device(struct rpmsg_device *rpdev);
44*950a7388SArnaud Pouliquen 
45c435a041SMathieu Poirier #endif
46