dsa.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
  3. * Copyright (c) 2008-2009 Marvell Semiconductor
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. */
  10. #ifndef __LINUX_NET_DSA_H
  11. #define __LINUX_NET_DSA_H
  12. #define DSA_MAX_SWITCHES 4
  13. #define DSA_MAX_PORTS 12
  14. struct dsa_chip_data {
  15. /*
  16. * How to access the switch configuration registers.
  17. */
  18. struct device *mii_bus;
  19. int sw_addr;
  20. /*
  21. * The names of the switch's ports. Use "cpu" to
  22. * designate the switch port that the cpu is connected to,
  23. * "dsa" to indicate that this port is a DSA link to
  24. * another switch, NULL to indicate the port is unused,
  25. * or any other string to indicate this is a physical port.
  26. */
  27. char *port_names[DSA_MAX_PORTS];
  28. /*
  29. * An array (with nr_chips elements) of which element [a]
  30. * indicates which port on this switch should be used to
  31. * send packets to that are destined for switch a. Can be
  32. * NULL if there is only one switch chip.
  33. */
  34. s8 *rtable;
  35. };
  36. struct dsa_platform_data {
  37. /*
  38. * Reference to a Linux network interface that connects
  39. * to the root switch chip of the tree.
  40. */
  41. struct device *netdev;
  42. /*
  43. * Info structs describing each of the switch chips
  44. * connected via this network interface.
  45. */
  46. int nr_chips;
  47. struct dsa_chip_data *chip;
  48. };
  49. extern bool dsa_uses_dsa_tags(void *dsa_ptr);
  50. extern bool dsa_uses_trailer_tags(void *dsa_ptr);
  51. #endif