1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef _TF_IDENTIFIER_H_
7 #define _TF_IDENTIFIER_H_
12 * The Identifier module provides processing of Identifiers.
15 struct tf_ident_cfg_parms {
17 * [in] Number of identifier types in each of the
18 * configuration arrays
20 uint16_t num_elements;
22 * [in] Identifier configuration array
24 struct tf_rm_element_cfg *cfg;
26 * [in] Boolean controlling the request shadow copy.
30 * [in] Session resource allocations
32 struct tf_session_resources *resources;
36 * Identifier allocation parameter definition
38 struct tf_ident_alloc_parms {
40 * [in] receive or transmit direction
44 * [in] Identifier type
46 enum tf_identifier_type type;
48 * [out] Identifier allocated
54 * Identifier free parameter definition
56 struct tf_ident_free_parms {
58 * [in] receive or transmit direction
62 * [in] Identifier type
64 enum tf_identifier_type type;
71 * [out] Current refcnt after free
77 * Identifier search parameter definition
79 struct tf_ident_search_parms {
81 * [in] receive or transmit direction
85 * [in] Identifier type
87 enum tf_identifier_type type;
89 * [in] Identifier data to search for
93 * [out] Set if matching identifier found
97 * [out] Current ref count after allocation
103 * Identifier database
105 * Identifier rm database
109 struct rm_db *ident_db[TF_DIR_MAX];
113 * @page ident Identity Management
117 * @ref tf_ident_unbind
119 * @ref tf_ident_alloc
125 * Initializes the Identifier module with the requested DBs. Must be
126 * invoked as the first thing before any of the access functions.
129 * Pointer to TF handle, used for HCAPI communication
132 * Pointer to parameters
135 * - (0) if successful.
136 * - (-EINVAL) on failure.
138 int tf_ident_bind(struct tf *tfp,
139 struct tf_ident_cfg_parms *parms);
142 * Cleans up the private DBs and releases all the data.
145 * Pointer to TF handle, used for HCAPI communication
148 * Pointer to parameters
151 * - (0) if successful.
152 * - (-EINVAL) on failure.
154 int tf_ident_unbind(struct tf *tfp);
157 * Allocates a single identifier type.
160 * Pointer to TF handle, used for HCAPI communication
163 * Pointer to parameters
166 * - (0) if successful.
167 * - (-EINVAL) on failure.
169 int tf_ident_alloc(struct tf *tfp,
170 struct tf_ident_alloc_parms *parms);
173 * Free's a single identifier type.
176 * Pointer to TF handle, used for HCAPI communication
179 * Pointer to parameters
182 * - (0) if successful.
183 * - (-EINVAL) on failure.
185 int tf_ident_free(struct tf *tfp,
186 struct tf_ident_free_parms *parms);
189 * Search a single identifier type.
192 * Pointer to TF handle, used for HCAPI communication
195 * Pointer to parameters
198 * - (0) if successful.
199 * - (-EINVAL) on failure.
201 int tf_ident_search(struct tf *tfp,
202 struct tf_ident_search_parms *parms);
205 * Retrieves the allocated resource info
208 * Pointer to TF handle, used for HCAPI communication
211 * Pointer to parameters
214 * - (0) if successful.
215 * - (-EINVAL) on failure.
217 int tf_ident_get_resc_info(struct tf *tfp,
218 struct tf_identifier_resource_info *parms);
220 #endif /* _TF_IDENTIFIER_H_ */