1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
6 #ifndef _TF_IDENTIFIER_H_
7 #define _TF_IDENTIFIER_H_
12 * The Identifier module provides processing of Identifiers.
17 * Number of identifier types in each of the configuration
20 uint16_t num_elements;
23 * TCAM configuration array
25 struct tf_rm_element_cfg *ident_cfg[TF_DIR_MAX];
29 * Identifier allcoation parameter definition
31 struct tf_ident_alloc_parms {
33 * [in] receive or transmit direction
37 * [in] Identifier type
39 enum tf_identifier_type ident_type;
41 * [out] Identifier allocated
47 * Identifier free parameter definition
49 struct tf_ident_free_parms {
51 * [in] receive or transmit direction
55 * [in] Identifier type
57 enum tf_identifier_type ident_type;
65 * @page ident Identity Management
69 * @ref tf_ident_unbind
77 * Initializes the Identifier module with the requested DBs. Must be
78 * invoked as the first thing before any of the access functions.
81 * Pointer to TF handle, used for HCAPI communication
84 * Pointer to parameters
87 * - (0) if successful.
88 * - (-EINVAL) on failure.
90 int tf_ident_bind(struct tf *tfp,
91 struct tf_ident_cfg *parms);
94 * Cleans up the private DBs and releases all the data.
97 * Pointer to TF handle, used for HCAPI communication
100 * Pointer to parameters
103 * - (0) if successful.
104 * - (-EINVAL) on failure.
106 int tf_ident_unbind(struct tf *tfp);
109 * Allocates a single identifier type.
112 * Pointer to TF handle, used for HCAPI communication
115 * Pointer to parameters
118 * - (0) if successful.
119 * - (-EINVAL) on failure.
121 int tf_ident_alloc(struct tf *tfp,
122 struct tf_ident_alloc_parms *parms);
125 * Free's a single identifier type.
128 * Pointer to TF handle, used for HCAPI communication
131 * Pointer to parameters
134 * - (0) if successful.
135 * - (-EINVAL) on failure.
137 int tf_ident_free(struct tf *tfp,
138 struct tf_ident_free_parms *parms);
140 #endif /* _TF_IDENTIFIER_H_ */