NETAPI library changes for MCSDK 3.1 which supports k2l/k2e
authorTinku Mannan <tmannan@ti.com>
Thu, 23 Jan 2014 13:46:31 +0000 (08:46 -0500)
committerTinku Mannan <tmannan@ti.com>
Thu, 23 Jan 2014 13:46:31 +0000 (08:46 -0500)
ti/runtime/netapi/device/k2e/src/netapi_device.c [new file with mode: 0755]
ti/runtime/netapi/device/k2h/src/netapi_device.c [new file with mode: 0755]
ti/runtime/netapi/device/k2k/src/netapi_device.c [new file with mode: 0755]
ti/runtime/netapi/device/k2l/src/netapi_device.c [new file with mode: 0755]
ti/runtime/netapi/netapi.h
ti/runtime/netapi/netcp_cfg.h
ti/runtime/netapi/src/netapi.c
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/src/netapi_loc.h
ti/runtime/netapi/src/pdkv3/netapi_navig.c
ti/runtime/netapi/src/pktio.c

diff --git a/ti/runtime/netapi/device/k2e/src/netapi_device.c b/ti/runtime/netapi/device/k2e/src/netapi_device.c
new file mode 100755 (executable)
index 0000000..6f41107
--- /dev/null
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * FILE PURPOSE:   NETAPI Peripheral Device Configuration
+ ****************************************************************************** 
+ * FILE NAME:   netapi_device.c
+ *
+ * DESCRIPTION: NETAPI Peripheral Device Configuration Mapping
+ *
+ * REVISION HISTORY:
+ *
+ *  Copyright (c) Texas Instruments Incorporated 2013-2014
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ ******************************************************************************
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include "ti/runtime/netapi/netapi.h"
+
+#include "ti/csl/cslr_device.h"
+
+
+
+/* NETPAPI initialization parameters */
+NETCP_CFG_GLOB_DEVICE_PARAMS_T netapiDeviceGblCfgParam =
+{
+    CSL_NETCP_CFG_REGS,
+    CSL_QMSS_CFG_BASE,
+    CSL_QMSS_DATA_BASE
+};
+
+
diff --git a/ti/runtime/netapi/device/k2h/src/netapi_device.c b/ti/runtime/netapi/device/k2h/src/netapi_device.c
new file mode 100755 (executable)
index 0000000..abd353d
--- /dev/null
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * FILE PURPOSE:   NETAPI Peripheral Device Configuration
+ ****************************************************************************** 
+ * FILE NAME:   netapi_device.c
+ *
+ * DESCRIPTION: NETAPI Peripheral Device Configuration Mapping
+ *
+ * REVISION HISTORY:
+ *
+ *  Copyright (c) Texas Instruments Incorporated 2013-2014
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ ******************************************************************************
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include "ti/runtime/netapi/netapi.h"
+
+#include "ti/csl/cslr_device.h"
+
+/* NETPAPI initialization parameters */
+NETCP_CFG_GLOB_DEVICE_PARAMS_T netapiDeviceGblCfgParam =
+{
+    CSL_NETCP_CFG_REGS,
+    CSL_QMSS_CFG_BASE,
+    CSL_QMSS_DATA_BASE
+};
+
+
diff --git a/ti/runtime/netapi/device/k2k/src/netapi_device.c b/ti/runtime/netapi/device/k2k/src/netapi_device.c
new file mode 100755 (executable)
index 0000000..abd353d
--- /dev/null
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * FILE PURPOSE:   NETAPI Peripheral Device Configuration
+ ****************************************************************************** 
+ * FILE NAME:   netapi_device.c
+ *
+ * DESCRIPTION: NETAPI Peripheral Device Configuration Mapping
+ *
+ * REVISION HISTORY:
+ *
+ *  Copyright (c) Texas Instruments Incorporated 2013-2014
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ ******************************************************************************
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include "ti/runtime/netapi/netapi.h"
+
+#include "ti/csl/cslr_device.h"
+
+/* NETPAPI initialization parameters */
+NETCP_CFG_GLOB_DEVICE_PARAMS_T netapiDeviceGblCfgParam =
+{
+    CSL_NETCP_CFG_REGS,
+    CSL_QMSS_CFG_BASE,
+    CSL_QMSS_DATA_BASE
+};
+
+
diff --git a/ti/runtime/netapi/device/k2l/src/netapi_device.c b/ti/runtime/netapi/device/k2l/src/netapi_device.c
new file mode 100755 (executable)
index 0000000..abd353d
--- /dev/null
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * FILE PURPOSE:   NETAPI Peripheral Device Configuration
+ ****************************************************************************** 
+ * FILE NAME:   netapi_device.c
+ *
+ * DESCRIPTION: NETAPI Peripheral Device Configuration Mapping
+ *
+ * REVISION HISTORY:
+ *
+ *  Copyright (c) Texas Instruments Incorporated 2013-2014
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ ******************************************************************************
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include "ti/runtime/netapi/netapi.h"
+
+#include "ti/csl/cslr_device.h"
+
+/* NETPAPI initialization parameters */
+NETCP_CFG_GLOB_DEVICE_PARAMS_T netapiDeviceGblCfgParam =
+{
+    CSL_NETCP_CFG_REGS,
+    CSL_QMSS_CFG_BASE,
+    CSL_QMSS_DATA_BASE
+};
+
+
index e8cbd7d6abda512a6d74af3da9b42bd11c78b7d6..b6f28863058a8e904fc215872f1650a9c8457134 100755 (executable)
@@ -84,6 +84,7 @@
 #include <stddef.h>
 #include <string.h>
 
+#include "ti/drv/nwal/nwal.h"
 #include "ti/runtime/hplib/hplib.h"
 #include "netapi_types.h"
 #include "netapi_tune.h"
  *
  *  @param[in]  master  Can be either @ref NETAPI_SYS_MASTER or @ref NETAPI_NO_MASTER
  *  @param[in]  p_cfg   (master mode)  pointer to @ref NETAPI_CFG_T or NULL to use netapi default configuration.
+ *  @param[in]  p_hplibDeviceCfg  (master mode)  HPLIB device specific configuration.
+ *  @param[in]  p_nwalDeviceCfg   (master mode)  NWAL device specific configuration.
+ *  @param[in]  p_netapiDeviceCfg (master mode)  NETAPI device specific configuration.
  *  @retval     Handle to the instance or NULL on error, @ref NETAPI_T
  *  @pre        none
  */
- NETAPI_T  netapi_init(int master, NETAPI_CFG_T * p_cfg);
+ NETAPI_T netapi_init(int                master,
+                     NETAPI_CFG_T *     p_cfg,
+                     hplib_globalDeviceConfigParams_t *p_hplibDeviceCfg,
+                     nwalGlobalDeviceConfigParams_t   *p_nwalDeviceCfg,
+                     NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapiDeviceCfg);
 
 /**
  *  @ingroup netapi_gen_functions
index cd4bb2d9142228348aef0dc27645afacb5116991..ff1c6b3ed4b4cdefa22705e00f782b475fce1453 100755 (executable)
@@ -487,7 +487,23 @@ typedef struct NETCP_CFG_FLOW_CONFIG_Tag
    PKTIO_HANDLE_T * p_dest_q;       /**<destination queue for this flow (may be overwrritten by source DMA) */
 } NETCP_CFG_FLOW_CONFIG_T;
 
+ /**
+ *  @ingroup cfg_structures
+ * @brief
+ *  The structure contains the NETAPI Physical Memory Address Device configuration for
+ *  QMSS and PASS Perihperals.
+ *
+ * @details
+ *  The structure contains the NETAPI Physical Memory Address Device configuration for
+ *  QMSS and PASS Perihperals.
+ */
+typedef struct NETCP_CFG_GLOB_DEVICE_PARAMS_Tag
+{
+    uint32_t    cslNetCpCfgRegs;    /**< Base address of NETCP configuration Registers */
+    uint32_t    cslQmssCfgBase;     /**< Base address of QMSS configuration Registers */
+    uint32_t    cslQmssDataBase;    /**< Base address of QMSS Data Registers */
 
+} NETCP_CFG_GLOB_DEVICE_PARAMS_T;
 
 
 
index 57aa4b18b41cc349114422dac224935713cf38f4..1f051ec4178ed63e2df1c85820d55873ebe98ca8 100755 (executable)
@@ -48,6 +48,7 @@
 
 void* pBase;
 NETAPI_SHM_T* pnetapiShm;
+
 static NETAPI_CFG_T netapi_default_cfg=
 {
     TUNE_NETAPI_PERM_MEM_SZ,
@@ -57,8 +58,11 @@ static NETAPI_CFG_T netapi_default_cfg=
     TUNE_NETAPI_DEFAULT_NUM_BUFFERS,   //#descriptors+buffers in default heap
     TUNE_NETAPI_DEFAULT_NUM_SOLO_DESCRIPTORS, //#descriptors w/o buffers in default heap
     TUNE_NETAPI_DEFAULT_BUFFER_SIZE,   //size of buffers in default heap
-    0,0,0
+    0,
+    0,
+    0
 };
+
 HPLIB_SPINLOCK_IF_T spinlock_lol =
 {
     hplib_mSpinLockInit,
@@ -117,7 +121,12 @@ Pktlib_HeapIfTable *netapi_getPktlibIfTable(void) {return &netapi_pktlib_ifTable
  ********************************************************************
  * DESCRIPTION:  API instantiates the NETAPI and allocated global resources.
  ********************************************************************/
-NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg)
+NETAPI_T netapi_init(int                master,
+                     NETAPI_CFG_T *     p_cfg,
+                     hplib_globalDeviceConfigParams_t *p_hplibDeviceCfg,
+                     nwalGlobalDeviceConfigParams_t   *p_nwalDeviceCfg,
+                     NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapiDeviceCfg)
+
 {
     int i;
     int err;
@@ -242,11 +251,16 @@ NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg)
         p_master=(NETAPI_HANDLE_T *) netapi_proc_master;
     }
 
+
     /* SYS_MASTER: The following segment should be done 1 Time per system boot by global master process */
     /* system init */
     if(master == NETAPI_SYS_MASTER)
     {
-        err = netapip_systemInit(p, TRUE);
+        err = netapip_systemInit(p,
+                                 p_hplibDeviceCfg,
+                                 p_netapiDeviceCfg,
+                                 p_nwalDeviceCfg,
+                                 TRUE);
         if (err<0) 
         {
             goto ERR_netapi_init;
@@ -256,7 +270,12 @@ NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg)
     /* PROC_MASTER case */
     else if (master==NETAPI_PROC_MASTER)
     {
-        err = netapip_systemInit(p, FALSE); //more limited initialization
+        /* More limited initialization */
+        err = netapip_systemInit(p,
+                                 p_hplibDeviceCfg,
+                                 p_netapiDeviceCfg,
+                                 p_nwalDeviceCfg,
+                                 FALSE);
         if (err<0)
         {
             goto ERR_netapi_init;
index a00aed30280636e9f97c550b68ad25087b154c9b..01ce4a7e2d01c8265bb346d814f7f2a7f0c8aa81 100755 (executable)
@@ -247,7 +247,8 @@ int netapip_initNwal(
     int region2use,
     Pktlib_HeapIfTable * p_table,
     NETAPI_NWAL_GLOBAL_CONTEXT_T * p_nwal_context,
-    NETAPI_CFG_T*p_cfg )
+    NETAPI_CFG_T*p_cfg,
+    nwalGlobalDeviceConfigParams_t *p_nwal_device_cfg)
 {
     nwalSizeInfo_t  nwalSizeInfo;
     nwal_RetValue   nwalRetVal;
@@ -265,6 +266,9 @@ int netapip_initNwal(
     memset(p_nwal_context,0,sizeof( NETAPI_NWAL_GLOBAL_CONTEXT_T) );
     memset(&nwalGlobCfg,0,sizeof(nwalGlobCfg_t ) );
 
+    if(p_nwal_device_cfg)
+        nwalGlobCfg.pDeviceCfg = p_nwal_device_cfg;
+
     pBase = hplib_shmOpen();
     if (pBase)
     {
@@ -609,7 +613,11 @@ void netapip_cleanupAtStart(void)
  ********************************************************************
  * DESCRIPTION:  NETAPI internal function system initialization
  ********************************************************************/
-int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
+int netapip_systemInit(NETAPI_HANDLE_T * handle,
+                       hplib_globalDeviceConfigParams_t *p_hplib_device_cfg,
+                       NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg,
+                       nwalGlobalDeviceConfigParams_t   *p_nwal_device_cfg,
+                       Bool global_master_process)
 {
     int32_t             result;
     Pktlib_HeapHandle   sharedHeapHandle;
@@ -641,7 +649,10 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
     /* initialize all the memory we are going to use
        - chunk for buffers, descriptors
        - memory mapped peripherals we use, such as QMSS, PA, etc */
-    result = hplib_vmInit(&netapi_VM_VirtAddr[0], 2, &netapi_VM_MempoolAttr[0]);
+    result = hplib_vmInit(&netapi_VM_VirtAddr[0],
+                          2,
+                          &netapi_VM_MempoolAttr[0],
+                          p_hplib_device_cfg);
 
     if (global_master_process == TRUE)
     {
@@ -654,7 +665,7 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
             return -1;
         if (hplib_checkMallocArea(1) != hplib_OK)
             return -1;
-            }
+    }
 
     if (result == hplib_OK) netapi_Log("netapip_systemInit: - memory set  up OK\n");
     else {netapi_Log("netapip_systemInit: - memory set up failed\n"); return -1;}
@@ -748,7 +759,8 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
 #endif
 
     /* Initialize Queue Manager Sub System */
-    result = netapip_initQm (pnetapiShm->netapi_global.cfg.def_max_descriptors); 
+    result = netapip_initQm (pnetapiShm->netapi_global.cfg.def_max_descriptors,
+                             p_netapi_device_cfg);
     
     if (result != 1)
     {
@@ -778,7 +790,7 @@ int netapip_systemInit(NETAPI_HANDLE_T * handle, Bool global_master_process)
 netapi_Log("netapip_systemInit: returned from netapip_qmSetupMemRegion\n");
     /* Initialize CPPI CPDMA */
 
-    result = netapip_initCppi ();
+    result = netapip_initCppi (p_netapi_device_cfg);
     netapi_Log("netapip_systemInit: returned from netapip_initCppi\n");
     if (result != 1)
     {
@@ -843,11 +855,11 @@ netapi_Log("netapip_systemInit: returned from netapip_qmSetupMemRegion\n");
    handle->netcp_control_tx_heap= controlTxHeapHandle;
 
     /* now NWAL */
-    result = netapip_initNwal(
-                              TUNE_NETAPI_QM_GLOBAL_REGION,
-                              &netapi_pktlib_ifTable, 
+    result = netapip_initNwal(TUNE_NETAPI_QM_GLOBAL_REGION,
+                              &netapi_pktlib_ifTable,
                               &pnetapiShm->netapi_global.nwal_context,
-                              &pnetapiShm->netapi_global.cfg);
+                              &pnetapiShm->netapi_global.cfg,
+                              p_nwal_device_cfg);
     if (result<0) {netapi_Log("netapi  init_nwal() failed\n"); return -1; }
  netapi_Log("netapip_systemInit: returned from netapip_initNwal\n");
     /* start NWAL */
index e20a647b2298e80440531a8b68b0638af66b2d7e..d3dd9026f35e04eee236212b7797a95abd7b8df5 100755 (executable)
@@ -242,13 +242,17 @@ typedef struct NETAPI_SHM_Tag
 } NETAPI_SHM_T;
 
 //internal initialization routines */
-int netapip_initQm(int max_descriptors);
-int netapip_initCppi(void);
+int netapip_initQm(int max_descriptors,
+                   NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg);
+
+int netapip_initCppi(NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg);
+
 int netapip_startQm(void);
 int netapip_initNwal(int region2use,
                      Pktlib_HeapIfTable * p_table,
                      NETAPI_NWAL_GLOBAL_CONTEXT_T * p_nwal_context,
-                     NETAPI_CFG_T *p_cfg );
+                     NETAPI_CFG_T *p_cfg,
+                     nwalGlobalDeviceConfigParams_t *p_nwal_device_cfg);
 
 int netapip_startNwal(Pktlib_HeapHandle             pkt_heap,
                       Pktlib_HeapHandle             cmd_heapRx,
@@ -422,6 +426,12 @@ int netapip_netcpCfgGetSaInflowInfo(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
                                       uint32_t *swInfo0,
                                       uint32_t *swInfo1);
 
-int netapip_systemInit(NETAPI_HANDLE_T *, Bool);
+int netapip_systemInit(NETAPI_HANDLE_T * handle,
+                       hplib_globalDeviceConfigParams_t *p_hplib_device_cfg,
+                       NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg,
+                       nwalGlobalDeviceConfigParams_t   *p_nwal_device_cfg,
+                       Bool global_master_process);
+
+
 void netapip_cleanupAtStart(void);
 #endif
index 75a6ca826c70db891a06f5b070da3bf8eba2bd3c..a5a8acd70c98f4867f5772db6db4d5fba828df02 100755 (executable)
 #include <ti/drv/qmss/qmss_qm.h>
 
 //pull in device config for qmss, cppi
-#include "qmss_device.c"
-#include "cppi_device.c"
+
+
+extern Qmss_GlobalConfigParams qmssGblCfgParams;
+extern Cppi_GlobalConfigParams cppiGblCfgParams;
 
 /********************************************************************
  * FUNCTION PURPOSE:  Internal NETAPI macro to convert to IP Register
@@ -77,90 +79,64 @@ static inline void* NETAPI_GET_REG_VADDR (void *    virtBaseAddr,
  *****************************************************************************
  * DESCRIPTION: The function will initialize the CPPI
  *****************************************************************************/
-int netapip_initCppi(void)
+int netapip_initCppi(NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg)
 {
 
     int32_t                         result;
     Cppi_GlobalConfigParams         netapi_cppiGblCfgParams;
 
     netapi_cppiGblCfgParams = cppiGblCfgParams;
-    /* Convert Physical address to Virtual address for LLD access */
-    /* SRIO CPDMA regs */
-    netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].gblCfgRegs =
-        NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->srioCfgVaddr,
-                             CSL_SRIO_CFG_REGS,
-                             (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].gblCfgRegs);
-
-    netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].txChRegs =
-        NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->srioCfgVaddr,
-                             CSL_SRIO_CFG_REGS,
-                             (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].txChRegs);
-
-    netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].rxChRegs =
-        NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->srioCfgVaddr,
-                             CSL_SRIO_CFG_REGS,
-                             (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].rxChRegs);
-
-    netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].txSchedRegs =
-        NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->srioCfgVaddr,
-                             CSL_SRIO_CFG_REGS,
-                             (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].txSchedRegs);
-
-    netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].rxFlowRegs =
-        NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->srioCfgVaddr,
-                             CSL_SRIO_CFG_REGS,
-                             (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_SRIO_CPDMA].rxFlowRegs);
 
     /* PASS CPDMA regs */
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].gblCfgRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->passCfgVaddr,
-                             CSL_NETCP_CFG_REGS,
+                             p_netapi_device_cfg->cslNetCpCfgRegs,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].gblCfgRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].txChRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->passCfgVaddr,
-                             CSL_NETCP_CFG_REGS,
+                                     p_netapi_device_cfg->cslNetCpCfgRegs,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].txChRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].rxChRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->passCfgVaddr,
-                             CSL_NETCP_CFG_REGS,
+                                     p_netapi_device_cfg->cslNetCpCfgRegs,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].rxChRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].txSchedRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->passCfgVaddr,
-                             CSL_NETCP_CFG_REGS,
+                                     p_netapi_device_cfg->cslNetCpCfgRegs,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].txSchedRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].rxFlowRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->passCfgVaddr,
-                             CSL_NETCP_CFG_REGS,
+                                     p_netapi_device_cfg->cslNetCpCfgRegs,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_PASS_CPDMA].rxFlowRegs);
 
     /* QMSS CPDMA regs */
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].gblCfgRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
+                             p_netapi_device_cfg->cslQmssCfgBase,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].gblCfgRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].txChRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
+        p_netapi_device_cfg->cslQmssCfgBase,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].txChRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].rxChRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
+        p_netapi_device_cfg->cslQmssCfgBase,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].rxChRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].txSchedRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
+        p_netapi_device_cfg->cslQmssCfgBase,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].txSchedRegs);
 
     netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].rxFlowRegs =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
+        p_netapi_device_cfg->cslQmssCfgBase,
                              (uint32_t)netapi_cppiGblCfgParams.cpDmaCfgs[Cppi_CpDma_QMSS_CPDMA].rxFlowRegs);
     result = Cppi_init (&netapi_cppiGblCfgParams);
     if (result != CPPI_SOK)  {
@@ -175,7 +151,8 @@ int netapip_initCppi(void)
  *****************************************************************************
  * DESCRIPTION: The function will initialize the Queue Manager
  *****************************************************************************/
-int netapip_initQm(int max_descriptors)
+int netapip_initQm(int max_descriptors,
+                   NETCP_CFG_GLOB_DEVICE_PARAMS_T   *p_netapi_device_cfg)
 {
     Qmss_InitCfg              qmssInitConfig;
     int32_t                   result;
@@ -198,44 +175,46 @@ int netapip_initQm(int max_descriptors)
     {
         netapi_qmssGblCfgParams.groupRegs[count].qmConfigReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmConfigReg);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmConfigReg);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmDescReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmDescReg);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmDescReg);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtReg);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtReg);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyReg);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyReg);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmQueStatReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueStatReg);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueStatReg);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmStatusRAM =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmStatusRAM);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmStatusRAM);
 
         netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtDataReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssDataVaddr,
-                                 QMSS_DATA_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtDataReg);
+            p_netapi_device_cfg->cslQmssDataBase,
+           (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtDataReg);
 
        netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyDataReg = NULL;
 #if 0
         netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyDataReg =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssDataVaddr,
-                                 QMSS_DATA_BASE_ADDR,
+    p_netapi_device_cfg->cslQmssDataBase,
+                         //CSL_QMSS_DATA_BASE,
+
                                  (uint32_t)netapi_qmssGblCfgParams.groupRegs[count].qmQueMgmtProxyDataReg);
 #endif
     }
@@ -244,37 +223,37 @@ int netapip_initQm(int max_descriptors)
     {
         netapi_qmssGblCfgParams.regs.qmQueIntdReg[count] =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.regs.qmQueIntdReg[count]);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.regs.qmQueIntdReg[count]);
     }
 
     for(count=0;count < QMSS_MAX_PDSP;count++)
     {
         netapi_qmssGblCfgParams.regs.qmPdspCmdReg[count] =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspCmdReg[count]);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspCmdReg[count]);
 
         netapi_qmssGblCfgParams.regs.qmPdspCtrlReg[count] =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspCtrlReg[count]);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspCtrlReg[count]);
 
         netapi_qmssGblCfgParams.regs.qmPdspIRamReg[count] =
             NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                                 QMSS_CFG_BASE_ADDR,
-                                 (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspIRamReg[count]);
+            p_netapi_device_cfg->cslQmssCfgBase,
+           (uint32_t)netapi_qmssGblCfgParams.regs.qmPdspIRamReg[count]);
     }
 
     netapi_qmssGblCfgParams.regs.qmLinkingRAMReg =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
-                             (uint32_t)netapi_qmssGblCfgParams.regs.qmLinkingRAMReg);
+        p_netapi_device_cfg->cslQmssCfgBase,
+       (uint32_t)netapi_qmssGblCfgParams.regs.qmLinkingRAMReg);
 
     netapi_qmssGblCfgParams.regs.qmBaseAddr =
         NETAPI_GET_REG_VADDR(netapi_VM_VirtAddr->qmssCfgVaddr,
-                             QMSS_CFG_BASE_ADDR,
-                             (uint32_t)netapi_qmssGblCfgParams.regs.qmBaseAddr);
+        p_netapi_device_cfg->cslQmssCfgBase,
+       (uint32_t)netapi_qmssGblCfgParams.regs.qmBaseAddr);
 
     result = Qmss_init (&qmssInitConfig, &netapi_qmssGblCfgParams);
     if (result != QMSS_SOK)
index f06df46d319bc2166bfbd07c84fe812d6a4164ad..b843d069bc1da6880fb768490e093181ac4d41c0 100755 (executable)
@@ -102,7 +102,8 @@ static int netapip_pktioSendL4CkSumCryptPort(struct PKTIO_HANDLE_tag * pp,
 
     if (netapip_netcpCfgGetSaInflowInfo(&netapi_get_global()->nwal_context, tunnel_id, &swInfo0, &swInfo1))
     {
-        nwal_mCmdSetL4CkSumCrypPort(pkt,
+        nwal_mCmdSetL4CkSumCrypPort(p->nwalInstanceHandle,
+                                    pkt,
                                     &p->tx_psCmdInfo,
                                     pTxPktInfo->l4OffBytes, 
                                     pTxPktInfo->ploadLen + pTxPktInfo->l4HdrLen, 
@@ -114,7 +115,7 @@ static int netapip_pktioSendL4CkSumCryptPort(struct PKTIO_HANDLE_tag * pp,
                                     pTxPktInfo->enetPort);
 
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
         Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -151,7 +152,8 @@ static int netapip_pktioSendCryptPort(struct PKTIO_HANDLE_tag * pp,
 
     if (netapip_netcpCfgGetSaInflowInfo(&netapi_get_global()->nwal_context, tunnel_id, &swInfo0, &swInfo1))
     {
-        nwal_mCmdSetCrypPort(pkt,
+        nwal_mCmdSetCrypPort(p->nwalInstanceHandle,
+                             pkt,
                              &p->tx_psCmdInfo,
                               pTxPktInfo->saOffBytes,
                               pTxPktInfo->saPayloadLen,
@@ -160,7 +162,7 @@ static int netapip_pktioSendCryptPort(struct PKTIO_HANDLE_tag * pp,
                               pTxPktInfo->enetPort);
 
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
         Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -198,7 +200,8 @@ static int netapip_pktioSendL3CkSumCryptPort(struct PKTIO_HANDLE_tag * pp,
 
     if (netapip_netcpCfgGetSaInflowInfo(&netapi_get_global()->nwal_context, tunnel_id, &swInfo0, &swInfo1))
     {
-        nwal_mCmdSetL3CkSumCrypPort(pkt,
+        nwal_mCmdSetL3CkSumCrypPort(p->nwalInstanceHandle,
+                             pkt,
                              &p->tx_psCmdInfo,
                               pTxPktInfo->saOffBytes,
                               pTxPktInfo->saPayloadLen,
@@ -207,7 +210,8 @@ static int netapip_pktioSendL3CkSumCryptPort(struct PKTIO_HANDLE_tag * pp,
                               pTxPktInfo->enetPort);
 
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
         Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -249,7 +253,8 @@ static int netapip_pktioSendL4CkSumAHCryptPort(struct PKTIO_HANDLE_tag * pp,
 
     if (netapip_netcpCfgGetSaInflowInfo(&netapi_get_global()->nwal_context, tunnel_id, &swInfo0, &swInfo1))
     {
-        nwal_mCmdSetL4CkSumAHCrypPort(pkt,
+        nwal_mCmdSetL4CkSumAHCrypPort(p->nwalInstanceHandle,
+                                pkt,
                                 &p->tx_psCmdInfo,
                                 pTxPktInfo->l4OffBytes, 
                                 pTxPktInfo->ploadLen + pTxPktInfo->l4HdrLen, 
@@ -263,7 +268,8 @@ static int netapip_pktioSendL4CkSumAHCryptPort(struct PKTIO_HANDLE_tag * pp,
                                 pTxPktInfo->enetPort);
 
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
         Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -300,7 +306,8 @@ static int netapip_pktioSendAHCryptPort(struct PKTIO_HANDLE_tag * pp,
 
     if (netapip_netcpCfgGetSaInflowInfo(&netapi_get_global()->nwal_context, tunnel_id, &swInfo0, &swInfo1))
     {
-        nwal_mCmdSetAHCrypPort(pkt,
+        nwal_mCmdSetAHCrypPort(p->nwalInstanceHandle,
+                               pkt,
                                 &p->tx_psCmdInfo,
                                 pTxPktInfo->saOffBytes, 
                                 pTxPktInfo->saPayloadLen, 
@@ -311,7 +318,8 @@ static int netapip_pktioSendAHCryptPort(struct PKTIO_HANDLE_tag * pp,
                                 pTxPktInfo->enetPort);
         
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
         Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -344,7 +352,8 @@ static int netapip_pktioSendL4CkSumPort(struct PKTIO_HANDLE_tag * pp,
     PKTIO_HANDLE_T *p=(PKTIO_HANDLE_T*) pp;
     nwalTxPktInfo_t *pTxPktInfo = m->u.tx_meta;
     Cppi_HostDesc*          pPloadDesc;
-    nwal_mCmdSetL4CkSumPort(pkt,
+    nwal_mCmdSetL4CkSumPort(p->nwalInstanceHandle,
+                            pkt,
                             &p->tx_psCmdInfo,
                             pTxPktInfo->l4OffBytes,
                             pTxPktInfo->l4HdrLen + pTxPktInfo->ploadLen,
@@ -352,7 +361,7 @@ static int netapip_pktioSendL4CkSumPort(struct PKTIO_HANDLE_tag * pp,
                             pTxPktInfo->enetPort);
 
     pPloadDesc = Pktlib_getDescFromPacket(pkt);
-    pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+    pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
     Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -374,11 +383,13 @@ static int netapip_pktioSendPort(struct PKTIO_HANDLE_tag * pp,
     PKTIO_HANDLE_T *p=(PKTIO_HANDLE_T*) pp;
     nwalTxPktInfo_t *pTxPktInfo = m->u.tx_meta;
     Cppi_HostDesc*          pPloadDesc;
-    nwal_mCmdSetPort(pkt,
+    nwal_mCmdSetPort(p->nwalInstanceHandle,
+                             pkt,
                                 &p->tx_psCmdInfo,
                                  pTxPktInfo->enetPort);
     pPloadDesc = Pktlib_getDescFromPacket(pkt);
-    pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+    pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
     Qmss_queuePushDescSizeRaw(p->tx_psCmdInfo.txQueue,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);
@@ -471,7 +482,8 @@ static int netapip_pktioSendSb(struct PKTIO_HANDLE_tag * pp,
             pPktInfoSB->aadSize,
             pPktInfoSB->pAad);
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
         Qmss_queuePushDescSizeRaw(dmPSCmdInfo->txQueue,
                                              pPloadDesc,
                                              NWAL_DESC_SIZE); 
@@ -502,7 +514,8 @@ static int netapip_pktioSendIfdma(struct PKTIO_HANDLE_tag * pp,
         tag.srcTagLo = m->u.tx_ifdma_dest;
         Cppi_setTag (Cppi_DescType_HOST, (Cppi_Desc *)pkt, &tag);
         pPloadDesc = Pktlib_getDescFromPacket(pkt);
-        pPloadDesc = Qmss_osalConvertDescVirtToPhy(pPloadDesc);
+        pPloadDesc = Osal_qmssConvertDescVirtToPhy(0, pPloadDesc);
+
         Qmss_queuePushDescSizeRaw(p->q,
                                   pPloadDesc,
                                   NWAL_DESC_SIZE);