WIP FPC-III support
[linux/fpc-iii.git] / drivers / infiniband / hw / mlx5 / devx.h
blob1f69866aed16ed664da158c2eaa9b5313177a477
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /*
3 * Copyright (c) 2019-2020, Mellanox Technologies inc. All rights reserved.
4 */
6 #ifndef _MLX5_IB_DEVX_H
7 #define _MLX5_IB_DEVX_H
9 #include "mlx5_ib.h"
11 #define MLX5_MAX_DESTROY_INBOX_SIZE_DW MLX5_ST_SZ_DW(delete_fte_in)
12 struct devx_obj {
13 struct mlx5_ib_dev *ib_dev;
14 u64 obj_id;
15 u32 dinlen; /* destroy inbox length */
16 u32 dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW];
17 u32 flags;
18 union {
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);
31 #else
32 static inline int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user)
34 return -EOPNOTSUPP;
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)
39 return 0;
41 static inline void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev)
44 #endif
45 #endif /* _MLX5_IB_DEVX_H */