1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2021 Marvell International Ltd. All rights reserved. */
4 #ifndef _PRESTERA_COUNTER_H_
5 #define _PRESTERA_COUNTER_H_
7 #include <linux/types.h>
9 struct prestera_counter_stats {
14 struct prestera_switch;
15 struct prestera_counter;
16 struct prestera_counter_block;
18 int prestera_counter_init(struct prestera_switch *sw);
19 void prestera_counter_fini(struct prestera_switch *sw);
21 int prestera_counter_get(struct prestera_counter *counter, u32 client,
22 struct prestera_counter_block **block,
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);
30 #endif /* _PRESTERA_COUNTER_H_ */