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
22 static inline int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr) { return 0; }
23 static inline void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr) {}
24 static inline int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev) { return 0; }
25 static inline void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev) {}
26 static inline void mlx5r_macsec_event_register(struct mlx5_ib_dev *dev) {}
27 static inline void mlx5r_macsec_event_unregister(struct mlx5_ib_dev *dev) {}
28 #endif
29 #endif /* __MLX5_MACSEC_H__ */
30