logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

mctp.h (2538B)


  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. #define SIOCMCTPALLOCTAG2 (SIOCPROTOPRIVATE + 2)
  43. #define SIOCMCTPDROPTAG2 (SIOCPROTOPRIVATE + 3)
  44. /* Deprecated: use mctp_ioc_tag_ctl2 / TAG2 ioctls instead, which defines the
  45. * MCTP network ID as part of the allocated tag. Using this assumes the default
  46. * net ID for allocated tags, which may not give correct behaviour on system
  47. * with multiple networks configured.
  48. */
  49. struct mctp_ioc_tag_ctl {
  50. mctp_eid_t peer_addr;
  51. /* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
  52. * populate with the allocated tag value. Returned tag value will
  53. * always have TO and PREALLOC set.
  54. *
  55. * For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
  56. * a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
  57. */
  58. __u8 tag;
  59. __u16 flags;
  60. };
  61. struct mctp_ioc_tag_ctl2 {
  62. /* Peer details: network ID, peer EID, local EID. All set by the
  63. * caller.
  64. *
  65. * Local EID must be MCTP_ADDR_NULL or MCTP_ADDR_ANY in current
  66. * kernels.
  67. */
  68. unsigned int net;
  69. mctp_eid_t peer_addr;
  70. mctp_eid_t local_addr;
  71. /* Set by caller, but no flags defined currently. Must be 0 */
  72. __u16 flags;
  73. /* For SIOCMCTPALLOCTAG2: must be passed as zero, kernel will
  74. * populate with the allocated tag value. Returned tag value will
  75. * always have TO and PREALLOC set.
  76. *
  77. * For SIOCMCTPDROPTAG2: userspace provides tag value to drop, from
  78. * a prior SIOCMCTPALLOCTAG2 call (and so must have TO and PREALLOC set).
  79. */
  80. __u8 tag;
  81. };
  82. #endif /* __UAPI_MCTP_H */