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 30D461A1DF1 for ; Wed, 10 Aug 2016 23:14:18 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 10 Aug 2016 23:14:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,503,1464678000"; d="scan'208";a="1012366326" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 10 Aug 2016 23:14:17 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 10 Aug 2016 23:14:17 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 10 Aug 2016 23:14:17 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.8]) with mapi id 14.03.0248.002; Thu, 11 Aug 2016 14:14:14 +0800 From: "Ye, Ting" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Fu, Siyuan" Thread-Topic: [patch] NetworkPkg: Refine codes of iSCSI driver Thread-Index: AQHR83fsIRk123XVyU+9I7DMVqBUWqBDR+yg Date: Thu, 11 Aug 2016 06:14:14 +0000 Message-ID: References: <1470882425-41952-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1470882425-41952-1-git-send-email-lubo.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGI5NzQ1MTEtOTIwYi00YWQ1LTg5YzctYWYzNzJkYTBkZTllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImUyR2xEUTQ1ZmdpTkZlNWRQV2txR2N3ckkyaHdsRjVybTRCTk00WVwvbGk4PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] NetworkPkg: 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 06:14:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Lubo, Could you please describe the changes introduced by this patch in your log = message? Thanks, Ting -----Original Message----- From: Zhang, Lubo=20 Sent: Thursday, August 11, 2016 10:27 AM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Ye, Ting ; Fu, Siy= uan Subject: [patch] NetworkPkg: 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 --- NetworkPkg/IScsiDxe/IScsiIbft.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiIbft.c b/NetworkPkg/IScsiDxe/IScsiIbf= t.c index 3c179bf..27d098d 100644 --- a/NetworkPkg/IScsiDxe/IScsiIbft.c +++ b/NetworkPkg/IScsiDxe/IScsiIbft.c @@ -454,42 +454,42 @@ IScsiPublishIbft ( EFI_STATUS Status; EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table; EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; EFI_ACPI_DESCRIPTION_HEADER *Rsdt; + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; UINT8 *Heap; UINT8 Checksum; - UINTN Index; =20 + Rsdt =3D NULL; + Xsdt =3D NULL; =20 Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **) &AcpiTableProtocol); if (EFI_ERROR (Status)) { return ; } =20 // // Find ACPI table RSD_PTR from the 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 ; + } + if (mIbftInstalled) { Status =3D AcpiTableProtocol->UninstallAcpiTable ( AcpiTableProtocol, mTableKey ); @@ -518,11 +518,16 @@ IScsiPublishIbft ( 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); IScsiFillInitiatorSection (Table, &Heap); IScsiFillNICAndTargetSections (Table, &Heap); =20 Checksum =3D CalculateCheckSum8((UINT8 *)Table, Table->Length); -- 1.9.5.msysgit.1