mctp.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Management Component Transport Protocol (MCTP)
  4. *
  5. * Copyright (c) 2021 Code Construct
  6. * Copyright (c) 2021 Google
  7. */
  8. #ifndef __UAPI_MCTP_H
  9. #define __UAPI_MCTP_H
  10. #include <linux/types.h>
  11. #include <linux/socket.h>
  12. #include <linux/netdevice.h>
  13. typedef __u8 mctp_eid_t;
  14. struct mctp_addr {
  15. mctp_eid_t s_addr;
  16. };
  17. struct sockaddr_mctp {
  18. __kernel_sa_family_t smctp_family;
  19. __u16 __smctp_pad0;
  20. unsigned int smctp_network;
  21. struct mctp_addr smctp_addr;
  22. __u8 smctp_type;
  23. __u8 smctp_tag;
  24. __u8 __smctp_pad1;
  25. };
  26. struct sockaddr_mctp_ext {
  27. struct sockaddr_mctp smctp_base;
  28. int smctp_ifindex;
  29. __u8 smctp_halen;
  30. __u8 __smctp_pad0[3];
  31. __u8 smctp_haddr[MAX_ADDR_LEN];
  32. };
  33. #define MCTP_NET_ANY 0x0
  34. #define MCTP_ADDR_NULL 0x00
  35. #define MCTP_ADDR_ANY 0xff
  36. #define MCTP_TAG_MASK 0x07
  37. #define MCTP_TAG_OWNER 0x08
  38. #define MCTP_TAG_PREALLOC 0x10
  39. #define MCTP_OPT_ADDR_EXT 1
  40. #define SIOCMCTPALLOCTAG (SIOCPROTOPRIVATE + 0)
  41. #define SIOCMCTPDROPTAG (SIOCPROTOPRIVATE + 1)
  42. struct mctp_ioc_tag_ctl {
  43. mctp_eid_t peer_addr;
  44. /* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
  45. * populate with the allocated tag value. Returned tag value will
  46. * always have TO and PREALLOC set.
  47. *
  48. * For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
  49. * a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
  50. */
  51. __u8 tag;
  52. __u16 flags;
  53. };
  54. #endif /* __UAPI_MCTP_H */