1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright (c) 2019-2020, Mellanox Technologies inc. All rights reserved.
6 #ifndef _MLX5_IB_DEVX_H
7 #define _MLX5_IB_DEVX_H
11 #define MLX5_MAX_DESTROY_INBOX_SIZE_DW MLX5_ST_SZ_DW(delete_fte_in)
13 struct mlx5_ib_dev *ib_dev;
15 u32 dinlen; /* destroy inbox length */
16 u32 dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW];
19 struct mlx5_ib_devx_mr devx_mr;
20 struct mlx5_core_dct core_dct;
21 struct mlx5_core_cq core_cq;
22 u32 flow_counter_bulk_size;
24 struct list_head event_sub; /* holds devx_event_subscription entries */
26 #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
27 int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user);
28 void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid);
29 int mlx5_ib_devx_init(struct mlx5_ib_dev *dev);
30 void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev);
32 static inline int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user)
36 static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid) {}
37 static inline int mlx5_ib_devx_init(struct mlx5_ib_dev *dev)
41 static inline void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev)
45 #endif /* _MLX5_IB_DEVX_H */