NETAPI changes for MCSDK3.1, cleanup DEV.NETAPI.01.01.00.00
authorTinku Mannan <tmannan@ti.com>
Tue, 18 Feb 2014 13:55:11 +0000 (08:55 -0500)
committerTinku Mannan <tmannan@ti.com>
Tue, 18 Feb 2014 13:55:11 +0000 (08:55 -0500)
ti/runtime/netapi/netapi_util.h
ti/runtime/netapi/pktio.h
ti/runtime/netapi/src/netapi.c
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/test/net_test_loopback.c
ti/runtime/netapi/tools/dumpdesc.c

index 34fc55e9ff6b2f8916084d0e8061b14291777c53..200fdd8bcaf8dc395d29e2afda2cf13120274a35 100755 (executable)
@@ -147,6 +147,7 @@ static inline int netapi_closeHeap(NETAPI_T p,
     netapip_zapQ(q);
     q= Pktlib_getInternalHeapQueue(h);
     netapip_zapQ(q);
+    return 1;
 }
 /**
  *  @ingroup netapi_gen_functions
@@ -269,13 +270,10 @@ static inline void*  netapi_netcpCfgGetIpSecUserData(NETAPI_T h,
 {
     NETAPI_NWAL_GLOBAL_CONTEXT_T *p = &netapi_get_global()->nwal_context;
     int slot = netapi_cfgGetMatchId(app_id);
-    netapi_Log("netapi_netcpCfgGetIpSecUserData: slot found %d\n", slot);
     if ((slot <0 ) || (slot >= TUNE_NETAPI_MAX_SA))
     {
         return NULL;
     }
-    netapi_Log("netapi_netcpCfgGetIpSecUserData: user data being returned %d\n",
-        (uint32_t)(p->tunnel[slot].user_data));
     return (p->tunnel[slot].user_data);
 }
 
@@ -345,19 +343,15 @@ static inline void*  netapi_netcpCfgGetUserData(NETAPI_T h,
     switch(appIdType)
     {
         case(NETAPI_NETCP_MATCH_IPSEC):
-            netapi_Log("netapi_netcpCfgGetUserData: ipsec appID found\n");
             return (netapi_netcpCfgGetIpSecUserData(h, app_id));
             break;
         case(NETAPI_NETCP_MATCH_IPSEC_POLICY):
-            netapi_Log("netapi_netcpCfgGetUserData: policy appID found\n");
             return (netapi_netcpCfgGetPolicyUserData(h, app_id));
             break;
         case(NETAPI_NETCP_MATCH_GENERIC_IP):
-            netapi_Log("netapi_netcpCfgGetUserData: IP appID found\n");
             return (netapi_netcpCfgGetIpUserData(h, app_id));
             break;
         case(NETAPI_NETCP_MATCH_CLASS):
-            netapi_Log("netapi_netcpCfgGetUserData: classifier appID found\n");
             return (netapi_netcpCfgGetClassiferUserData(h, app_id));
             break;
         default:
@@ -392,22 +386,18 @@ static inline netapi_RetValue netapi_netcpCfgUpdateUserData(NETAPI_T h,
     switch(appIdType)
     {
         case(NETAPI_NETCP_MATCH_IPSEC):
-            netapi_Log("netapi_netcpCfgUpdateUserData: ipsec appID found\n");
             p->tunnel[slot].user_data = user_data;
             return NETAPI_ERR_OK;
             break;
         case(NETAPI_NETCP_MATCH_IPSEC_POLICY):
-            netapi_Log("netapi_netcpCfgUpdateUserData: policy appID found\n");
             p->policy[slot].user_data = user_data;
             return NETAPI_ERR_OK;
             break;
         case(NETAPI_NETCP_MATCH_GENERIC_IP):
-            netapi_Log("netapi_netcpCfgUpdateUserData: IP appID found\n");
             p->ips[slot].user_data = user_data;
             return NETAPI_ERR_OK;
             break;
         case(NETAPI_NETCP_MATCH_CLASS):
-            netapi_Log("netapi_netcpCfgUpdateUserData: classifier appID found\n");
             p->classi[slot].user_data = user_data;
             return NETAPI_ERR_OK;
             break;
index 7f2e6e19dc89bb553f2753c62197969846ce949d..6e7bcdeed1230ea49af39f9c94f68bfbb3a30627 100755 (executable)
@@ -746,12 +746,6 @@ int netapi_pktioPollAll(NETAPI_T        handle,
  */
 #define netapi_pktioGetQ(handle) (handle)->q
 
-/*-----------------Extra Fast Path pkt meta data macros--------------------*/
-#include "cppi_desc.h"
-#include "ti/drv/pa/pa.h"
-#include "ti/drv/pa/pasahost.h"
-
-
 /**
  *  @ingroup pktio_functions
  *  @brief  API returns default packet queue to poll for netcp RX
index 1f051ec4178ed63e2df1c85820d55873ebe98ca8..5dc19db54e616ac499096d2ae662e252a7fc5a0a 100755 (executable)
@@ -158,10 +158,6 @@ NETAPI_T netapi_init(int                master,
             netapi_Log("netapi_init: hplib_shmAddEntry failed for NETAPI_ENTRY\n");
             return NULL;
         }
-        else
-        {
-            netapi_Log("netapi_init: hplib_shmAddEntry sucess for NETAPI_ENTRY\n");
-        }
         hplib_utilOsalCreate();
     }
     /*ALL others:  we are not the system master; assume SYS_MASTER has
index 726c90fdd8e1d214a8b9711b0b8adaa006b65a6b..9028f257aa3b595e5f9f48b7e817e4f93b64ba9e 100755 (executable)
@@ -266,9 +266,6 @@ 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)
     {
@@ -350,10 +347,24 @@ int netapip_initNwal(
     nwalGlobCfg.paFwActive = nwal_TRUE;
     nwalGlobCfg.saFwActive = nwal_FALSE;
 
-    /* Pick Default Physical Address */
-    nwalGlobCfg.paVirtBaseAddr = (uint32_t) netapi_VM_VirtAddr->passCfgVaddr;
-    nwalGlobCfg.saVirtBaseAddr = (uint32_t) netapi_VM_VirtAddr->passCfgVaddr +
-                                 ((uint32_t)CSL_PA_SS_CFG_CP_ACE_CFG_REGS - (uint32_t)CSL_PA_SS_CFG_REGS) ;
+
+    if(p_nwal_device_cfg)
+    {
+        nwalGlobCfg.pDeviceCfg = p_nwal_device_cfg;
+    }
+    else
+    {
+        netapi_Log ("netapip_initNwal: nwal device configuration not provided %d\n");
+        return nwal_FALSE;
+    }
+
+    /* Update nwal cfg with virtual PA and SA addresses */
+    nwalGlobCfg.pDeviceCfg->cslNetCpCfgSaCfgRegs = netapi_VM_VirtAddr->passCfgVaddr +
+                                 (p_nwal_device_cfg->cslNetCpCfgSaCfgRegs -
+                                 p_nwal_device_cfg->cslNetCpCfgRegs);
+
+    nwalGlobCfg.pDeviceCfg->cslNetCpCfgRegs = (uint32_t) netapi_VM_VirtAddr->passCfgVaddr;
+
     nwalGlobCfg.rxDefPktQ = QMSS_PARAM_NOT_SPECIFIED;
 
     /* Get the Buffer Requirement from NWAL */
index f215bb1f1e8511509b8189e1c2edf3081bb229f3..101153ef8d3ba44f0e331c42f73a8b8dba2e0252 100755 (executable)
@@ -1262,7 +1262,7 @@ int main(int argc, char **argv)
     printf("\n net_test_loopback running ....\n");
     printf("\n Enter 's' for stats or 'q'to quit net_test_loopback app, or 'h' for help\n");
 
-
+#if 0
     for (i=0;i<10;i++)
     {
         void* ptr;
@@ -1287,6 +1287,7 @@ int main(int argc, char **argv)
         ptr = hplib_vmMemAlloc(128*4,128,0);
         printf("*************** Debug: MemPtr with size 128 * 4: 0x%x\n", ptr);
     }
+#endif
     char c;
         //this thread of execution (main) now just waits on user input
         for(;;)
index 364d1ef3c2b751fcae4080f9cee4185ddeffc1fd..2e2a1d69b3a4ce5b9b8b3f7499094df482b6d38c 100755 (executable)
 //netTest_utilDumpDescr
 void netTest_utilDumpDescr(unsigned long *p, int n)
 {
-   netapi_Log("--------dump of descriptor %d %x\n", n, (int) p);
-   netapi_Log("> %x %x %x %x %x %x %x %x\n",p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);
-   netapi_Log("> %x %x %x %x %x %x %x %x\n",p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]);
-   netapi_Log("-----------------------------\n");
+   printf("--------dump of descriptor %d %x\n", n, (int) p);
+   printf("> %x %x %x %x %x %x %x %x\n",p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);
+   printf("> %x %x %x %x %x %x %x %x\n",p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]);
+   printf("-----------------------------\n");
 }
 
 static inline unsigned long netapi_timing_start(void)