1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef TF_IF_TBL_TYPE_H_
7 #define TF_IF_TBL_TYPE_H_
13 * This is the constant used to define invalid CFA
14 * types across all devices.
16 #define CFA_IF_TBL_TYPE_INVALID 65535
21 * The IF Table module provides processing of Internal TF interface table types.
25 * IF table configuration enumeration.
27 enum tf_if_tbl_cfg_type {
39 * IF table configuration structure, used by the Device to configure
40 * how an individual TF type is configured in regard to the HCAPI type.
42 struct tf_if_tbl_cfg {
44 * IF table config controls how the DB for that element is
47 enum tf_if_tbl_cfg_type cfg_type;
50 * HCAPI Type for the element. Used for TF to HCAPI type
57 * Get HCAPI type parameters for a single element
59 struct tf_if_tbl_get_hcapi_parms {
61 * [in] IF Tbl DB Handle
65 * [in] DB Index, indicates which DB entry to perform the
70 * [out] Pointer to the hcapi type for the specified db_index
76 * Table configuration parameters
78 struct tf_if_tbl_cfg_parms {
80 * Number of table types in each of the configuration arrays
82 uint16_t num_elements;
84 * Table Type element configuration array
86 struct tf_if_tbl_cfg *cfg;
88 * Shadow table type configuration array
90 struct tf_shadow_if_tbl_cfg *shadow_cfg;
92 * Boolean controlling the request shadow copy.
98 * IF Table set parameters
100 struct tf_if_tbl_set_parms {
102 * [in] Receive or transmit direction
106 * [in] Type of object to set
108 enum tf_if_tbl_type type;
120 uint16_t data_sz_in_bytes;
122 * [in] Entry index to write to
128 * IF Table get parameters
130 struct tf_if_tbl_get_parms {
132 * [in] Receive or transmit direction
136 * [in] Type of object to get
138 enum tf_if_tbl_type type;
150 uint16_t data_sz_in_bytes;
152 * [in] Entry index to read
160 * @ref tf_if_tbl_bind
162 * @ref tf_if_tbl_unbind
168 * @ref tf_tbl_restore
171 * Initializes the Table module with the requested DBs. Must be
172 * invoked as the first thing before any of the access functions.
175 * Pointer to TF handle, used for HCAPI communication
178 * Pointer to Table configuration parameters
181 * - (0) if successful.
182 * - (-EINVAL) on failure.
184 int tf_if_tbl_bind(struct tf *tfp,
185 struct tf_if_tbl_cfg_parms *parms);
188 * Cleans up the private DBs and releases all the data.
191 * Pointer to TF handle, used for HCAPI communication
194 * Pointer to parameters
197 * - (0) if successful.
198 * - (-EINVAL) on failure.
200 int tf_if_tbl_unbind(struct tf *tfp);
203 * Configures the requested element by sending a firmware request which
204 * then installs it into the device internal structures.
207 * Pointer to TF handle, used for HCAPI communication
210 * Pointer to Interface Table set parameters
213 * - (0) if successful.
214 * - (-EINVAL) on failure.
216 int tf_if_tbl_set(struct tf *tfp,
217 struct tf_if_tbl_set_parms *parms);
220 * Retrieves the requested element by sending a firmware request to get
224 * Pointer to TF handle, used for HCAPI communication
227 * Pointer to Table get parameters
230 * - (0) if successful.
231 * - (-EINVAL) on failure.
233 int tf_if_tbl_get(struct tf *tfp,
234 struct tf_if_tbl_get_parms *parms);
236 #endif /* TF_IF_TBL_TYPE_H */