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
This commit is contained in:
eric_tian 2009-06-24 02:30:53 +00:00
parent 630d580d53
commit 7e038442a8
3 changed files with 6 additions and 39 deletions

View File

@ -1380,38 +1380,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 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. this UNDI is supporting and removes the NIC_DATA_POINTER from the array.
@ -1423,7 +1391,6 @@ ChkSum (
@return None @return None
**/ **/
// TODO: PxePtr - add argument and description to function comment
VOID VOID
PxeUpdate ( PxeUpdate (
IN NIC_DATA_INSTANCE *NicPtr, IN NIC_DATA_INSTANCE *NicPtr,
@ -1438,7 +1405,7 @@ PxeUpdate (
PxePtr->IFcnt--; PxePtr->IFcnt--;
} }
PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len)); PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
return ; return ;
} }
@ -1446,7 +1413,7 @@ PxeUpdate (
// number of NICs this undi supports // number of NICs this undi supports
// //
PxePtr->IFcnt++; PxePtr->IFcnt++;
PxePtr->Fudge = (UINT8) (PxePtr->Fudge - ChkSum ((VOID *) PxePtr, PxePtr->Len)); PxePtr->Fudge = (UINT8) (PxePtr->Fudge - CalculateSum8 ((VOID *) PxePtr, PxePtr->Len));
return ; return ;
} }
@ -1455,14 +1422,12 @@ PxeUpdate (
/** /**
Initialize the !PXE structure 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 EFI_SUCCESS This driver is added to Controller.
@retval other This driver does not support this device. @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 VOID
PxeStructInit ( PxeStructInit (
IN PXE_SW_UNDI *PxePtr IN PXE_SW_UNDI *PxePtr
@ -1507,6 +1472,6 @@ PxeStructInit (
PxePtr->BusCnt = 1; PxePtr->BusCnt = 1;
PxePtr->BusType[0] = PXE_BUSTYPE_PCI; 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));
} }

View File

@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h> #include <Library/DevicePathLib.h>
#include <IndustryStandard/Pci.h> #include <IndustryStandard/Pci.h>

View File

@ -46,6 +46,7 @@
DebugLib DebugLib
UefiRuntimeLib UefiRuntimeLib
UefiDriverEntryPoint UefiDriverEntryPoint
BaseLib
[Protocols] [Protocols]
gEfiNetworkInterfaceIdentifierProtocolGuid_31 gEfiNetworkInterfaceIdentifierProtocolGuid_31