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
13struct mlx5_reserved_gids;
14
15int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr);
16void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr);
17int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev);
18void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev);
19void mlx5r_macsec_event_register(struct mlx5_ib_dev *dev);
20void mlx5r_macsec_event_unregister(struct mlx5_ib_dev *dev);
21#else
22static inline int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr) { return 0; }
23static inline void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr) {}
24static inline int mlx5r_macsec_init_gids_and_devlist(struct mlx5_ib_dev *dev) { return 0; }
25static inline void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev) {}
26static inline void mlx5r_macsec_event_register(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