162306a36Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
262306a36Sopenharmony_ci/* Copyright (c) 2017-2018 Mellanox Technologies. All rights reserved */
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#ifndef _MLXSW_SPECTRUM_CNT_H
562306a36Sopenharmony_ci#define _MLXSW_SPECTRUM_CNT_H
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#include "core.h"
862306a36Sopenharmony_ci#include "spectrum.h"
962306a36Sopenharmony_ci
1062306a36Sopenharmony_cienum mlxsw_sp_counter_sub_pool_id {
1162306a36Sopenharmony_ci	MLXSW_SP_COUNTER_SUB_POOL_RIF,
1262306a36Sopenharmony_ci	MLXSW_SP_COUNTER_SUB_POOL_FLOW,
1362306a36Sopenharmony_ci};
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciint mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp,
1662306a36Sopenharmony_ci			   enum mlxsw_sp_counter_sub_pool_id sub_pool_id,
1762306a36Sopenharmony_ci			   unsigned int *p_counter_index);
1862306a36Sopenharmony_civoid mlxsw_sp_counter_free(struct mlxsw_sp *mlxsw_sp,
1962306a36Sopenharmony_ci			   enum mlxsw_sp_counter_sub_pool_id sub_pool_id,
2062306a36Sopenharmony_ci			   unsigned int counter_index);
2162306a36Sopenharmony_ciint mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp);
2262306a36Sopenharmony_civoid mlxsw_sp_counter_pool_fini(struct mlxsw_sp *mlxsw_sp);
2362306a36Sopenharmony_ciint mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core);
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#endif
26