dsa.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef __DSA_H
  3. #define __DSA_H
  4. #include <linux/list.h>
  5. #include <linux/types.h>
  6. struct dsa_db;
  7. struct dsa_device_ops;
  8. struct dsa_lag;
  9. struct dsa_switch_tree;
  10. struct net_device;
  11. struct work_struct;
  12. extern struct list_head dsa_tree_list;
  13. bool dsa_db_equal(const struct dsa_db *a, const struct dsa_db *b);
  14. bool dsa_schedule_work(struct work_struct *work);
  15. void dsa_lag_map(struct dsa_switch_tree *dst, struct dsa_lag *lag);
  16. void dsa_lag_unmap(struct dsa_switch_tree *dst, struct dsa_lag *lag);
  17. struct dsa_lag *dsa_tree_lag_find(struct dsa_switch_tree *dst,
  18. const struct net_device *lag_dev);
  19. struct net_device *dsa_tree_find_first_conduit(struct dsa_switch_tree *dst);
  20. int dsa_tree_change_tag_proto(struct dsa_switch_tree *dst,
  21. const struct dsa_device_ops *tag_ops,
  22. const struct dsa_device_ops *old_tag_ops);
  23. void dsa_tree_conduit_admin_state_change(struct dsa_switch_tree *dst,
  24. struct net_device *conduit,
  25. bool up);
  26. void dsa_tree_conduit_oper_state_change(struct dsa_switch_tree *dst,
  27. struct net_device *conduit,
  28. bool up);
  29. unsigned int dsa_bridge_num_get(const struct net_device *bridge_dev, int max);
  30. void dsa_bridge_num_put(const struct net_device *bridge_dev,
  31. unsigned int bridge_num);
  32. struct dsa_bridge *dsa_tree_bridge_find(struct dsa_switch_tree *dst,
  33. const struct net_device *br);
  34. #endif