loop.h 777 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef DSA_LOOP_H
  3. #define DSA_LOOP_H
  4. #include <linux/if_vlan.h>
  5. #include <linux/types.h>
  6. #include <linux/ethtool.h>
  7. #include <net/dsa.h>
  8. struct dsa_loop_vlan {
  9. u16 members;
  10. u16 untagged;
  11. };
  12. struct dsa_loop_mib_entry {
  13. char name[ETH_GSTRING_LEN];
  14. unsigned long val;
  15. };
  16. enum dsa_loop_mib_counters {
  17. DSA_LOOP_PHY_READ_OK,
  18. DSA_LOOP_PHY_READ_ERR,
  19. DSA_LOOP_PHY_WRITE_OK,
  20. DSA_LOOP_PHY_WRITE_ERR,
  21. __DSA_LOOP_CNT_MAX,
  22. };
  23. struct dsa_loop_port {
  24. struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX];
  25. u16 pvid;
  26. int mtu;
  27. };
  28. struct dsa_loop_priv {
  29. struct mii_bus *bus;
  30. unsigned int port_base;
  31. struct dsa_loop_vlan vlans[VLAN_N_VID];
  32. struct net_device *netdev;
  33. struct dsa_loop_port ports[DSA_MAX_PORTS];
  34. };
  35. #endif /* DSA_LOOP_H */