diff options
author | Zhang Lubo <lubo.zhang@intel.com> | 2016-08-11 10:24:10 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2016-08-18 13:53:55 +0800 |
commit | 998731099efd13edcd64cdd375a890a85f57ee6a (patch) | |
tree | 799163b7df050429604c4236774331b368d39d11 /MdeModulePkg/Universal | |
parent | a012df5ec643a0c08c2b723a02919a5c9373ca74 (diff) | |
download | edk2-998731099efd13edcd64cdd375a890a85f57ee6a.tar.gz edk2-998731099efd13edcd64cdd375a890a85f57ee6a.tar.bz2 edk2-998731099efd13edcd64cdd375a890a85f57ee6a.zip |
MdeModulePkg: Refine codes of iSCSI driver
The RSDT is only used when the bios need to support ACPI 1.0
version. When change PcdAcpiExposedTableVersions to 0x3C, it
will not support ACPI 1.0. The default is 0x3E.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c index e5f685fc6d..45d89a6933 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c @@ -436,9 +436,12 @@ IScsiPublishIbft ( EFI_HANDLE *HandleBuffer;
UINT8 *Heap;
UINT8 Checksum;
- UINTN Index;
EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp;
EFI_ACPI_DESCRIPTION_HEADER *Rsdt;
+ EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
+
+ Rsdt = NULL;
+ Xsdt = NULL;
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (EFI_ERROR (Status)) {
@@ -449,25 +452,22 @@ IScsiPublishIbft ( //
// Find ACPI table RSD_PTR from system table
//
- for (Index = 0, Rsdp = NULL; Index < gST->NumberOfTableEntries; Index++) {
- if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi20TableGuid) ||
- CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi10TableGuid) ||
- CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpiTableGuid)
- ) {
- //
- // A match was found.
- //
- Rsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->ConfigurationTable[Index].VendorTable;
- break;
- }
+ Status = EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID **) &Rsdp);
+ if (EFI_ERROR (Status)) {
+ Status = EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (VOID **) &Rsdp);
}
- if (Rsdp == NULL) {
+ if (EFI_ERROR (Status) || (Rsdp == NULL)) {
return ;
- } else {
+ } else if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION && Rsdp->XsdtAddress != 0) {
+ Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress;
+ } else if (Rsdp->RsdtAddress != 0) {
Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress;
}
+ if ((Xsdt == NULL) && (Rsdt == NULL)) {
+ return ;
+ }
if (mIbftInstalled) {
Status = AcpiTableProtocol->UninstallAcpiTable (
@@ -506,7 +506,12 @@ IScsiPublishIbft ( //
// Fill in the various section of the iSCSI Boot Firmware Table.
//
- IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);
+ if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) {
+ IScsiInitIbfTableHeader (Table, Xsdt->OemId, &Xsdt->OemTableId);
+ } else {
+ IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);
+ }
+
IScsiInitControlSection (Table, HandleCount);
IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);
IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);
|