0001
0002
0003
0004
0005 #ifndef AM65_CPSW_QOS_H_
0006 #define AM65_CPSW_QOS_H_
0007
0008 #include <linux/netdevice.h>
0009 #include <net/pkt_sched.h>
0010
0011 struct am65_cpsw_est {
0012 int buf;
0013
0014 struct tc_taprio_qopt_offload taprio;
0015 };
0016
0017 struct am65_cpsw_ale_ratelimit {
0018 unsigned long cookie;
0019 u64 rate_packet_ps;
0020 };
0021
0022 struct am65_cpsw_qos {
0023 struct am65_cpsw_est *est_admin;
0024 struct am65_cpsw_est *est_oper;
0025 ktime_t link_down_time;
0026 int link_speed;
0027
0028 struct am65_cpsw_ale_ratelimit ale_bc_ratelimit;
0029 struct am65_cpsw_ale_ratelimit ale_mc_ratelimit;
0030 };
0031
0032 int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type,
0033 void *type_data);
0034 void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed);
0035 void am65_cpsw_qos_link_down(struct net_device *ndev);
0036
0037 #endif