1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
12 #include "tf_session.h"
15 #include "tf_msg_common.h"
17 #include "hsi_struct_def_dpdk.h"
21 * Sends session open request to TF Firmware
24 tf_msg_session_open(struct tf *tfp,
26 uint8_t *fw_session_id)
29 struct hwrm_tf_session_open_input req = { 0 };
30 struct hwrm_tf_session_open_output resp = { 0 };
31 struct tfp_send_msg_parms parms = { 0 };
33 /* Populate the request */
34 memcpy(&req.session_name, ctrl_chan_name, TF_SESSION_NAME_MAX);
36 parms.tf_type = HWRM_TF_SESSION_OPEN;
37 parms.req_data = (uint32_t *)&req;
38 parms.req_size = sizeof(req);
39 parms.resp_data = (uint32_t *)&resp;
40 parms.resp_size = sizeof(resp);
41 parms.mailbox = TF_KONG_MB;
43 rc = tfp_send_msg_direct(tfp,
48 *fw_session_id = resp.fw_session_id;
54 * Sends session query config request to TF Firmware
57 tf_msg_session_qcfg(struct tf *tfp)
60 struct hwrm_tf_session_qcfg_input req = { 0 };
61 struct hwrm_tf_session_qcfg_output resp = { 0 };
62 struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);
63 struct tfp_send_msg_parms parms = { 0 };
65 /* Populate the request */
67 tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
69 parms.tf_type = HWRM_TF_SESSION_QCFG,
70 parms.req_data = (uint32_t *)&req;
71 parms.req_size = sizeof(req);
72 parms.resp_data = (uint32_t *)&resp;
73 parms.resp_size = sizeof(resp);
74 parms.mailbox = TF_KONG_MB;
76 rc = tfp_send_msg_direct(tfp,