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>
18 /* HWRM Direct messages */
21 * Sends session open request to Firmware
24 * Pointer to session handle
27 * PCI name of the control channel
29 * [in/out] fw_session_id
30 * Pointer to the fw_session_id that is allocated on firmware side
33 * 0 on Success else internal Truflow error
35 int tf_msg_session_open(struct tf *tfp,
37 uint8_t *fw_session_id,
38 uint8_t *fw_session_client_id);
41 * Sends session close request to Firmware
44 * Pointer to session handle
47 * PCI name of the control channel
50 * Pointer to the fw_session_id that is assigned to the session at
51 * time of session open
54 * 0 on Success else internal Truflow error
56 int tf_msg_session_attach(struct tf *tfp,
57 char *ctrl_channel_name,
58 uint8_t tf_fw_session_id);
61 * Sends session client register request to Firmware
64 * Pointer to session handle
67 * PCI name of the control channel
69 * [in/out] fw_session_client_id
70 * Pointer to the fw_session_client_id that is allocated on firmware
74 * 0 on Success else internal Truflow error
76 int tf_msg_session_client_register(struct tf *tfp,
77 char *ctrl_channel_name,
78 uint8_t *fw_session_client_id);
81 * Sends session client unregister request to Firmware
84 * Pointer to session handle
86 * [in/out] fw_session_client_id
87 * Pointer to the fw_session_client_id that is allocated on firmware
91 * 0 on Success else internal Truflow error
93 int tf_msg_session_client_unregister(struct tf *tfp,
94 uint8_t fw_session_client_id);
97 * Sends session close request to Firmware
100 * Pointer to session handle
103 * 0 on Success else internal Truflow error
105 int tf_msg_session_close(struct tf *tfp);
108 * Sends session query config request to TF Firmware
111 * Pointer to session handle
114 * 0 on Success else internal Truflow error
116 int tf_msg_session_qcfg(struct tf *tfp);
119 * Sends session HW resource query capability request to TF Firmware
122 * Pointer to TF handle
125 * Receive or Transmit direction
128 * Number of elements in the query. Should be set to the max
129 * elements for the device type
132 * Pointer to an array of query elements
134 * [out] resv_strategy
135 * Pointer to the reservation strategy
138 * 0 on Success else internal Truflow error
140 int tf_msg_session_resc_qcaps(struct tf *tfp,
143 struct tf_rm_resc_req_entry *query,
144 enum tf_rm_resc_resv_strategy *resv_strategy);
147 * Sends session HW resource allocation request to TF Firmware
150 * Pointer to TF handle
153 * Receive or Transmit direction
156 * Number of elements in the req and resv arrays
159 * Pointer to an array of request elements
162 * Pointer to an array of reserved elements
165 * 0 on Success else internal Truflow error
167 int tf_msg_session_resc_alloc(struct tf *tfp,
170 struct tf_rm_resc_req_entry *request,
171 struct tf_rm_resc_entry *resv);
174 * Sends session resource flush request to TF Firmware
177 * Pointer to TF handle
180 * Receive or Transmit direction
183 * Number of elements in the req and resv arrays
186 * Pointer to an array of reserved elements that needs to be flushed
189 * 0 on Success else internal Truflow error
191 int tf_msg_session_resc_flush(struct tf *tfp,
194 struct tf_rm_resc_entry *resv);
196 * Sends EM internal insert request to Firmware
199 * Pointer to TF handle
202 * Pointer to em insert parameter list
210 * [in] num_of_entries
211 * Number of entries to insert
214 * 0 on Success else internal Truflow error
216 int tf_msg_insert_em_internal_entry(struct tf *tfp,
217 struct tf_insert_em_entry_parms *params,
218 uint16_t *rptr_index,
220 uint8_t *num_of_entries);
222 * Sends EM internal delete request to Firmware
225 * Pointer to TF handle
228 * Pointer to em delete parameters
231 * 0 on Success else internal Truflow error
233 int tf_msg_delete_em_entry(struct tf *tfp,
234 struct tf_delete_em_entry_parms *em_parms);
237 * Sends EM mem register request to Firmware
240 * Pointer to TF handle
249 * DMA Address for the memory page
255 * 0 on Success else internal Truflow error
257 int tf_msg_em_mem_rgtr(struct tf *tfp,
264 * Sends EM mem unregister request to Firmware
267 * Pointer to TF handle
273 * 0 on Success else internal Truflow error
275 int tf_msg_em_mem_unrgtr(struct tf *tfp,
279 * Sends EM qcaps request to Firmware
282 * Pointer to TF handle
285 * Receive or Transmit direction
288 * Pointer to EM capabilities
291 * 0 on Success else internal Truflow error
293 int tf_msg_em_qcaps(struct tf *tfp,
295 struct tf_em_caps *em_caps);
298 * Sends EM config request to Firmware
301 * Pointer to TF handle
304 * EM Table, key 0, number of entries to configure
307 * EM Table, Key 0 context id
310 * EM Table, Key 1 context id
313 * EM Table, Record context id
316 * EM Table, EFC Table context id
318 * [in] flush_interval
319 * Flush pending HW cached flows every 1/10th of value set in
320 * seconds, both idle and active flows are flushed from the HW
321 * cache. If set to 0, this feature will be disabled.
324 * Receive or Transmit direction
327 * 0 on Success else internal Truflow error
329 int tf_msg_em_cfg(struct tf *tfp,
330 uint32_t num_entries,
331 uint16_t key0_ctx_id,
332 uint16_t key1_ctx_id,
333 uint16_t record_ctx_id,
335 uint8_t flush_interval,
339 * Sends EM operation request to Firmware
342 * Pointer to TF handle
345 * Receive or Transmit direction
351 * 0 on Success else internal Truflow error
353 int tf_msg_em_op(struct tf *tfp,
358 * Sends tcam entry 'set' to the Firmware.
361 * Pointer to session handle
364 * Pointer to set parameters
367 * 0 on Success else internal Truflow error
369 int tf_msg_tcam_entry_set(struct tf *tfp,
370 struct tf_tcam_set_parms *parms);
373 * Sends tcam entry 'free' to the Firmware.
376 * Pointer to session handle
379 * Pointer to free parameters
382 * 0 on Success else internal Truflow error
384 int tf_msg_tcam_entry_free(struct tf *tfp,
385 struct tf_tcam_free_parms *parms);
388 * Sends Set message of a Table Type element to the firmware.
391 * Pointer to session handle
394 * Direction location of the element to set
397 * Type of the object to set
400 * Size of the data to set
411 int tf_msg_set_tbl_entry(struct tf *tfp,
419 * Sends get message of a Table Type element to the firmware.
422 * Pointer to session handle
425 * Direction location of the element to get
428 * Type of the object to get
431 * Size of the data read
442 int tf_msg_get_tbl_entry(struct tf *tfp,
449 /* HWRM Tunneled messages */
452 * Sends bulk get message of a Table Type element to the firmware.
455 * Pointer to session handle
458 * Pointer to table get bulk parameters
461 * 0 on Success else internal Truflow error
463 int tf_msg_bulk_get_tbl_entry(struct tf *tfp,
466 uint32_t starting_idx,
467 uint16_t num_entries,
468 uint16_t entry_sz_in_bytes,
469 uint64_t physical_mem_addr);
472 * Sends Set message of a IF Table Type element to the firmware.
475 * Pointer to session handle
478 * Pointer to IF table set parameters
481 * 0 on Success else internal Truflow error
483 int tf_msg_set_if_tbl_entry(struct tf *tfp,
484 struct tf_if_tbl_set_parms *params);
487 * Sends get message of a IF Table Type element to the firmware.
490 * Pointer to session handle
493 * Pointer to IF table get parameters
496 * 0 on Success else internal Truflow error
498 int tf_msg_get_if_tbl_entry(struct tf *tfp,
499 struct tf_if_tbl_get_parms *params);
501 #endif /* _TF_MSG_H_ */