1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2021 Marvell International Ltd. All rights reserved. */
3 
4 #ifndef _PRESTERA_COUNTER_H_
5 #define _PRESTERA_COUNTER_H_
6 
7 #include <linux/types.h>
8 
9 struct prestera_counter_stats {
10 	u64 packets;
11 	u64 bytes;
12 };
13 
14 struct prestera_switch;
15 struct prestera_counter;
16 struct prestera_counter_block;
17 
18 int prestera_counter_init(struct prestera_switch *sw);
19 void prestera_counter_fini(struct prestera_switch *sw);
20 
21 int prestera_counter_get(struct prestera_counter *counter, u32 client,
22 			 struct prestera_counter_block **block,
23 			 u32 *counter_id);
24 void prestera_counter_put(struct prestera_counter *counter,
25 			  struct prestera_counter_block *block, u32 counter_id);
26 int prestera_counter_stats_get(struct prestera_counter *counter,
27 			       struct prestera_counter_block *block,
28 			       u32 counter_id, u64 *packets, u64 *bytes);
29 
30 #endif /* _PRESTERA_COUNTER_H_ */
31