Osal cleanup
authorSandeep Nair <a0875039@ares-ubuntu>
Mon, 16 Apr 2012 19:03:04 +0000 (15:03 -0400)
committerSandeep Nair <a0875039@ares-ubuntu>
Mon, 16 Apr 2012 19:03:04 +0000 (15:03 -0400)
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/src/osal.c

index 373b818e3e79d826a0b980910d0581bcf1b29d2f..59c0b3df26974b3dcea8720a68ad49028e4e9d76 100755 (executable)
@@ -238,6 +238,8 @@ int netapi_qm_setup_mem_region(
       return -1 ;\r
   }\r
 \r
+  memset (pDescMemBase, 0, (descSize * numDesc));\r
+\r
   result = Qmss_insertMemoryRegion (&memInfo);\r
   if (result < QMSS_SOK)  \r
   {\r
index f92d6514bfc4a22c6dd126897596ed12429c80c3..3177219cae8666e407d9ddc44da97a432b3a4ab6 100755 (executable)
@@ -440,19 +440,19 @@ void Osal_qmssBeginMemAccess (void *blockPtr, uint32_t size)
 \r
 void  Osal_qmssEndMemAccess (void *blockPtr, uint32_t size)\r
 {\r
-    Osal_writeBackCache(blockPtr,size);\r
+    //Osal_writeBackCache(blockPtr,size);\r
     return;\r
 }\r
 \r
 void Osal_cppiBeginMemAccess (void *blockPtr, uint32_t size)\r
 {\r
-    Osal_invalidateCache(blockPtr,size);\r
+    //Osal_invalidateCache(blockPtr,size);\r
     return;\r
 }\r
 \r
 void Osal_cppiEndMemAccess (void *blockPtr, uint32_t size)\r
 {\r
-    Osal_writeBackCache(blockPtr,size);\r
+    //Osal_writeBackCache(blockPtr,size);\r
     return;\r
 }\r
 \r
@@ -660,12 +660,13 @@ void* Osal_qmssConvertDescVirtToPhy(void *descAddr)
         Cppi_HostDesc *prevBDPtr = 0;\r
         while (nextBDPtr)\r
         {\r
-            void *buffPtr=NULL;\r
+            void *buffPtr;\r
             if (nextBDPtr->buffPtr)\r
             {\r
                 buffPtr = (void *)nextBDPtr->buffPtr;\r
                 nextBDPtr->buffPtr = (uint32_t)_Osal_qmssVirtToPhy((void *)(nextBDPtr->buffPtr));\r
                 if (!(nextBDPtr->buffPtr)) return (void *)0;\r
+                Osal_writeBackCache(buffPtr, nextBDPtr->buffLen);\r
             }\r
 \r
             if (nextBDPtr->origBuffPtr)\r
@@ -682,8 +683,7 @@ void* Osal_qmssConvertDescVirtToPhy(void *descAddr)
                 if (!(prevBDPtr->nextBDPtr)) return (void *)0;\r
             }\r
 \r
-            if (buffPtr) Qmss_osalEndMemAccess(buffPtr, prevBDPtr->buffLen);\r
-            Qmss_osalEndMemAccess(prevBDPtr, TUNE_NETAPI_DESC_SIZE);\r
+            Osal_writeBackCache(prevBDPtr, TUNE_NETAPI_DESC_SIZE);\r
         }\r
         descAddr = _Osal_qmssVirtToPhy(descAddr);\r
         if (!descAddr) return (void *)0;\r
@@ -691,6 +691,7 @@ void* Osal_qmssConvertDescVirtToPhy(void *descAddr)
 #ifdef ASSUME_ALL_DESCRIPTOR \r
     else if (Cppi_getDescType((Cppi_Desc *)QMSS_DESC_PTR(descAddr)) == Cppi_DescType_MONOLITHIC)\r
     {\r
+        Osal_writeBackCache(descAddr, TUNE_NETAPI_DESC_SIZE);\r
         descAddr = _Osal_qmssVirtToPhy(descAddr);\r
         if (!descAddr) return (void *)0;\r
     }\r
@@ -716,12 +717,12 @@ void* Osal_qmssConvertDescPhyToVirt(void *descAddr)
         Cppi_HostDesc *nextBDPtr = (Cppi_HostDesc *)QMSS_DESC_PTR(descAddr);\r
         while (nextBDPtr)\r
         {\r
-            //Qmss_osalBeginMemAccess(nextBDPtr, TUNE_NETAPI_DESC_SIZE);\r
+            //Osal_invalidateCache(nextBDPtr, TUNE_NETAPI_DESC_SIZE);\r
             if (nextBDPtr->buffPtr)\r
             {\r
                 nextBDPtr->buffPtr = (uint32_t)_Osal_qmssPhyToVirt((void *)(nextBDPtr->buffPtr));\r
                 if (!(nextBDPtr->buffPtr)) return (void *)0;\r
-                //Qmss_osalBeginMemAccess((void *)(nextBDPtr->buffPtr), nextBDPtr->buffLen);\r
+                //Osal_invalidateCache((void *)(nextBDPtr->buffPtr), nextBDPtr->buffLen);\r
             }\r
 \r
             if (nextBDPtr->origBuffPtr)\r
@@ -744,6 +745,7 @@ void* Osal_qmssConvertDescPhyToVirt(void *descAddr)
     {\r
         descAddr = _Osal_qmssPhyToVirt(descAddr);\r
         if (!descAddr) return (void *)0;\r
+        //Osal_invalidateCache(descAddr, TUNE_NETAPI_DESC_SIZE);\r
     }\r
 #endif\r
     return descAddr;\r