/** @file\r
Implementation for iSCSI Boot Firmware Table publication.\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
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
Target->Port = NvData->TargetPort;\r
\r
if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {\r
- Target->CHAPType = AuthConfig->CHAPType;\r
+ if (AuthConfig->CHAPType == ISCSI_CHAP_UNI) {\r
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP;\r
+ } else if (AuthConfig->CHAPType == ISCSI_CHAP_MUTUAL) {\r
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP;\r
+ }\r
} else if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_NONE) {\r
- Target->CHAPType = ISCSI_AUTH_TYPE_NONE;\r
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP;\r
}\r
\r
Target->NicIndex = (UINT8) Index;\r
Target->CHAPSecretLength = Length;\r
Target->CHAPSecretOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);\r
\r
- if (Target->CHAPType == ISCSI_CHAP_MUTUAL) {\r
+ if (Target->CHAPType == EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP) {\r
//\r
// Reverse CHAP Name.\r
//\r
EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table;\r
EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp;\r
EFI_ACPI_DESCRIPTION_HEADER *Rsdt;\r
+ EFI_ACPI_DESCRIPTION_HEADER *Xsdt;\r
UINT8 *Heap;\r
UINT8 Checksum;\r
- UINTN Index;\r
\r
+ Rsdt = NULL;\r
+ Xsdt = NULL;\r
\r
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **) &AcpiTableProtocol);\r
if (EFI_ERROR (Status)) {\r
//\r
// Find ACPI table RSD_PTR from the 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
+ Status = EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID **) &Rsdp);\r
+ if (EFI_ERROR (Status)) {\r
+ Status = EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (VOID **) &Rsdp);\r
}\r
\r
- if (Rsdp == NULL) {\r
+ if (EFI_ERROR (Status) || (Rsdp == NULL)) {\r
return ;\r
- } else {\r
+ } else if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION && Rsdp->XsdtAddress != 0) {\r
+ Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress;\r
+ } else if (Rsdp->RsdtAddress != 0) {\r
Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress;\r
}\r
\r
+ if ((Xsdt == NULL) && (Rsdt == NULL)) {\r
+ return ;\r
+ }\r
+\r
if (mIbftInstalled) {\r
Status = AcpiTableProtocol->UninstallAcpiTable (\r
AcpiTableProtocol,\r
//\r
// Fill in the various section of the iSCSI Boot Firmware Table.\r
//\r
- IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);\r
+ if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) {\r
+ IScsiInitIbfTableHeader (Table, Xsdt->OemId, &Xsdt->OemTableId);\r
+ } else {\r
+ IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);\r
+ }\r
+\r
IScsiInitControlSection (Table);\r
IScsiFillInitiatorSection (Table, &Heap);\r
IScsiFillNICAndTargetSections (Table, &Heap);\r