summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-17 08:49:00 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-17 08:49:00 +0000
commit85b990a8eb253f71d10021aad0059e0625349269 (patch)
tree13849b8540190eee52f1600af9387f8182569688 /MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
parent46a989f7ad9bc27fb9c9f064aa3b84ed8bd02294 (diff)
downloadedk2-85b990a8eb253f71d10021aad0059e0625349269.zip
edk2-85b990a8eb253f71d10021aad0059e0625349269.tar.gz
edk2-85b990a8eb253f71d10021aad0059e0625349269.tar.bz2
Remove iScsi driver's dependency on IntelFrameworkPkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8126 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c79
1 files changed, 26 insertions, 53 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index 0f92fad..60a11b2 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -1,7 +1,7 @@
/** @file
Implementation for iSCSI Boot Firmware Table publication.
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,6 +14,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "IScsiImpl.h"
+BOOLEAN mIbftInstalled = FALSE;
+UINTN mTableKey;
+
/**
Initialize the header of the iSCSI Boot Firmware Table.
@@ -440,56 +443,28 @@ IScsiPublishIbft (
)
{
EFI_STATUS Status;
- UINTN TableHandle;
- EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport;
+ EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol;
EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table;
UINTN HandleCount;
EFI_HANDLE *HandleBuffer;
UINT8 *Heap;
- INTN Index;
- EFI_ACPI_TABLE_VERSION Version;
- UINT32 Signature;
- Status = gBS->LocateProtocol (&gEfiAcpiSupportProtocolGuid, NULL, (VOID **)&AcpiSupport);
+ Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (EFI_ERROR (Status)) {
return ;
}
- //
- // Try to remove the old iSCSI Boot Firmware Table.
- //
- for (Index = 0;; Index++) {
- Status = AcpiSupport->GetAcpiTable (
- AcpiSupport,
- Index,
- (VOID **)&Table,
- &Version,
- &TableHandle
- );
- if (EFI_ERROR (Status)) {
- break;
- }
-
- Signature = Table->Signature;
- gBS->FreePool (Table);
-
- if (Signature == EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE) {
- //
- // Remove the table.
- //
- Status = AcpiSupport->SetAcpiTable (
- AcpiSupport,
- NULL,
- FALSE,
- Version,
- &TableHandle
- );
- if (EFI_ERROR (Status)) {
- return ;
- }
- break;
+ if (mIbftInstalled) {
+ Status = AcpiTableProtocol->UninstallAcpiTable (
+ AcpiTableProtocol,
+ mTableKey
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
}
+ mIbftInstalled = FALSE;
}
+
//
// Get all iSCSI private protocols.
//
@@ -521,23 +496,21 @@ IScsiPublishIbft (
IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);
IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);
- gBS->FreePool (HandleBuffer);
-
- TableHandle = 0;
+ FreePool (HandleBuffer);
//
// Install or update the iBFT table.
//
- Status = AcpiSupport->SetAcpiTable (
- AcpiSupport,
- Table,
- TRUE,
- EFI_ACPI_TABLE_VERSION_3_0,
- &TableHandle
- );
- if (!EFI_ERROR (Status)) {
- AcpiSupport->PublishTables (AcpiSupport, EFI_ACPI_TABLE_VERSION_3_0);
+ Status = AcpiTableProtocol->InstallAcpiTable (
+ AcpiTableProtocol,
+ Table,
+ Table->Length,
+ &mTableKey
+ );
+ if (EFI_ERROR(Status)) {
+ return;
}
- gBS->FreePool (Table);
+ mIbftInstalled = TRUE;
+ FreePool (Table);
}