common/mlx5: add bus-agnostic layer
[dpdk.git] / drivers / common / mlx5 / mlx5_common_private.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2021 Mellanox Technologies, Ltd
3  */
4
5 #ifndef MLX5_COMMON_PRIVATE_H
6 #define MLX5_COMMON_PRIVATE_H
7
8 #include <rte_pci.h>
9
10 #include "mlx5_common.h"
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */
15
16 /* Common bus driver: */
17
18 struct mlx5_common_device {
19         struct rte_device *dev;
20         TAILQ_ENTRY(mlx5_common_device) next;
21         uint32_t classes_loaded;
22 };
23
24 int mlx5_common_dev_probe(struct rte_device *eal_dev);
25 int mlx5_common_dev_remove(struct rte_device *eal_dev);
26 int mlx5_common_dev_dma_map(struct rte_device *dev, void *addr, uint64_t iova,
27                             size_t len);
28 int mlx5_common_dev_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova,
29                               size_t len);
30
31 /* Common PCI bus driver: */
32
33 void mlx5_common_driver_on_register_pci(struct mlx5_class_driver *driver);
34 bool mlx5_dev_pci_match(const struct mlx5_class_driver *drv,
35                         const struct rte_device *dev);
36
37 #ifdef __cplusplus
38 }
39 #endif /* __cplusplus */
40
41 #endif /* MLX5_COMMON_PRIVATE_H */