]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove iScsi driver's dependency on IntelFrameworkPkg.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 17 Apr 2009 08:49:00 +0000 (08:49 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 17 Apr 2009 08:49:00 +0000 (08:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8126 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.h

index 3587c307abf16a18b8c7c6f355bcb970e807851c..ae9055166c59a51bde5ea435f4ea981cd74dd475 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Component description file for IScsi module.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,8 +65,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 [Packages]\r
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
 \r
 [LibraryClasses]\r
   UefiDriverEntryPoint\r
@@ -89,7 +87,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   gEfiHiiDatabaseProtocolGuid\r
   gEfiHiiConfigAccessProtocolGuid\r
   gEfiPciIoProtocolGuid\r
-  gEfiAcpiSupportProtocolGuid\r
+  gEfiAcpiTableProtocolGuid\r
   gEfiDhcp4ProtocolGuid\r
   gEfiDhcp4ServiceBindingProtocolGuid\r
 \r
index 0f92fad1a8c916c25f5fd0ae6888643d46291776..60a11b2e0d6ecd4cb92ddbe1429c8a8a50a42b88 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation for iSCSI Boot Firmware Table publication.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "IScsiImpl.h"\r
 \r
+BOOLEAN mIbftInstalled = FALSE;\r
+UINTN   mTableKey;\r
+\r
 /**\r
   Initialize the header of the iSCSI Boot Firmware Table.\r
   \r
@@ -440,56 +443,28 @@ IScsiPublishIbft (
   )\r
 {\r
   EFI_STATUS                                Status;\r
-  UINTN                                     TableHandle;\r
-  EFI_ACPI_SUPPORT_PROTOCOL                 *AcpiSupport;\r
+  EFI_ACPI_TABLE_PROTOCOL                   *AcpiTableProtocol;\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table;\r
   UINTN                                     HandleCount;\r
   EFI_HANDLE                                *HandleBuffer;\r
   UINT8                                     *Heap;\r
-  INTN                                      Index;\r
-  EFI_ACPI_TABLE_VERSION                    Version;\r
-  UINT32                                    Signature;\r
 \r
-  Status = gBS->LocateProtocol (&gEfiAcpiSupportProtocolGuid, NULL, (VOID **)&AcpiSupport);\r
+  Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);\r
   if (EFI_ERROR (Status)) {\r
     return ;\r
   }\r
-  //\r
-  // Try to remove the old iSCSI Boot Firmware Table.\r
-  //\r
-  for (Index = 0;; Index++) {\r
-    Status = AcpiSupport->GetAcpiTable (\r
-                            AcpiSupport,\r
-                            Index,\r
-                            (VOID **)&Table,\r
-                            &Version,\r
-                            &TableHandle\r
-                            );\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    Signature = Table->Signature;\r
-    gBS->FreePool (Table);\r
-\r
-    if (Signature == EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE) {\r
-      //\r
-      // Remove the table.\r
-      //\r
-      Status = AcpiSupport->SetAcpiTable (\r
-                              AcpiSupport,\r
-                              NULL,\r
-                              FALSE,\r
-                              Version,\r
-                              &TableHandle\r
-                              );\r
-      if (EFI_ERROR (Status)) {\r
-        return ;\r
-      }\r
 \r
-      break;\r
+  if (mIbftInstalled) {\r
+    Status = AcpiTableProtocol->UninstallAcpiTable (\r
+                                  AcpiTableProtocol,\r
+                                  mTableKey\r
+                                  );\r
+    if (EFI_ERROR (Status)) {\r
+      return ;\r
     }\r
+    mIbftInstalled = FALSE;\r
   }\r
+\r
   //\r
   // Get all iSCSI private protocols.\r
   //\r
@@ -521,23 +496,21 @@ IScsiPublishIbft (
   IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);\r
   IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);\r
 \r
-  gBS->FreePool (HandleBuffer);\r
-\r
-  TableHandle = 0;\r
+  FreePool (HandleBuffer);\r
 \r
   //\r
   // Install or update the iBFT table.\r
   //\r
-  Status = AcpiSupport->SetAcpiTable (\r
-                          AcpiSupport,\r
-                          Table,\r
-                          TRUE,\r
-                          EFI_ACPI_TABLE_VERSION_3_0,\r
-                          &TableHandle\r
-                          );\r
-  if (!EFI_ERROR (Status)) {\r
-    AcpiSupport->PublishTables (AcpiSupport, EFI_ACPI_TABLE_VERSION_3_0);\r
+  Status = AcpiTableProtocol->InstallAcpiTable (\r
+                                AcpiTableProtocol,\r
+                                Table,\r
+                                Table->Length,\r
+                                &mTableKey\r
+                                );\r
+  if (EFI_ERROR(Status)) {\r
+    return;\r
   }\r
 \r
-  gBS->FreePool (Table);\r
+  mIbftInstalled = TRUE;\r
+  FreePool (Table);\r
 }\r
index a21990e3a21ba74a714a2d2c450668786522d281..679a4125d67e31bc378d2409418b95f5ce475837 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Some extra definitions for iBFT.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define _ISCSI_IBFT_H_\r
 \r
 #include <IndustryStandard/IScsiBootFirmwareTable.h>\r
-#include <Protocol/AcpiSupport.h>\r
+#include <Protocol/AcpiTable.h>\r
 #include <Protocol/PciIo.h>\r
 \r
 #define IBFT_TABLE_VAR_NAME L"iBFT"\r