Enhance iSCSI ibft table for copy oemid and oemtableID from acpi tables.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Jul 2009 03:06:50 +0000 (03:06 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Jul 2009 03:06:50 +0000 (03:06 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8752 6f19259b-4bc3-4df7-8a09-765794883524

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

index 8f1aaeacb135b2231a472dd993de0833b8ed4a30..2e9736ec3271fbf33d851aaab0b54365b3ae9ffb 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Vfr has a limit on the size, it's 255 bytes.\r
 //\r
-#define ISCSI_NAME_IFR_MAX_SIZE   126\r
+#define ISCSI_NAME_IFR_MAX_SIZE   223\r
 \r
 #define IP_MIN_SIZE               7\r
 #define IP_MAX_SIZE               15\r
index b1415252c31ba7b892f9ab99e378890f0bf08554..a3b6789eb733f9e171603fc3136078671aca4829 100644 (file)
@@ -95,4 +95,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 [Guids]\r
   gEfiEventExitBootServicesGuid\r
-  gEfiIfrTianoGuid                              ## CONSUMES ## Guid\r
+  gEfiIfrTianoGuid                              ## CONSUMES ## GUID\r
+  gEfiAcpiTableGuid                             ## CONSUMES ## GUID\r
+  gEfiAcpi10TableGuid                           ## CONSUMES ## GUID\r
+  gEfiAcpi20TableGuid                           ## CONSUMES ## GUID
\ No newline at end of file
index 6d2b184aad9ea1909cdea4c880c75e6b181e09e5..d712331189743d8b55aacf3b275630de8e90926e 100644 (file)
@@ -24,7 +24,9 @@ UINTN   mTableKey;
 **/\r
 VOID\r
 IScsiInitIbfTableHeader (\r
-  OUT EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER  *Header\r
+  OUT EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER   *Header,\r
+  IN  UINT8                                       *OemId,\r
+  IN  UINT64                                      *OemTableId\r
   )\r
 {\r
   ZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER));\r
@@ -39,6 +41,9 @@ IScsiInitIbfTableHeader (
   Header->OemId[2]  = 'T';\r
   Header->OemId[3]  = 'E';\r
   Header->OemId[4]  = 'L';\r
+  \r
+  CopyMem (Header->OemId, OemId, sizeof (Header->OemId));\r
+  Header->OemTableId = *OemTableId;\r
 }\r
 \r
 /**\r
@@ -449,12 +454,39 @@ IScsiPublishIbft (
   EFI_HANDLE                                *HandleBuffer;\r
   UINT8                                     *Heap;\r
   UINT8                                     Checksum;\r
+  UINTN                                         Index;\r
+  EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *Rsdp;\r
+  EFI_ACPI_DESCRIPTION_HEADER                   *Rsdt;\r
 \r
   Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);\r
   if (EFI_ERROR (Status)) {\r
     return ;\r
   }\r
 \r
+\r
+  //\r
+  // Find ACPI table RSD_PTR from system table\r
+  //\r
+  for (Index = 0, Rsdp = NULL; Index < gST->NumberOfTableEntries; Index++) {\r
+    if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi20TableGuid) ||\r
+      CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi10TableGuid) ||\r
+      CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpiTableGuid)\r
+      ) {\r
+      //\r
+      // A match was found.\r
+      //\r
+      Rsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->ConfigurationTable[Index].VendorTable;\r
+      break;\r
+    }\r
+  }\r
+\r
+  if (Rsdp == NULL) {\r
+    return ;\r
+  } else {\r
+    Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress;\r
+  }\r
+\r
+\r
   if (mIbftInstalled) {\r
     Status = AcpiTableProtocol->UninstallAcpiTable (\r
                                   AcpiTableProtocol,\r
@@ -492,7 +524,7 @@ IScsiPublishIbft (
   //\r
   // Fill in the various section of the iSCSI Boot Firmware Table.\r
   //\r
-  IScsiInitIbfTableHeader (Table);\r
+  IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);\r
   IScsiInitControlSection (Table, HandleCount);\r
   IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);\r
   IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);\r
index ddcdb50cf5573bff37372b89c38aae8ba95b27a5..66084964a011be0cf72c304196db56416397e69f 100644 (file)
@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
 #include <Guid/EventGroup.h>\r
+#include <Guid/Acpi.h>\r
 \r
 #include "IScsiCommon.h"\r
 #include "IScsiDriver.h"\r