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