virtio_rpmsg.h 811 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _LINUX_RPMSG_VIRTIO_RPMSG_H
  2. #define _LINUX_RPMSG_VIRTIO_RPMSG_H
  3. struct rpmsg_device;
  4. struct virtio_device;
  5. /**
  6. * struct rpmsg_hdr - common header for all virtio rpmsg messages
  7. * @src: source address
  8. * @dst: destination address
  9. * @reserved: reserved for future use
  10. * @len: length of payload (in bytes)
  11. * @flags: message flags
  12. * @data: @len bytes of message payload data
  13. *
  14. * Every message sent(/received) on the rpmsg bus begins with this header.
  15. */
  16. struct rpmsg_hdr {
  17. u32 src;
  18. u32 dst;
  19. u32 reserved;
  20. u16 len;
  21. u16 flags;
  22. u8 data[0];
  23. } __packed;
  24. #if IS_ENABLED(CONFIG_RPMSG_VIRTIO)
  25. struct virtio_device *virtio_rpmsg_get_vdev(struct rpmsg_device *rpdev);
  26. #else
  27. static inline
  28. struct virtio_device *virtio_rpmsg_get_vdev(struct rpmsg_device *rpdev);
  29. {
  30. return NULL;
  31. }
  32. #endif
  33. #endif