1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. */ 3 4 #ifndef __MLX5_MACSEC_H__ 5 #define __MLX5_MACSEC_H__ 6 7 #include <net/macsec.h> 8 #include <rdma/ib_cache.h> 9 #include <rdma/ib_addr.h> 10 #include "mlx5_ib.h" 11 12 #ifdef CONFIG_MLX5_MACSEC 13 struct mlx5_reserved_gids; 14 15 int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr); 16 void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr); 17 int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev); 18 void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev); 19 void mlx5r_macsec_event_register(struct mlx5_ib_dev *dev); 20 void mlx5r_macsec_event_unregister(struct mlx5_ib_dev *dev); 21 #else mlx5r_add_gid_macsec_operations(const struct ib_gid_attr * attr)22static inline int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr) { return 0; } mlx5r_del_gid_macsec_operations(const struct ib_gid_attr * attr)23static inline void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr) {} mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev * dev)24static inline int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev) { return 0; } mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev * dev)25static inline void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev) {} mlx5r_macsec_event_register(struct mlx5_ib_dev * dev)26static inline void mlx5r_macsec_event_register(struct mlx5_ib_dev *dev) {} mlx5r_macsec_event_unregister(struct mlx5_ib_dev * dev)27static inline void mlx5r_macsec_event_unregister(struct mlx5_ib_dev *dev) {} 28 #endif 29 #endif /* __MLX5_MACSEC_H__ */ 30