Resize PA_ BUFFER2 configuration size for k2l/k2e
authorTinku Mannan <tmannan@ti.com>
Fri, 24 Jan 2014 15:49:36 +0000 (10:49 -0500)
committerTinku Mannan <tmannan@ti.com>
Fri, 24 Jan 2014 15:49:36 +0000 (10:49 -0500)
ti/runtime/netapi/src/netapi_init.c

index 01ce4a7e2d01c8265bb346d814f7f2a7f0c8aa81..5fc807f76687b85d50edc634cd4ee357a9f50380 100755 (executable)
@@ -211,7 +211,7 @@ uint8_t paBuf0[NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF0]ALIGN(CACHE_LINESZ);
 #define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1    128 * TUNE_NETAPI_MAX_NUM_MAC
 uint8_t paBuf1[NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1]ALIGN(CACHE_LINESZ);
 
-#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2   13824
+#define NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2   14592
 
 
 uint8_t paBuf2[NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2]ALIGN(CACHE_LINESZ);
@@ -347,7 +347,7 @@ int netapip_initNwal(
     nwalGlobCfg.hopLimit = 5;/* Default TTL / Hop Limit */
     nwalGlobCfg.paPowerOn = nwal_TRUE;
     nwalGlobCfg.saPowerOn = nwal_TRUE;
-    nwalGlobCfg.paFwActive = nwal_TRUE;
+    nwalGlobCfg.paFwActive = nwal_FALSE;
     nwalGlobCfg.saFwActive = nwal_FALSE;
 
     /* Pick Default Physical Address */
@@ -379,8 +379,11 @@ int netapip_initNwal(
     bases[nwal_BUF_INDEX_INST] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)nwalInstMem);
     if(NETAPI_NWAL_CONFIG_BUFSIZE_NWAL_HANDLE < sizes[nwal_BUF_INDEX_INST])
     {
+        printf(" 1memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_INST], NETAPI_NWAL_CONFIG_BUFSIZE_NWAL_HANDLE);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
     }
     count++;
 
@@ -388,15 +391,24 @@ int netapip_initNwal(
     if(NWAL_CHAN_HANDLE_SIZE  < sizes[nwal_BUF_INDEX_INT_HANDLES])
     {
         /* Resize Memory */
-        while(1);
+        printf(" 2memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_INT_HANDLES], NWAL_CHAN_HANDLE_SIZE);
+        /* Resize Memory */
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
      bases[nwal_BUF_INDEX_PA_LLD_BUF0] =
         (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)paEntry->paBuf0);
     if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF0) < sizes[nwal_BUF_INDEX_PA_LLD_BUF0])
     {
+        printf(" 3memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_PA_LLD_BUF0], NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF0);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
 
@@ -404,8 +416,12 @@ int netapip_initNwal(
         (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)paEntry->paBuf1);
     if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1) < sizes[nwal_BUF_INDEX_PA_LLD_BUF1])
     {
+        printf(" 4memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_PA_LLD_BUF1], NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF1);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
 
@@ -413,8 +429,12 @@ int netapip_initNwal(
         (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)paEntry->paBuf2);
     if((NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2) < sizes[nwal_BUF_INDEX_PA_LLD_BUF2])
     {
+        printf(" 5memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_PA_LLD_BUF2], NETAPI_NWAL_CONFIG_BUFSIZE_PA_BUF2);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
 #ifdef NETAPI_ENABLE_SECURITY
@@ -422,8 +442,13 @@ int netapip_initNwal(
         (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)saEntry->salldHandle);
     if((NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE) < sizes[nwal_BUF_INDEX_SA_LLD_HANDLE])
     {
+        printf(" 6memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_SA_LLD_HANDLE], 
+            NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
 
@@ -437,8 +462,13 @@ int netapip_initNwal(
     if((NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE_PER_CHAN * TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS*2) <
         sizes[nwal_BUF_INDEX_SA_LLD_CHAN_HANDLE])
     {
+        printf(" 7memSize issue %d %d\n", 
+            sizes[nwal_BUF_INDEX_SA_LLD_CHAN_HANDLE], 
+            NETAPI_NWAL_CONFIG_BUFSIZE_SA_LLD_HANDLE_PER_CHAN * TUNE_NETAPI_MAX_NUM_IPSEC_CHANNELS*2);
         /* Resize Memory */
-        while(1);
+        return nwal_FALSE;
+        //while(1);
+
     }
     count++;
 #else
@@ -449,7 +479,9 @@ int netapip_initNwal(
 #endif
     if(count != nwal_N_BUFS)
     {
-        while(1);
+        printf("count failure: %d\n", count);
+        return nwal_FALSE;
+        //while(1);
     }
 
     /* Initialize NWAL module */
@@ -461,7 +493,8 @@ int netapip_initNwal(
     if(nwalRetVal != nwal_OK)
     {
         netapi_Log ("netapip_initNwal: nwal_create Failed %d\n",nwalRetVal);
-        while(1);
+        return nwal_FALSE;
+        //while(1);
     }
 
     netapi_Log("netapip_initNwal- Global and Local Network initialization Successful \n");