1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2020 Mellanox Technologies. All rights reserved */
3 
4 #ifndef _MLXSW_SPECTRUM_TRAP_H
5 #define _MLXSW_SPECTRUM_TRAP_H
6 
7 #include <linux/list.h>
8 #include <net/devlink.h>
9 
10 struct mlxsw_sp_trap {
11 	struct devlink_trap_policer *policers_arr; /* Registered policers */
12 	u64 policers_count; /* Number of registered policers */
13 	struct list_head policer_item_list;
14 	u64 max_policers;
15 	unsigned long policers_usage[]; /* Usage bitmap */
16 };
17 
18 struct mlxsw_sp_trap_policer_item {
19 	u16 hw_id;
20 	u32 id;
21 	struct list_head list; /* Member of policer_item_list */
22 };
23 
24 #endif
25