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"
20 * Sends session open request to Firmware
23 * Pointer to session handle
26 * PCI name of the control channel
28 * [in/out] fw_session_id
29 * Pointer to the fw_session_id that is allocated on firmware side
34 int tf_msg_session_open(struct tf *tfp,
36 uint8_t *fw_session_id);
39 * Sends session close request to Firmware
42 * Pointer to session handle
45 * Pointer to the fw_session_id that is assigned to the session at
46 * time of session open
51 int tf_msg_session_attach(struct tf *tfp,
52 char *ctrl_channel_name,
53 uint8_t tf_fw_session_id);
56 * Sends session close request to Firmware
59 * Pointer to session handle
64 int tf_msg_session_close(struct tf *tfp);
67 * Sends session query config request to TF Firmware
69 int tf_msg_session_qcfg(struct tf *tfp);
72 * Sends session HW resource query capability request to TF Firmware
74 int tf_msg_session_hw_resc_qcaps(struct tf *tfp,
76 struct tf_rm_hw_query *hw_query);
79 * Sends session HW resource allocation request to TF Firmware
81 int tf_msg_session_hw_resc_alloc(struct tf *tfp,
83 struct tf_rm_hw_alloc *hw_alloc,
84 struct tf_rm_entry *hw_entry);
87 * Sends session HW resource free request to TF Firmware
89 int tf_msg_session_hw_resc_free(struct tf *tfp,
91 struct tf_rm_entry *hw_entry);
94 * Sends session HW resource flush request to TF Firmware
96 int tf_msg_session_hw_resc_flush(struct tf *tfp,
98 struct tf_rm_entry *hw_entry);
101 * Sends session SRAM resource query capability request to TF Firmware
103 int tf_msg_session_sram_resc_qcaps(struct tf *tfp,
105 struct tf_rm_sram_query *sram_query);
108 * Sends session SRAM resource allocation request to TF Firmware
110 int tf_msg_session_sram_resc_alloc(struct tf *tfp,
112 struct tf_rm_sram_alloc *sram_alloc,
113 struct tf_rm_entry *sram_entry);
116 * Sends session SRAM resource free request to TF Firmware
118 int tf_msg_session_sram_resc_free(struct tf *tfp,
120 struct tf_rm_entry *sram_entry);
123 * Sends session SRAM resource flush request to TF Firmware
125 int tf_msg_session_sram_resc_flush(struct tf *tfp,
127 struct tf_rm_entry *sram_entry);
130 * Sends session HW resource query capability request to TF Firmware
133 * Pointer to TF handle
136 * Receive or Transmit direction
139 * Number of elements in the query. Should be set to the max
140 * elements for the device type
143 * Pointer to an array of query elements
145 * [out] resv_strategy
146 * Pointer to the reservation strategy
149 * 0 on Success else internal Truflow error
151 int tf_msg_session_resc_qcaps(struct tf *tfp,
154 struct tf_rm_resc_req_entry *query,
155 enum tf_rm_resc_resv_strategy *resv_strategy);
158 * Sends session HW resource allocation request to TF Firmware
161 * Pointer to TF handle
164 * Receive or Transmit direction
167 * Number of elements in the req and resv arrays
170 * Pointer to an array of request elements
173 * Pointer to an array of reserved elements
176 * 0 on Success else internal Truflow error
178 int tf_msg_session_resc_alloc(struct tf *tfp,
181 struct tf_rm_resc_req_entry *request,
182 struct tf_rm_resc_entry *resv);
185 * Sends EM internal insert request to Firmware
187 int tf_msg_insert_em_internal_entry(struct tf *tfp,
188 struct tf_insert_em_entry_parms *params,
189 uint16_t *rptr_index,
191 uint8_t *num_of_entries);
193 * Sends EM internal delete request to Firmware
195 int tf_msg_delete_em_entry(struct tf *tfp,
196 struct tf_delete_em_entry_parms *em_parms);
198 * Sends EM mem register request to Firmware
200 int tf_msg_em_mem_rgtr(struct tf *tfp,
207 * Sends EM mem unregister request to Firmware
209 int tf_msg_em_mem_unrgtr(struct tf *tfp,
213 * Sends EM qcaps request to Firmware
215 int tf_msg_em_qcaps(struct tf *tfp,
217 struct tf_em_caps *em_caps);
220 * Sends EM config request to Firmware
222 int tf_msg_em_cfg(struct tf *tfp,
223 uint32_t num_entries,
224 uint16_t key0_ctx_id,
225 uint16_t key1_ctx_id,
226 uint16_t record_ctx_id,
228 uint8_t flush_interval,
232 * Sends EM operation request to Firmware
234 int tf_msg_em_op(struct tf *tfp,
239 * Sends tcam entry 'set' to the Firmware.
242 * Pointer to session handle
245 * Pointer to set parameters
248 * 0 on Success else internal Truflow error
250 int tf_msg_tcam_entry_set(struct tf *tfp,
251 struct tf_tcam_set_parms *parms);
254 * Sends tcam entry 'free' to the Firmware.
257 * Pointer to session handle
260 * Pointer to free parameters
263 * 0 on Success else internal Truflow error
265 int tf_msg_tcam_entry_free(struct tf *tfp,
266 struct tf_tcam_free_parms *parms);
269 * Sends Set message of a Table Type element to the firmware.
272 * Pointer to session handle
275 * Direction location of the element to set
278 * Type of the object to set
281 * Size of the data to set
292 int tf_msg_set_tbl_entry(struct tf *tfp,
294 enum tf_tbl_type type,
300 * Sends get message of a Table Type element to the firmware.
303 * Pointer to session handle
306 * Direction location of the element to get
309 * Type of the object to get
312 * Size of the data read
323 int tf_msg_get_tbl_entry(struct tf *tfp,
325 enum tf_tbl_type type,
331 * Sends bulk get message of a Table Type element to the firmware.
334 * Pointer to session handle
337 * Pointer to table get bulk parameters
340 * 0 on Success else internal Truflow error
342 int tf_msg_bulk_get_tbl_entry(struct tf *tfp,
343 struct tf_bulk_get_tbl_entry_parms *parms);
345 #endif /* _TF_MSG_H_ */