blob: 2a66a427ef15a3eeb1ae7b10330e1a0a99866ac3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2020 Mellanox Technologies Ltd */
#ifndef __MLX5_SF_DEV_H__
#define __MLX5_SF_DEV_H__
#ifdef CONFIG_MLX5_SF
#include <linux/auxiliary_bus.h>
#define MLX5_SF_DEV_ID_NAME "sf"
struct mlx5_sf_dev {
struct auxiliary_device adev;
struct mlx5_core_dev *parent_mdev;
struct mlx5_core_dev *mdev;
phys_addr_t bar_base_addr;
u32 sfnum;
u16 fn_id;
};
void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev);
void mlx5_sf_dev_table_destroy(struct mlx5_core_dev *dev);
int mlx5_sf_driver_register(void);
void mlx5_sf_driver_unregister(void);
bool mlx5_sf_dev_allocated(const struct mlx5_core_dev *dev);
#else
static inline void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev)
{
}
static inline void mlx5_sf_dev_table_destroy(struct mlx5_core_dev *dev)
{
}
static inline int mlx5_sf_driver_register(void)
{
return 0;
}
static inline void mlx5_sf_driver_unregister(void)
{
}
static inline bool mlx5_sf_dev_allocated(const struct mlx5_core_dev *dev)
{
return false;
}
#endif
#endif
|