net_switch_config.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Texas Instruments Ethernet Switch Driver
  3. *
  4. * Copyright (C) 2014 Texas Instruments
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. /*
  16. * Userspace API for Switch Configuration
  17. */
  18. #ifndef __NET_CONFIG_SWITCH_H__
  19. #define __NET_CONFIG_SWITCH_H__
  20. enum {
  21. CONFIG_SWITCH_INVALID,
  22. CONFIG_SWITCH_ADD_MULTICAST,
  23. CONFIG_SWITCH_DEL_MULTICAST,
  24. CONFIG_SWITCH_ADD_VLAN,
  25. CONFIG_SWITCH_DEL_VLAN,
  26. CONFIG_SWITCH_SET_PORT_CONFIG,
  27. CONFIG_SWITCH_GET_PORT_CONFIG,
  28. CONFIG_SWITCH_ADD_UNKNOWN_VLAN_INFO,
  29. CONFIG_SWITCH_GET_PORT_STATE,
  30. CONFIG_SWITCH_SET_PORT_STATE,
  31. CONFIG_SWITCH_GET_PORT_VLAN_CONFIG,
  32. CONFIG_SWITCH_SET_PORT_VLAN_CONFIG,
  33. CONFIG_SWITCH_RATELIMIT,
  34. };
  35. enum {
  36. PORT_STATE_DISABLED = 0,
  37. PORT_STATE_BLOCKED,
  38. PORT_STATE_LEARN,
  39. PORT_STATE_FORWARD,
  40. };
  41. /*
  42. * Pass all unused parameters as zero is recomented.
  43. */
  44. struct net_switch_config {
  45. unsigned int cmd; /* API to be invoked by the kernel driver */
  46. unsigned int port;
  47. unsigned int vid; /* VLAN identifier */
  48. unsigned char unreg_multi; /* unreg multicast Egress Ports */
  49. unsigned char reg_multi; /* register multicast Egress ports */
  50. unsigned char untag_port; /* Untag ports */
  51. unsigned char addr[6];
  52. unsigned int super;
  53. unsigned char unknown_vlan_member;
  54. unsigned char unknown_vlan_untag;
  55. unsigned int unknown_vlan_unreg_multi;
  56. unsigned int unknown_vlan_reg_multi;
  57. unsigned int port_state;
  58. unsigned int prio;
  59. bool vlan_cfi;
  60. unsigned int bcast_rate_limit;
  61. unsigned int mcast_rate_limit;
  62. bool direction;
  63. struct ethtool_cmd ecmd;
  64. unsigned int ret_type; /* Return Success/Failure */
  65. };
  66. #endif /* __NET_CONFIG_SWITCH_H__*/