]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c
remove the self-implementation on checksum() in this module by using BaseLib.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UndiRuntimeDxe / Decode.c
index f169d88ffe9ef5357cf250113929cd7b292964aa..670fa18d533dfe64ea6cd663aa6c1e9fc737cdbb 100644 (file)
@@ -1380,38 +1380,6 @@ badcdb:
 }\r
 \r
 \r
-/**\r
-  This does an 8 bit check sum of the passed in buffer for Len bytes.\r
-  This is primarily used to update the check sum in the SW UNDI header.\r
-\r
-  @param  Buffer               Pointer to the passed in buffer to check sum\r
-  @param  Len                  Length of buffer to be check summed in bytes.\r
-\r
-  @return None\r
-\r
-**/\r
-UINT8\r
-ChkSum (\r
-  IN  VOID   *Buffer,\r
-  IN  UINT16 Len\r
-  )\r
-{\r
-  UINT8 Chksum;\r
-  INT8  *Bp;\r
-\r
-  Chksum = 0;\r
-  if ((Bp = Buffer) != NULL) {\r
-    while (Len--) {\r
-      Chksum = (UINT8) (Chksum +*Bp++);\r
-\r
-    }\r
-\r
-  }\r
-\r
-  return Chksum;\r
-}\r
-\r
-\r
 /**\r
   When called with a null NicPtr, this routine decrements the number of NICs\r
   this UNDI is supporting and removes the NIC_DATA_POINTER from the array.\r
@@ -1423,7 +1391,6 @@ ChkSum (
   @return None\r
 \r
 **/\r
-// TODO:    PxePtr - add argument and description to function comment\r
 VOID\r
 PxeUpdate (\r
   IN  NIC_DATA_INSTANCE *NicPtr,\r
@@ -1438,7 +1405,7 @@ PxeUpdate (
       PxePtr->IFcnt--;\r
     }\r
 \r
-    PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));\r
+    PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
     return ;\r
   }\r
 \r
@@ -1446,7 +1413,7 @@ PxeUpdate (
   // number of NICs this undi supports\r
   //\r
   PxePtr->IFcnt++;\r
-  PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));\r
+  PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
 \r
   return ;\r
 }\r
@@ -1455,14 +1422,12 @@ PxeUpdate (
 /**\r
   Initialize the !PXE structure\r
 \r
-  @param  RemainingDevicePath  Not used, always produce all possible children.\r
+  @param  PxePtr               Pointer to SW_UNDI data structure.\r
 \r
   @retval EFI_SUCCESS          This driver is added to Controller.\r
   @retval other                This driver does not support this device.\r
 \r
 **/\r
-// TODO:    PxePtr - add argument and description to function comment\r
-// TODO:    VersionFlag - add argument and description to function comment\r
 VOID\r
 PxeStructInit (\r
   IN PXE_SW_UNDI *PxePtr\r
@@ -1507,6 +1472,6 @@ PxeStructInit (
   PxePtr->BusCnt        = 1;\r
   PxePtr->BusType[0]    = PXE_BUSTYPE_PCI;\r
 \r
-  PxePtr->Fudge         = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));\r
+  PxePtr->Fudge         = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));\r
 }\r
 \r