xref: /dpdk/drivers/common/mlx5/windows/mlx5_win_ext.h (revision 0dff3f26d6faad4e51f75e5245f0387ee9bb0c6d)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (C) Mellanox Technologies, Ltd. 2001-2020.
3  */
4 
5 #ifndef __MLX5_WIN_ETX_H__
6 #define __MLX5_WIN_ETX_H__
7 
8 #include "mlx5_prm.h"
9 #include "mlx5devx.h"
10 
11 typedef struct mlx5_context {
12 	devx_device_ctx        *devx_ctx;
13 	struct devx_device mlx5_dev;
14 	struct devx_shutdown_event shutdown_event_obj;
15 } mlx5_context_st;
16 
17 typedef struct {
18 	devx_device_ctx *devx_ctx;
19 	struct devx_obj_handle *obj;
20 } mlx5_devx_obj_st;
21 
22 struct mlx5_devx_umem {
23 	void                   *addr;
24 	struct devx_obj_handle *umem_hdl;
25 	uint32_t                umem_id;
26 };
27 
28 struct mlx5_pd {
29 	void                   *obj;
30 	uint32_t                pdn;
31 	devx_device_ctx        *devx_ctx;
32 };
33 
34 struct mlx5_devx_clock {
35 	void *p_iseg_internal_timer;
36 	u64 clock_frequency_hz;
37 	int is_stable_clock_frequency;
38 };
39 
40 #define GET_DEVX_CTX(ctx) (((mlx5_context_st *)ctx)->devx_ctx)
41 #define GET_OBJ_CTX(obj)  (((mlx5_devx_obj_st *)obj)->devx_ctx)
42 
43 #endif /* __MLX5_WIN_ETX_H__ */
44