mirror of https://github.com/acidanthera/audk.git
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:
parent
630d580d53
commit
7e038442a8
|
@ -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
|
||||
this UNDI is supporting and removes the NIC_DATA_POINTER from the array.
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
DebugLib
|
||||
UefiRuntimeLib
|
||||
UefiDriverEntryPoint
|
||||
BaseLib
|
||||
|
||||
[Protocols]
|
||||
gEfiNetworkInterfaceIdentifierProtocolGuid_31
|
||||
|
|
Loading…
Reference in New Issue