From 35c290c5805c4b0266898040e44b905c19aeda3d Mon Sep 17 00:00:00 2001 From: eric_tian Date: Wed, 24 Jun 2009 09:39:47 +0000 Subject: do checksum before installing IBFT. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8649 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c index 60a11b2..6d2b184 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c @@ -448,6 +448,7 @@ IScsiPublishIbft ( UINTN HandleCount; EFI_HANDLE *HandleBuffer; UINT8 *Heap; + UINT8 Checksum; Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol); if (EFI_ERROR (Status)) { @@ -481,7 +482,7 @@ IScsiPublishIbft ( // // Allocate 4k bytes to hold the ACPI table. // - Table = AllocatePool (IBFT_MAX_SIZE); + Table = AllocateZeroPool (IBFT_MAX_SIZE); if (Table == NULL) { return ; } @@ -496,6 +497,9 @@ IScsiPublishIbft ( IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]); IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer); + Checksum = CalculateCheckSum8((UINT8 *)Table, Table->Length); + Table->Checksum = Checksum; + FreePool (HandleBuffer); // -- cgit v1.1