1*9c2c1c5eSLama Kayal /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2*9c2c1c5eSLama Kayal /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. */
3*9c2c1c5eSLama Kayal 
4*9c2c1c5eSLama Kayal #ifndef __MLX5E_FS_ETHTOOL_H__
5*9c2c1c5eSLama Kayal #define __MLX5E_FS_ETHTOOL_H__
6*9c2c1c5eSLama Kayal 
7*9c2c1c5eSLama Kayal struct mlx5e_priv;
8*9c2c1c5eSLama Kayal struct mlx5e_ethtool_steering;
9*9c2c1c5eSLama Kayal #ifdef CONFIG_MLX5_EN_RXNFC
10*9c2c1c5eSLama Kayal int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool);
11*9c2c1c5eSLama Kayal void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool);
12*9c2c1c5eSLama Kayal void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs);
13*9c2c1c5eSLama Kayal void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs);
14*9c2c1c5eSLama Kayal int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd);
15*9c2c1c5eSLama Kayal int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
16*9c2c1c5eSLama Kayal 			    struct ethtool_rxnfc *info, u32 *rule_locs);
17*9c2c1c5eSLama Kayal #else
mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering ** ethtool)18*9c2c1c5eSLama Kayal static inline int mlx5e_ethtool_alloc(struct mlx5e_ethtool_steering **ethtool)
19*9c2c1c5eSLama Kayal { return 0; }
mlx5e_ethtool_free(struct mlx5e_ethtool_steering * ethtool)20*9c2c1c5eSLama Kayal static inline void mlx5e_ethtool_free(struct mlx5e_ethtool_steering *ethtool) { }
mlx5e_ethtool_init_steering(struct mlx5e_flow_steering * fs)21*9c2c1c5eSLama Kayal static inline void mlx5e_ethtool_init_steering(struct mlx5e_flow_steering *fs) { }
mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering * fs)22*9c2c1c5eSLama Kayal static inline void mlx5e_ethtool_cleanup_steering(struct mlx5e_flow_steering *fs) { }
mlx5e_ethtool_set_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * cmd)23*9c2c1c5eSLama Kayal static inline int mlx5e_ethtool_set_rxnfc(struct mlx5e_priv *priv, struct ethtool_rxnfc *cmd)
24*9c2c1c5eSLama Kayal { return -EOPNOTSUPP; }
mlx5e_ethtool_get_rxnfc(struct mlx5e_priv * priv,struct ethtool_rxnfc * info,u32 * rule_locs)25*9c2c1c5eSLama Kayal static inline int mlx5e_ethtool_get_rxnfc(struct mlx5e_priv *priv,
26*9c2c1c5eSLama Kayal 					  struct ethtool_rxnfc *info, u32 *rule_locs)
27*9c2c1c5eSLama Kayal { return -EOPNOTSUPP; }
28*9c2c1c5eSLama Kayal #endif
29*9c2c1c5eSLama Kayal #endif
30