3b368313e1ff641d0c65ee39ba02d86422d4f09e
[dpdk.git] / drivers / net / bnxt / tf_core / tf_device.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019-2020 Broadcom
3  * All rights reserved.
4  */
5
6 #include "tf_device.h"
7 #include "tf_device_p4.h"
8 #include "tfp.h"
9 #include "bnxt.h"
10
11 struct tf;
12
13 /**
14  * Device specific bind function
15  */
16 static int
17 dev_bind_p4(struct tf *tfp __rte_unused,
18             struct tf_session_resources *resources __rte_unused,
19             struct tf_dev_info *dev_info)
20 {
21         /* Initialize the modules */
22
23         dev_info->ops = &tf_dev_ops_p4;
24         return 0;
25 }
26
27 int
28 dev_bind(struct tf *tfp __rte_unused,
29          enum tf_device_type type,
30          struct tf_session_resources *resources,
31          struct tf_dev_info *dev_info)
32 {
33         switch (type) {
34         case TF_DEVICE_TYPE_WH:
35                 return dev_bind_p4(tfp,
36                                    resources,
37                                    dev_info);
38         default:
39                 TFP_DRV_LOG(ERR,
40                             "Device type not supported\n");
41                 return -ENOTSUP;
42         }
43 }
44
45 int
46 dev_unbind(struct tf *tfp __rte_unused,
47            struct tf_dev_info *dev_handle __rte_unused)
48 {
49         return 0;
50 }