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 * @page ident Identity Management
107 * @ref tf_ident_unbind
109 * @ref tf_ident_alloc
115 * Initializes the Identifier module with the requested DBs. Must be
116 * invoked as the first thing before any of the access functions.
119 * Pointer to TF handle, used for HCAPI communication
122 * Pointer to parameters
125 * - (0) if successful.
126 * - (-EINVAL) on failure.
128 int tf_ident_bind(struct tf *tfp,
129 struct tf_ident_cfg_parms *parms);
132 * Cleans up the private DBs and releases all the data.
135 * Pointer to TF handle, used for HCAPI communication
138 * Pointer to parameters
141 * - (0) if successful.
142 * - (-EINVAL) on failure.
144 int tf_ident_unbind(struct tf *tfp);
147 * Allocates a single identifier type.
150 * Pointer to TF handle, used for HCAPI communication
153 * Pointer to parameters
156 * - (0) if successful.
157 * - (-EINVAL) on failure.
159 int tf_ident_alloc(struct tf *tfp,
160 struct tf_ident_alloc_parms *parms);
163 * Free's a single identifier type.
166 * Pointer to TF handle, used for HCAPI communication
169 * Pointer to parameters
172 * - (0) if successful.
173 * - (-EINVAL) on failure.
175 int tf_ident_free(struct tf *tfp,
176 struct tf_ident_free_parms *parms);
179 * Search a single identifier type.
182 * Pointer to TF handle, used for HCAPI communication
185 * Pointer to parameters
188 * - (0) if successful.
189 * - (-EINVAL) on failure.
191 int tf_ident_search(struct tf *tfp,
192 struct tf_ident_search_parms *parms);
194 #endif /* _TF_IDENTIFIER_H_ */