ns.h 1.3 KB

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