FILE
dev.h
File preview with syntax highlighting.
linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.h
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 u16 fn_id; 20}; 21 22struct mlx5_sf_peer_devlink_event_ctx { 23 u16 fn_id; 24 struct devlink *devlink; 25 int err; 26}; 27 28int mlx5_sf_dev_notifier_init(struct mlx5_core_dev *dev); 29void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev); 30void mlx5_sf_dev_notifier_cleanup(struct mlx5_core_dev *dev); 31void mlx5_sf_dev_table_destroy(struct mlx5_core_dev *dev); 32 33int mlx5_sf_driver_register(void); 34void mlx5_sf_driver_unregister(void); 35 36bool mlx5_sf_dev_allocated(const struct mlx5_core_dev *dev); 37 38#else 39 40static inline int mlx5_sf_dev_notifier_init(struct mlx5_core_dev *dev) 41{ 42 return 0; 43} 44 45static inline void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev) 46{ 47} 48 49static inline void mlx5_sf_dev_notifier_cleanup(struct mlx5_core_dev *dev) 50{ 51} 52 53static inline void mlx5_sf_dev_table_destroy(struct mlx5_core_dev *dev) 54{ 55} 56 57static inline int mlx5_sf_driver_register(void) 58{ 59 return 0; 60} 61 62static inline void mlx5_sf_driver_unregister(void) 63{ 64} 65 66static inline bool mlx5_sf_dev_allocated(const struct mlx5_core_dev *dev) 67{ 68 return false; 69} 70 71#endif 72 73#endif
~/
Read-only file preview.