ncsi.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright Samuel Mendoza-Jonas, IBM Corporation 2018.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. */
  9. #ifndef __UAPI_NCSI_NETLINK_H__
  10. #define __UAPI_NCSI_NETLINK_H__
  11. /**
  12. * enum ncsi_nl_commands - supported NCSI commands
  13. *
  14. * @NCSI_CMD_UNSPEC: unspecified command to catch errors
  15. * @NCSI_CMD_PKG_INFO: list package and channel attributes. Requires
  16. * NCSI_ATTR_IFINDEX. If NCSI_ATTR_PACKAGE_ID is specified returns the
  17. * specific package and its channels - otherwise a dump request returns
  18. * all packages and their associated channels.
  19. * @NCSI_CMD_SET_INTERFACE: set preferred package and channel combination.
  20. * Requires NCSI_ATTR_IFINDEX and the preferred NCSI_ATTR_PACKAGE_ID and
  21. * optionally the preferred NCSI_ATTR_CHANNEL_ID.
  22. * @NCSI_CMD_CLEAR_INTERFACE: clear any preferred package/channel combination.
  23. * Requires NCSI_ATTR_IFINDEX.
  24. * @NCSI_CMD_MAX: highest command number
  25. */
  26. enum ncsi_nl_commands {
  27. NCSI_CMD_UNSPEC,
  28. NCSI_CMD_PKG_INFO,
  29. NCSI_CMD_SET_INTERFACE,
  30. NCSI_CMD_CLEAR_INTERFACE,
  31. __NCSI_CMD_AFTER_LAST,
  32. NCSI_CMD_MAX = __NCSI_CMD_AFTER_LAST - 1
  33. };
  34. /**
  35. * enum ncsi_nl_attrs - General NCSI netlink attributes
  36. *
  37. * @NCSI_ATTR_UNSPEC: unspecified attributes to catch errors
  38. * @NCSI_ATTR_IFINDEX: ifindex of network device using NCSI
  39. * @NCSI_ATTR_PACKAGE_LIST: nested array of NCSI_PKG_ATTR attributes
  40. * @NCSI_ATTR_PACKAGE_ID: package ID
  41. * @NCSI_ATTR_CHANNEL_ID: channel ID
  42. * @NCSI_ATTR_MAX: highest attribute number
  43. */
  44. enum ncsi_nl_attrs {
  45. NCSI_ATTR_UNSPEC,
  46. NCSI_ATTR_IFINDEX,
  47. NCSI_ATTR_PACKAGE_LIST,
  48. NCSI_ATTR_PACKAGE_ID,
  49. NCSI_ATTR_CHANNEL_ID,
  50. __NCSI_ATTR_AFTER_LAST,
  51. NCSI_ATTR_MAX = __NCSI_ATTR_AFTER_LAST - 1
  52. };
  53. /**
  54. * enum ncsi_nl_pkg_attrs - NCSI netlink package-specific attributes
  55. *
  56. * @NCSI_PKG_ATTR_UNSPEC: unspecified attributes to catch errors
  57. * @NCSI_PKG_ATTR: nested array of package attributes
  58. * @NCSI_PKG_ATTR_ID: package ID
  59. * @NCSI_PKG_ATTR_FORCED: flag signifying a package has been set as preferred
  60. * @NCSI_PKG_ATTR_CHANNEL_LIST: nested array of NCSI_CHANNEL_ATTR attributes
  61. * @NCSI_PKG_ATTR_MAX: highest attribute number
  62. */
  63. enum ncsi_nl_pkg_attrs {
  64. NCSI_PKG_ATTR_UNSPEC,
  65. NCSI_PKG_ATTR,
  66. NCSI_PKG_ATTR_ID,
  67. NCSI_PKG_ATTR_FORCED,
  68. NCSI_PKG_ATTR_CHANNEL_LIST,
  69. __NCSI_PKG_ATTR_AFTER_LAST,
  70. NCSI_PKG_ATTR_MAX = __NCSI_PKG_ATTR_AFTER_LAST - 1
  71. };
  72. /**
  73. * enum ncsi_nl_channel_attrs - NCSI netlink channel-specific attributes
  74. *
  75. * @NCSI_CHANNEL_ATTR_UNSPEC: unspecified attributes to catch errors
  76. * @NCSI_CHANNEL_ATTR: nested array of channel attributes
  77. * @NCSI_CHANNEL_ATTR_ID: channel ID
  78. * @NCSI_CHANNEL_ATTR_VERSION_MAJOR: channel major version number
  79. * @NCSI_CHANNEL_ATTR_VERSION_MINOR: channel minor version number
  80. * @NCSI_CHANNEL_ATTR_VERSION_STR: channel version string
  81. * @NCSI_CHANNEL_ATTR_LINK_STATE: channel link state flags
  82. * @NCSI_CHANNEL_ATTR_ACTIVE: channels with this flag are in
  83. * NCSI_CHANNEL_ACTIVE state
  84. * @NCSI_CHANNEL_ATTR_FORCED: flag signifying a channel has been set as
  85. * preferred
  86. * @NCSI_CHANNEL_ATTR_VLAN_LIST: nested array of NCSI_CHANNEL_ATTR_VLAN_IDs
  87. * @NCSI_CHANNEL_ATTR_VLAN_ID: VLAN ID being filtered on this channel
  88. * @NCSI_CHANNEL_ATTR_MAX: highest attribute number
  89. */
  90. enum ncsi_nl_channel_attrs {
  91. NCSI_CHANNEL_ATTR_UNSPEC,
  92. NCSI_CHANNEL_ATTR,
  93. NCSI_CHANNEL_ATTR_ID,
  94. NCSI_CHANNEL_ATTR_VERSION_MAJOR,
  95. NCSI_CHANNEL_ATTR_VERSION_MINOR,
  96. NCSI_CHANNEL_ATTR_VERSION_STR,
  97. NCSI_CHANNEL_ATTR_LINK_STATE,
  98. NCSI_CHANNEL_ATTR_ACTIVE,
  99. NCSI_CHANNEL_ATTR_FORCED,
  100. NCSI_CHANNEL_ATTR_VLAN_LIST,
  101. NCSI_CHANNEL_ATTR_VLAN_ID,
  102. __NCSI_CHANNEL_ATTR_AFTER_LAST,
  103. NCSI_CHANNEL_ATTR_MAX = __NCSI_CHANNEL_ATTR_AFTER_LAST - 1
  104. };
  105. #endif /* __UAPI_NCSI_NETLINK_H__ */