net: fsl-mc: sync DPNI MC APIs
Sync the Data Path Network Interface APIs to their latest form, this
means the layout of each command is created based on structures which
clearly describe the endianness of each field rather than some macros.
The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 78a40f2..984616f 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1353,10 +1353,9 @@
static int dpni_init(void)
{
- int err;
- uint8_t cfg_buf[256] = {0};
- struct dpni_cfg dpni_cfg;
+ struct dpni_cfg dpni_cfg = {0};
uint16_t major_ver, minor_ver;
+ int err;
dflt_dpni = calloc(sizeof(struct fsl_dpni_obj), 1);
if (!dflt_dpni) {
@@ -1365,14 +1364,6 @@
goto err_calloc;
}
- memset(&dpni_cfg, 0, sizeof(dpni_cfg));
- err = dpni_prepare_cfg(&dpni_cfg, &cfg_buf[0]);
- if (err < 0) {
- err = -ENODEV;
- printf("dpni_prepare_cfg() failed: %d\n", err);
- goto err_prepare_cfg;
- }
-
err = dpni_create(dflt_mc_io,
dflt_dprc_handle,
MC_CMD_NO_FLAGS,
@@ -1429,7 +1420,6 @@
MC_CMD_NO_FLAGS,
dflt_dpni->dpni_id);
err_create:
-err_prepare_cfg:
free(dflt_dpni);
err_calloc:
return err;