diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-24 02:30:53 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-24 02:30:53 +0000 |
commit | 7e038442a84e882ddc8a6b2e23243c6d4e371090 (patch) | |
tree | 21e68d75f8c4c8eae99ffa6edf53c6e31d538ebf /MdeModulePkg | |
parent | 630d580d530d3154ad90eee3f3688ab00b335275 (diff) | |
download | edk2-platforms-7e038442a84e882ddc8a6b2e23243c6d4e371090.tar.xz |
remove the self-implementation on checksum() in this module by using BaseLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8637 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c | 43 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h | 1 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf | 1 |
3 files changed, 6 insertions, 39 deletions
diff --git a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c index f169d88ffe..670fa18d53 100644 --- a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c +++ b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Decode.c @@ -1381,38 +1381,6 @@ badcdb: /**
- This does an 8 bit check sum of the passed in buffer for Len bytes.
- This is primarily used to update the check sum in the SW UNDI header.
-
- @param Buffer Pointer to the passed in buffer to check sum
- @param Len Length of buffer to be check summed in bytes.
-
- @return None
-
-**/
-UINT8
-ChkSum (
- IN VOID *Buffer,
- IN UINT16 Len
- )
-{
- UINT8 Chksum;
- INT8 *Bp;
-
- Chksum = 0;
- if ((Bp = Buffer) != NULL) {
- while (Len--) {
- Chksum = (UINT8) (Chksum +*Bp++);
-
- }
-
- }
-
- return Chksum;
-}
-
-
-/**
When called with a null NicPtr, this routine decrements the number of NICs
this UNDI is supporting and removes the NIC_DATA_POINTER from the array.
Otherwise, it increments the number of NICs this UNDI is supported and
@@ -1423,7 +1391,6 @@ ChkSum ( @return None
**/
-// TODO: PxePtr - add argument and description to function comment
VOID
PxeUpdate (
IN NIC_DATA_INSTANCE *NicPtr,
@@ -1438,7 +1405,7 @@ PxeUpdate ( PxePtr->IFcnt--;
}
- PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));
+ PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
return ;
}
@@ -1446,7 +1413,7 @@ PxeUpdate ( // number of NICs this undi supports
//
PxePtr->IFcnt++;
- PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));
+ PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
return ;
}
@@ -1455,14 +1422,12 @@ PxeUpdate ( /**
Initialize the !PXE structure
- @param RemainingDevicePath Not used, always produce all possible children.
+ @param PxePtr Pointer to SW_UNDI data structure.
@retval EFI_SUCCESS This driver is added to Controller.
@retval other This driver does not support this device.
**/
-// TODO: PxePtr - add argument and description to function comment
-// TODO: VersionFlag - add argument and description to function comment
VOID
PxeStructInit (
IN PXE_SW_UNDI *PxePtr
@@ -1507,6 +1472,6 @@ PxeStructInit ( PxePtr->BusCnt = 1;
PxePtr->BusType[0] = PXE_BUSTYPE_PCI;
- PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len));
+ PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
}
diff --git a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h index 256da46b9d..fc6e3525ce 100644 --- a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h +++ b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/Undi32.h @@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
+#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <IndustryStandard/Pci.h>
diff --git a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf index 2fd1da2125..2eee03efdf 100644 --- a/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf +++ b/MdeModulePkg/Bus/Pci/UndiRuntimeDxe/UndiRuntimeDxe.inf @@ -46,6 +46,7 @@ DebugLib
UefiRuntimeLib
UefiDriverEntryPoint
+ BaseLib
[Protocols]
gEfiNetworkInterfaceIdentifierProtocolGuid_31
|