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 <pthread.h> 9 10 #include "mlx5_prm.h" 11 #include "mlx5devx.h" 12 13 typedef struct mlx5_context { 14 devx_device_ctx *devx_ctx; 15 struct devx_device mlx5_dev; 16 struct devx_shutdown_event shutdown_event_obj; 17 } mlx5_context_st; 18 19 typedef struct { 20 devx_device_ctx *devx_ctx; 21 struct devx_obj_handle *obj; 22 } mlx5_devx_obj_st; 23 24 struct mlx5_devx_umem { 25 void *addr; 26 struct devx_obj_handle *umem_hdl; 27 uint32_t umem_id; 28 }; 29 30 struct mlx5_pd { 31 void *obj; 32 uint32_t pdn; 33 devx_device_ctx *devx_ctx; 34 }; 35 36 struct mlx5_devx_clock { 37 void *p_iseg_internal_timer; 38 u64 clock_frequency_hz; 39 int is_stable_clock_frequency; 40 }; 41 42 #define GET_DEVX_CTX(ctx) (((mlx5_context_st *)ctx)->devx_ctx) 43 #define GET_OBJ_CTX(obj) (((mlx5_devx_obj_st *)obj)->devx_ctx) 44 45 #endif /* __MLX5_WIN_ETX_H__ */ 46