xref: /dpdk/drivers/net/bnxt/tf_core/v3/tfc_priv.h (revision 80317ff6adfde7f618a100098e068ad5512e8e22)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2022 Broadcom
3  * All rights reserved.
4  */
5 
6 #ifndef _TFC_PRIV_H_
7 #define _TFC_PRIV_H_
8 
9 #include <stdint.h>
10 #include "tfc.h"
11 
12 /**
13  * @page Common Utility functions
14  *
15  * @ref tfc_get_fid
16  *
17  * @ref tfc_get_pfid
18  *
19  * @ref tfc_bp_is_pf
20  *
21  * @ref tfc_bp_vf_max
22  */
23 /**
24  * Get the FID for this DPDK port/function.
25  *
26  * @param[in] tfcp
27  *   Pointer to TFC handle
28  *
29  * @param[out] fw_fid
30  *   The function ID
31  *
32  * @return
33  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
34  */
35 int tfc_get_fid(struct tfc *tfcp, uint16_t *fw_fid);
36 
37 /**
38  * Get the PFID for this DPDK port/function.
39  *
40  * @param[in] tfcp
41  *   Pointer to TFC handle
42  *
43  * @param[out] pfid
44  *   The Physical Function ID for this port/function
45  *
46  * @return
47  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
48  */
49 int tfc_get_pfid(struct tfc *tfcp, uint16_t *pfid);
50 
51 /**
52  * Is this DPDK port/function a PF?
53  *
54  * @param[in] tfcp
55  *   Pointer to TFC handle
56  *
57  * @param[out] is_pf
58  *   If true, the DPDK port is a PF (as opposed to a VF)
59  *
60  * @return
61  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
62  */
63 int tfc_bp_is_pf(struct tfc *tfcp, bool *is_pf);
64 
65 /**
66  * Get the maximum VF for the PF
67  *
68  * @param[in] tfcp
69  *   Pointer to TFC handle
70  *
71  * @param[out] max_vf
72  *   The maximum VF for the PF (only valid on a PF)
73  *
74  * @return
75  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
76  */
77 int tfc_bp_vf_max(struct tfc *tfcp, uint16_t *max_vf);
78 #endif  /* _TFC_PRIV_H_ */
79