18f010541SParav Pandit /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 28f010541SParav Pandit /* Copyright (c) 2020 Mellanox Technologies Ltd */ 38f010541SParav Pandit 48f010541SParav Pandit #ifndef __MLX5_SF_PRIV_H__ 58f010541SParav Pandit #define __MLX5_SF_PRIV_H__ 68f010541SParav Pandit 78f010541SParav Pandit #include <linux/mlx5/driver.h> 88f010541SParav Pandit 98f010541SParav Pandit int mlx5_cmd_alloc_sf(struct mlx5_core_dev *dev, u16 function_id); 108f010541SParav Pandit int mlx5_cmd_dealloc_sf(struct mlx5_core_dev *dev, u16 function_id); 118f010541SParav Pandit 126a327321SParav Pandit int mlx5_cmd_sf_enable_hca(struct mlx5_core_dev *dev, u16 func_id); 136a327321SParav Pandit int mlx5_cmd_sf_disable_hca(struct mlx5_core_dev *dev, u16 func_id); 146a327321SParav Pandit 15*f1b9acd3SParav Pandit u16 mlx5_sf_sw_to_hw_id(struct mlx5_core_dev *dev, u32 controller, u16 sw_id); 168f010541SParav Pandit 17*f1b9acd3SParav Pandit int mlx5_sf_hw_table_sf_alloc(struct mlx5_core_dev *dev, u32 controller, u32 usr_sfnum); 18*f1b9acd3SParav Pandit void mlx5_sf_hw_table_sf_free(struct mlx5_core_dev *dev, u32 controller, u16 id); 19*f1b9acd3SParav Pandit void mlx5_sf_hw_table_sf_deferred_free(struct mlx5_core_dev *dev, u32 controller, u16 id); 201d797935SParav Pandit bool mlx5_sf_hw_table_supported(const struct mlx5_core_dev *dev); 218f010541SParav Pandit 228f010541SParav Pandit #endif 23