1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
9 #include <rte_common.h>
10 #include <hsi_struct_def_dpdk.h>
14 #include "tf_rm_new.h"
19 * Sends session open request to Firmware
22 * Pointer to session handle
25 * PCI name of the control channel
27 * [in/out] fw_session_id
28 * Pointer to the fw_session_id that is allocated on firmware side
33 int tf_msg_session_open(struct tf *tfp,
35 uint8_t *fw_session_id);
38 * Sends session close request to Firmware
41 * Pointer to session handle
44 * Pointer to the fw_session_id that is assigned to the session at
45 * time of session open
50 int tf_msg_session_attach(struct tf *tfp,
51 char *ctrl_channel_name,
52 uint8_t tf_fw_session_id);
55 * Sends session close request to Firmware
58 * Pointer to session handle
63 int tf_msg_session_close(struct tf *tfp);
66 * Sends session query config request to TF Firmware
68 int tf_msg_session_qcfg(struct tf *tfp);
71 * Sends session HW resource query capability request to TF Firmware
73 int tf_msg_session_hw_resc_qcaps(struct tf *tfp,
75 struct tf_rm_hw_query *hw_query);
78 * Sends session HW resource allocation request to TF Firmware
80 int tf_msg_session_hw_resc_alloc(struct tf *tfp,
82 struct tf_rm_hw_alloc *hw_alloc,
83 struct tf_rm_entry *hw_entry);
86 * Sends session HW resource free request to TF Firmware
88 int tf_msg_session_hw_resc_free(struct tf *tfp,
90 struct tf_rm_entry *hw_entry);
93 * Sends session HW resource flush request to TF Firmware
95 int tf_msg_session_hw_resc_flush(struct tf *tfp,
97 struct tf_rm_entry *hw_entry);
100 * Sends session SRAM resource query capability request to TF Firmware
102 int tf_msg_session_sram_resc_qcaps(struct tf *tfp,
104 struct tf_rm_sram_query *sram_query);
107 * Sends session SRAM resource allocation request to TF Firmware
109 int tf_msg_session_sram_resc_alloc(struct tf *tfp,
111 struct tf_rm_sram_alloc *sram_alloc,
112 struct tf_rm_entry *sram_entry);
115 * Sends session SRAM resource free request to TF Firmware
117 int tf_msg_session_sram_resc_free(struct tf *tfp,
119 struct tf_rm_entry *sram_entry);
122 * Sends session SRAM resource flush request to TF Firmware
124 int tf_msg_session_sram_resc_flush(struct tf *tfp,
126 struct tf_rm_entry *sram_entry);
129 * Sends session HW resource query capability request to TF Firmware
132 * Pointer to TF handle
135 * Receive or Transmit direction
138 * Number of elements in the query. Should be set to the max
139 * elements for the device type
142 * Pointer to an array of query elements
144 * [out] resv_strategy
145 * Pointer to the reservation strategy
148 * 0 on Success else internal Truflow error
150 int tf_msg_session_resc_qcaps(struct tf *tfp,
153 struct tf_rm_resc_req_entry *query,
154 enum tf_rm_resc_resv_strategy *resv_strategy);
157 * Sends session HW resource allocation request to TF Firmware
160 * Pointer to TF handle
163 * Receive or Transmit direction
166 * Number of elements in the req and resv arrays
169 * Pointer to an array of request elements
172 * Pointer to an array of reserved elements
175 * 0 on Success else internal Truflow error
177 int tf_msg_session_resc_alloc(struct tf *tfp,
180 struct tf_rm_resc_req_entry *request,
181 struct tf_rm_resc_entry *resv);
184 * Sends EM internal insert request to Firmware
186 int tf_msg_insert_em_internal_entry(struct tf *tfp,
187 struct tf_insert_em_entry_parms *params,
188 uint16_t *rptr_index,
190 uint8_t *num_of_entries);
192 * Sends EM internal delete request to Firmware
194 int tf_msg_delete_em_entry(struct tf *tfp,
195 struct tf_delete_em_entry_parms *em_parms);
197 * Sends EM mem register request to Firmware
199 int tf_msg_em_mem_rgtr(struct tf *tfp,
206 * Sends EM mem unregister request to Firmware
208 int tf_msg_em_mem_unrgtr(struct tf *tfp,
212 * Sends EM qcaps request to Firmware
214 int tf_msg_em_qcaps(struct tf *tfp,
216 struct tf_em_caps *em_caps);
219 * Sends EM config request to Firmware
221 int tf_msg_em_cfg(struct tf *tfp,
222 uint32_t num_entries,
223 uint16_t key0_ctx_id,
224 uint16_t key1_ctx_id,
225 uint16_t record_ctx_id,
227 uint8_t flush_interval,
231 * Sends EM operation request to Firmware
233 int tf_msg_em_op(struct tf *tfp,
238 * Sends tcam entry 'set' to the Firmware.
241 * Pointer to session handle
244 * Pointer to set parameters
247 * 0 on Success else internal Truflow error
249 int tf_msg_tcam_entry_set(struct tf *tfp,
250 struct tf_set_tcam_entry_parms *parms);
253 * Sends tcam entry 'free' to the Firmware.
256 * Pointer to session handle
259 * Pointer to free parameters
262 * 0 on Success else internal Truflow error
264 int tf_msg_tcam_entry_free(struct tf *tfp,
265 struct tf_free_tcam_entry_parms *parms);
268 * Sends Set message of a Table Type element to the firmware.
271 * Pointer to session handle
274 * Direction location of the element to set
277 * Type of the object to set
280 * Size of the data to set
291 int tf_msg_set_tbl_entry(struct tf *tfp,
293 enum tf_tbl_type type,
299 * Sends get message of a Table Type element to the firmware.
302 * Pointer to session handle
305 * Direction location of the element to get
308 * Type of the object to get
311 * Size of the data read
322 int tf_msg_get_tbl_entry(struct tf *tfp,
324 enum tf_tbl_type type,
330 * Sends bulk get message of a Table Type element to the firmware.
333 * Pointer to session handle
336 * Pointer to table get bulk parameters
339 * 0 on Success else internal Truflow error
341 int tf_msg_get_bulk_tbl_entry(struct tf *tfp,
342 struct tf_get_bulk_tbl_entry_parms *parms);
344 #endif /* _TF_MSG_H_ */