rtl83xx.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _NET_DSA_RTL83XX_H
  3. #define _NET_DSA_RTL83XX_H
  4. #include <net/dsa.h>
  5. #include "rtl838x.h"
  6. #define RTL8380_VERSION_A 'A'
  7. #define RTL8390_VERSION_A 'A'
  8. #define RTL8380_VERSION_B 'B'
  9. struct fdb_update_work {
  10. struct work_struct work;
  11. struct net_device *ndev;
  12. u64 macs[];
  13. };
  14. #define MIB_DESC(_size, _offset, _name) {.size = _size, .offset = _offset, .name = _name}
  15. struct rtl83xx_mib_desc {
  16. unsigned int size;
  17. unsigned int offset;
  18. const char *name;
  19. };
  20. void __init rtl83xx_storm_control_init(struct rtl838x_switch_priv *priv);
  21. /* RTL838x-specific */
  22. u32 rtl838x_hash(struct rtl838x_switch_priv *priv, u64 seed);
  23. irqreturn_t rtl838x_switch_irq(int irq, void *dev_id);
  24. void rtl8380_get_version(struct rtl838x_switch_priv *priv);
  25. void rtl838x_vlan_profile_dump(int index);
  26. int rtl83xx_dsa_phy_read(struct dsa_switch *ds, int phy_addr, int phy_reg);
  27. /* RTL839x-specific */
  28. u32 rtl839x_hash(struct rtl838x_switch_priv *priv, u64 seed);
  29. irqreturn_t rtl839x_switch_irq(int irq, void *dev_id);
  30. void rtl8390_get_version(struct rtl838x_switch_priv *priv);
  31. void rtl839x_vlan_profile_dump(int index);
  32. int rtl83xx_dsa_phy_write(struct dsa_switch *ds, int phy_addr, int phy_reg, u16 val);
  33. #endif /* _NET_DSA_RTL83XX_H */