0001
0002
0003
0004 #ifndef _MLXSW_SPECTRUM_TRAP_H
0005 #define _MLXSW_SPECTRUM_TRAP_H
0006
0007 #include <linux/list.h>
0008 #include <net/devlink.h>
0009
0010 struct mlxsw_sp_trap {
0011 struct mlxsw_sp_trap_policer_item *policer_items_arr;
0012 size_t policers_count;
0013
0014 struct mlxsw_sp_trap_group_item *group_items_arr;
0015 size_t groups_count;
0016
0017 struct mlxsw_sp_trap_item *trap_items_arr;
0018 size_t traps_count;
0019
0020 u16 thin_policer_hw_id;
0021
0022 u64 max_policers;
0023 unsigned long policers_usage[];
0024 };
0025
0026 struct mlxsw_sp_trap_ops {
0027 int (*groups_init)(struct mlxsw_sp *mlxsw_sp,
0028 const struct mlxsw_sp_trap_group_item **arr,
0029 size_t *p_groups_count);
0030 int (*traps_init)(struct mlxsw_sp *mlxsw_sp,
0031 const struct mlxsw_sp_trap_item **arr,
0032 size_t *p_traps_count);
0033 };
0034
0035 extern const struct mlxsw_sp_trap_ops mlxsw_sp1_trap_ops;
0036 extern const struct mlxsw_sp_trap_ops mlxsw_sp2_trap_ops;
0037
0038 #endif