]> git.proxmox.com Git - mirror_edk2.git/commitdiff
remove the self-implementation on checksum() in this module by using BaseLib.
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jun 2009 02:30:53 +0000 (02:30 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jun 2009 02:30:53 +0000 (02:30 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8637 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c
MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h
MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf

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
index 256da46b9d1f62be23a6606b0891fb957dd96aac..fc6e3525ce1c747946e23750eaf5ccfa91eed070 100644 (file)
@@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
+#include <Library/BaseLib.h>\r
 #include <Library/DevicePathLib.h>\r
 \r
 #include <IndustryStandard/Pci.h>\r
index 2fd1da2125d340f1cb7ae2591bee75b51d2f553a..2eee03efdfcd48170d54ab05cd3a4079351e498f 100644 (file)
@@ -46,6 +46,7 @@
   DebugLib\r
   UefiRuntimeLib\r
   UefiDriverEntryPoint\r
+  BaseLib\r
 \r
 [Protocols]\r
   gEfiNetworkInterfaceIdentifierProtocolGuid_31\r