a03-swconfig-revert-UAPI-disintegration.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --- a/include/linux/switch.h
  2. +++ b/include/linux/switch.h
  3. @@ -13,11 +13,95 @@
  4. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5. * GNU General Public License for more details.
  6. */
  7. -#ifndef _LINUX_SWITCH_H
  8. -#define _LINUX_SWITCH_H
  9. +#ifndef __LINUX_SWITCH_H
  10. +#define __LINUX_SWITCH_H
  11. +
  12. +#include <linux/types.h>
  13. +#include <linux/netdevice.h>
  14. +#include <linux/netlink.h>
  15. +#include <linux/genetlink.h>
  16. +#ifndef __KERNEL__
  17. +#include <netlink/netlink.h>
  18. +#include <netlink/genl/genl.h>
  19. +#include <netlink/genl/ctrl.h>
  20. +#else
  21. #include <net/genetlink.h>
  22. -#include <uapi/linux/switch.h>
  23. +#endif
  24. +
  25. +/* main attributes */
  26. +enum {
  27. + SWITCH_ATTR_UNSPEC,
  28. + /* global */
  29. + SWITCH_ATTR_TYPE,
  30. + /* device */
  31. + SWITCH_ATTR_ID,
  32. + SWITCH_ATTR_DEV_NAME,
  33. + SWITCH_ATTR_ALIAS,
  34. + SWITCH_ATTR_NAME,
  35. + SWITCH_ATTR_VLANS,
  36. + SWITCH_ATTR_PORTS,
  37. + SWITCH_ATTR_PORTMAP,
  38. + SWITCH_ATTR_CPU_PORT,
  39. + /* attributes */
  40. + SWITCH_ATTR_OP_ID,
  41. + SWITCH_ATTR_OP_TYPE,
  42. + SWITCH_ATTR_OP_NAME,
  43. + SWITCH_ATTR_OP_PORT,
  44. + SWITCH_ATTR_OP_VLAN,
  45. + SWITCH_ATTR_OP_VALUE_INT,
  46. + SWITCH_ATTR_OP_VALUE_STR,
  47. + SWITCH_ATTR_OP_VALUE_PORTS,
  48. + SWITCH_ATTR_OP_DESCRIPTION,
  49. + /* port lists */
  50. + SWITCH_ATTR_PORT,
  51. + SWITCH_ATTR_MAX
  52. +};
  53. +
  54. +enum {
  55. + /* port map */
  56. + SWITCH_PORTMAP_PORTS,
  57. + SWITCH_PORTMAP_SEGMENT,
  58. + SWITCH_PORTMAP_VIRT,
  59. + SWITCH_PORTMAP_MAX
  60. +};
  61. +
  62. +/* commands */
  63. +enum {
  64. + SWITCH_CMD_UNSPEC,
  65. + SWITCH_CMD_GET_SWITCH,
  66. + SWITCH_CMD_NEW_ATTR,
  67. + SWITCH_CMD_LIST_GLOBAL,
  68. + SWITCH_CMD_GET_GLOBAL,
  69. + SWITCH_CMD_SET_GLOBAL,
  70. + SWITCH_CMD_LIST_PORT,
  71. + SWITCH_CMD_GET_PORT,
  72. + SWITCH_CMD_SET_PORT,
  73. + SWITCH_CMD_LIST_VLAN,
  74. + SWITCH_CMD_GET_VLAN,
  75. + SWITCH_CMD_SET_VLAN
  76. +};
  77. +
  78. +/* data types */
  79. +enum switch_val_type {
  80. + SWITCH_TYPE_UNSPEC,
  81. + SWITCH_TYPE_INT,
  82. + SWITCH_TYPE_STRING,
  83. + SWITCH_TYPE_PORTS,
  84. + SWITCH_TYPE_NOVAL,
  85. +};
  86. +
  87. +/* port nested attributes */
  88. +enum {
  89. + SWITCH_PORT_UNSPEC,
  90. + SWITCH_PORT_ID,
  91. + SWITCH_PORT_FLAG_TAGGED,
  92. + SWITCH_PORT_ATTR_MAX
  93. +};
  94. +
  95. +#define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000
  96. +
  97. +#ifdef __KERNEL__
  98. struct switch_dev;
  99. struct switch_op;
  100. @@ -164,4 +248,6 @@ struct switch_attr {
  101. int max;
  102. };
  103. -#endif /* _LINUX_SWITCH_H */
  104. +#endif
  105. +
  106. +#endif