net/bnxt: support multi device
[dpdk.git] / drivers / net / bnxt / tf_core / tf_session.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019-2020 Broadcom
3  * All rights reserved.
4  */
5
6 int
7 tf_session_get_session(struct tf *tfp,
8                        struct tf_session *tfs)
9 {
10         if (tfp->session == NULL || tfp->session->core_data == NULL) {
11                 TFP_DRV_LOG(ERR, "Session not created\n");
12                 return -EINVAL;
13         }
14
15         tfs = (struct tf_session *)(tfp->session->core_data);
16
17         return 0;
18 }
19
20 int
21 tf_session_get_device(struct tf_session *tfs,
22                       struct tf_device *tfd)
23 {
24         if (tfs->dev == NULL) {
25                 TFP_DRV_LOG(ERR, "Device not created\n");
26                 return -EINVAL;
27         }
28         tfd = tfs->dev;
29
30         return 0;
31 }