1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef TF_GLOBAL_CFG_H_
7 #define TF_GLOBAL_CFG_H_
13 * The global cfg module provides processing of global cfg types.
18 /* Internal type not available to user
19 * but available internally within Truflow
21 enum tf_global_config_internal_type {
22 TF_GLOBAL_CFG_INTERNAL_PARIF_2_PF = TF_GLOBAL_CFG_TYPE_MAX,
23 TF_GLOBAL_CFG_INTERNAL_TYPE_MAX
27 * Global cfg configuration enumeration.
29 enum tf_global_cfg_cfg_type {
33 TF_GLOBAL_CFG_CFG_NULL,
37 TF_GLOBAL_CFG_CFG_HCAPI,
41 * Global cfg configuration structure, used by the Device to configure
42 * how an individual global cfg type is configured in regard to the HCAPI type.
44 struct tf_global_cfg_cfg {
46 * Global cfg config controls how the DB for that element is
49 enum tf_global_cfg_cfg_type cfg_type;
52 * HCAPI Type for the element. Used for TF to HCAPI type
59 * Global Cfg configuration parameters
61 struct tf_global_cfg_cfg_parms {
63 * Number of table types in the configuration array
65 uint16_t num_elements;
67 * Table Type element configuration array
69 struct tf_global_cfg_cfg *cfg;
75 * @ref tf_global_cfg_bind
77 * @ref tf_global_cfg_unbind
79 * @ref tf_global_cfg_set
81 * @ref tf_global_cfg_get
85 * Initializes the Global Cfg module with the requested DBs. Must be
86 * invoked as the first thing before any of the access functions.
89 * Pointer to TF handle
92 * Pointer to Global Cfg configuration parameters
95 * - (0) if successful.
96 * - (-EINVAL) on failure.
99 tf_global_cfg_bind(struct tf *tfp,
100 struct tf_global_cfg_cfg_parms *parms);
103 * Cleans up the private DBs and releases all the data.
106 * Pointer to TF handle
109 * Pointer to Global Cfg configuration parameters
112 * - (0) if successful.
113 * - (-EINVAL) on failure.
116 tf_global_cfg_unbind(struct tf *tfp);
119 * Updates the global configuration table
122 * Pointer to TF handle, used for HCAPI communication
125 * Pointer to global cfg parameters
128 * - (0) if successful.
129 * - (-EINVAL) on failure.
131 int tf_global_cfg_set(struct tf *tfp,
132 struct tf_global_cfg_parms *parms);
135 * Get global configuration
138 * Pointer to TF handle, used for HCAPI communication
141 * Pointer to global cfg parameters
144 * - (0) if successful.
145 * - (-EINVAL) on failure.
147 int tf_global_cfg_get(struct tf *tfp,
148 struct tf_global_cfg_parms *parms);
150 #endif /* TF_GLOBAL_CFG_H */