1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef _TF_TCAM_SHARED_H_
7 #define _TF_TCAM_SHARED_H_
13 * @page tcam_shared TCAM SHARED
15 * @ref tf_tcam_shared_bind
17 * @ref tf_tcam_shared_unbind
19 * @ref tf_tcam_shared_alloc
21 * @ref tf_tcam_shared_free
23 * @ref tf_tcam_shared_set
25 * @ref tf_tcam_shared_get
30 * Initializes the TCAM shared module with the requested DBs. Must be
31 * invoked as the first thing before any of the access functions.
34 * Pointer to the truflow handle
37 * Pointer to parameters
40 * - (0) if successful.
41 * - (-EINVAL) on failure.
43 int tf_tcam_shared_bind(struct tf *tfp,
44 struct tf_tcam_cfg_parms *parms);
47 * Cleans up the private DBs and releases all the data.
50 * Pointer to the truflow handle
53 * Pointer to parameters
56 * - (0) if successful.
57 * - (-EINVAL) on failure.
59 int tf_tcam_shared_unbind(struct tf *tfp);
62 * Allocates the requested tcam type from the internal RM DB.
65 * Pointer to the truflow handle
68 * Pointer to parameters
71 * - (0) if successful.
72 * - (-EINVAL) on failure.
74 int tf_tcam_shared_alloc(struct tf *tfp,
75 struct tf_tcam_alloc_parms *parms);
78 * Free's the requested table type and returns it to the DB.
81 * Pointer to the truflow handle
84 * Pointer to parameters
87 * - (0) if successful.
88 * - (-EINVAL) on failure.
90 int tf_tcam_shared_free(struct tf *tfp,
91 struct tf_tcam_free_parms *parms);
94 * Configures the requested element by sending a firmware request which
95 * then installs it into the device internal structures.
98 * Pointer to the truflow handle
101 * Pointer to parameters
104 * - (0) if successful.
105 * - (-EINVAL) on failure.
107 int tf_tcam_shared_set(struct tf *tfp,
108 struct tf_tcam_set_parms *parms);
111 * Retrieves the requested element by sending a firmware request to get
115 * Pointer to the truflow handle
118 * Pointer to parameters
121 * - (0) if successful.
122 * - (-EINVAL) on failure.
124 int tf_tcam_shared_get(struct tf *tfp,
125 struct tf_tcam_get_parms *parms);
127 #endif /* _TF_TCAM_SHARED_H */