am65-cpsw-qos.h 914 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
  3. */
  4. #ifndef AM65_CPSW_QOS_H_
  5. #define AM65_CPSW_QOS_H_
  6. #include <linux/netdevice.h>
  7. #include <net/pkt_sched.h>
  8. struct am65_cpsw_est {
  9. int buf;
  10. /* has to be the last one */
  11. struct tc_taprio_qopt_offload taprio;
  12. };
  13. struct am65_cpsw_ale_ratelimit {
  14. unsigned long cookie;
  15. u64 rate_packet_ps;
  16. };
  17. struct am65_cpsw_qos {
  18. struct am65_cpsw_est *est_admin;
  19. struct am65_cpsw_est *est_oper;
  20. ktime_t link_down_time;
  21. int link_speed;
  22. struct am65_cpsw_ale_ratelimit ale_bc_ratelimit;
  23. struct am65_cpsw_ale_ratelimit ale_mc_ratelimit;
  24. };
  25. int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type,
  26. void *type_data);
  27. void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed);
  28. void am65_cpsw_qos_link_down(struct net_device *ndev);
  29. #endif /* AM65_CPSW_QOS_H_ */