From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id EF07C1A1DF3 for ; Thu, 11 Aug 2016 00:19:21 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 11 Aug 2016 00:19:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,503,1464678000"; d="scan'208";a="863537966" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 11 Aug 2016 00:19:22 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 11 Aug 2016 00:19:21 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.116]) with mapi id 14.03.0248.002; Thu, 11 Aug 2016 15:19:18 +0800 From: "Zhang, Lubo" To: "Dong, Eric" CC: "Ye, Ting" , "Fu, Siyuan" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver Thread-Index: AQHR83gONfkVWuUfl0GKFWv/2l2o5KBDWjCQ Date: Thu, 11 Aug 2016 07:19:18 +0000 Message-ID: <7619447B08B8F74DA4FF2A813B79803B01A4EDF7@shsmsx102.ccr.corp.intel.com> References: <1470882464-25832-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1470882464-25832-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg: Refine codes of iSCSI driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 07:19:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Eric Do you have any comments for this patch. Best regards Lubo=20 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhan= g Lubo Sent: Thursday, August 11, 2016 10:28 AM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Dong, E= ric Subject: [edk2] [patch] 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. T= he default is 0x3E. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Eric Dong Cc: Ye Ting Cc: Fu Siyuan --- .../Universal/Network/IScsiDxe/IScsiIbft.c | 35 ++++++++++++------= ---- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModul= ePkg/Universal/Network/IScsiDxe/IScsiIbft.c index e5f685f..45d89a6 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c @@ -434,42 +434,42 @@ IScsiPublishIbft ( EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table; UINTN HandleCount; 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 =3D NULL; + Xsdt =3D NULL; =20 Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **)&AcpiTableProtocol); if (EFI_ERROR (Status)) { return ; } =20 =20 // // Find ACPI table RSD_PTR from system table // - for (Index =3D 0, Rsdp =3D NULL; Index < gST->NumberOfTableEntries; Inde= x++) { - if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAc= pi20TableGuid) || - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi= 10TableGuid) || - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi= TableGuid) - ) { - // - // A match was found. - // - Rsdp =3D (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->Confi= gurationTable[Index].VendorTable; - break; - } + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID=20 + **) &Rsdp); if (EFI_ERROR (Status)) { + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid,=20 + (VOID **) &Rsdp); } =20 - if (Rsdp =3D=3D NULL) { + if (EFI_ERROR (Status) || (Rsdp =3D=3D NULL)) { return ; - } else { + } else if (Rsdp->Revision >=3D EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POIN= TER_REVISION && Rsdp->XsdtAddress !=3D 0) { + Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress; =20 + } else if (Rsdp->RsdtAddress !=3D 0) { Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress; } =20 + if ((Xsdt =3D=3D NULL) && (Rsdt =3D=3D NULL)) { + return ; + } =20 if (mIbftInstalled) { Status =3D AcpiTableProtocol->UninstallAcpiTable ( AcpiTableProtocol, mTableKey @@ -504,11 +504,16 @@ IScsiPub= lishIbft ( Heap =3D (UINT8 *) Table + IBFT_HEAP_OFFSET; =20 // // Fill in the various section of the iSCSI Boot Firmware Table. // - IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId); + if (Rsdp->Revision >=3D EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REV= ISION) { + IScsiInitIbfTableHeader (Table, Xsdt->OemId, &Xsdt->OemTableId); }=20 + else { + IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId); } + IScsiInitControlSection (Table, HandleCount); IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]); IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer); =20 Checksum =3D CalculateCheckSum8((UINT8 *)Table, Table->Length); -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel