#include "hwrm_tf.h"
#include "tf_em.h"
+/* Logging defines */
+#define TF_RM_MSG_DEBUG 0
+
/**
* This is the MAX data we can transport across regular HWRM
*/
rc = tfp_send_msg_direct(tfp, &parms);
if (rc)
- return rc;
+ goto cleanup;
/* Process the response
* Should always get expected number of entries
"%s: QCAPS message size error, rc:%s\n",
tf_dir_2_str(dir),
strerror(-EINVAL));
- return -EINVAL;
+ rc = -EINVAL;
+ goto cleanup;
}
+#if (TF_RM_MSG_DEBUG == 1)
printf("size: %d\n", tfp_le_to_cpu_32(resp.size));
+#endif /* (TF_RM_MSG_DEBUG == 1) */
/* Post process the response */
data = (struct tf_rm_resc_req_entry *)qcaps_buf.va_addr;
+#if (TF_RM_MSG_DEBUG == 1)
printf("\nQCAPS\n");
+#endif /* (TF_RM_MSG_DEBUG == 1) */
for (i = 0; i < size; i++) {
query[i].type = tfp_le_to_cpu_32(data[i].type);
query[i].min = tfp_le_to_cpu_16(data[i].min);
query[i].max = tfp_le_to_cpu_16(data[i].max);
+#if (TF_RM_MSG_DEBUG == 1)
printf("type: %d(0x%x) %d %d\n",
query[i].type,
query[i].type,
query[i].min,
query[i].max);
+#endif /* (TF_RM_MSG_DEBUG == 1) */
}
*resv_strategy = resp.flags &
HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK;
+cleanup:
tf_msg_free_dma_buf(&qcaps_buf);
return rc;
dma_size = size * sizeof(struct tf_rm_resc_entry);
rc = tf_msg_alloc_dma_buf(&resv_buf, dma_size);
- if (rc)
+ if (rc) {
+ tf_msg_free_dma_buf(&req_buf);
return rc;
+ }
/* Populate the request */
req.fw_session_id = tfp_cpu_to_le_32(fw_session_id);
rc = tfp_send_msg_direct(tfp, &parms);
if (rc)
- return rc;
+ goto cleanup;
/* Process the response
* Should always get expected number of entries
"%s: Alloc message size error, rc:%s\n",
tf_dir_2_str(dir),
strerror(-EINVAL));
- return -EINVAL;
+ rc = -EINVAL;
+ goto cleanup;
}
+#if (TF_RM_MSG_DEBUG == 1)
printf("\nRESV\n");
printf("size: %d\n", tfp_le_to_cpu_32(resp.size));
+#endif /* (TF_RM_MSG_DEBUG == 1) */
/* Post process the response */
resv_data = (struct tf_rm_resc_entry *)resv_buf.va_addr;
resv[i].start = tfp_le_to_cpu_16(resv_data[i].start);
resv[i].stride = tfp_le_to_cpu_16(resv_data[i].stride);
+#if (TF_RM_MSG_DEBUG == 1)
printf("%d type: %d(0x%x) %d %d\n",
i,
resv[i].type,
resv[i].type,
resv[i].start,
resv[i].stride);
+#endif /* (TF_RM_MSG_DEBUG == 1) */
}
+cleanup:
tf_msg_free_dma_buf(&req_buf);
tf_msg_free_dma_buf(&resv_buf);
parms.mailbox = TF_KONG_MB;
rc = tfp_send_msg_direct(tfp, &parms);
- if (rc)
- return rc;
tf_msg_free_dma_buf(&resv_buf);
struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);
struct tf_em_64b_entry *em_result =
(struct tf_em_64b_entry *)em_parms->em_record;
- uint32_t flags;
+ uint16_t flags;
req.fw_session_id =
tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
struct tfp_send_msg_parms parms = { 0 };
struct hwrm_tf_em_delete_input req = { 0 };
struct hwrm_tf_em_delete_output resp = { 0 };
- uint32_t flags;
+ uint16_t flags;
struct tf_session *tfs =
(struct tf_session *)(tfp->session->core_data);
rc = tfp_send_msg_direct(tfp,
&mparms);
- if (rc)
- goto cleanup;
cleanup:
tf_msg_free_dma_buf(&buf);