Linux 6.9-rc1
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / ecpf.h
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2019 Mellanox Technologies. */
3
4 #ifndef __MLX5_ECPF_H__
5 #define __MLX5_ECPF_H__
6
7 #include <linux/mlx5/driver.h>
8 #include "mlx5_core.h"
9
10 #ifdef CONFIG_MLX5_ESWITCH
11
12 enum {
13         MLX5_ECPU_BIT_NUM = 23,
14 };
15
16 bool mlx5_read_embedded_cpu(struct mlx5_core_dev *dev);
17 int mlx5_ec_init(struct mlx5_core_dev *dev);
18 void mlx5_ec_cleanup(struct mlx5_core_dev *dev);
19
20 int mlx5_cmd_host_pf_enable_hca(struct mlx5_core_dev *dev);
21 int mlx5_cmd_host_pf_disable_hca(struct mlx5_core_dev *dev);
22
23 #else  /* CONFIG_MLX5_ESWITCH */
24
25 static inline bool
26 mlx5_read_embedded_cpu(struct mlx5_core_dev *dev) { return false; }
27 static inline int mlx5_ec_init(struct mlx5_core_dev *dev) { return 0; }
28 static inline void mlx5_ec_cleanup(struct mlx5_core_dev *dev) {}
29
30 #endif /* CONFIG_MLX5_ESWITCH */
31
32 #endif /* __MLX5_ECPF_H__ */