From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 945311A1DF3 for ; Thu, 11 Aug 2016 01:43:56 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 11 Aug 2016 01:43:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,504,1464678000"; d="scan'208";a="1039196535" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 11 Aug 2016 01:43:54 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 11 Aug 2016 01:43:54 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 11 Aug 2016 01:43:53 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.181]) with mapi id 14.03.0248.002; Thu, 11 Aug 2016 16:43:52 +0800 From: "Dong, Eric" To: "Zhang, Lubo" CC: "Ye, Ting" , "Fu, Siyuan" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver Thread-Index: AQHR83gAmX9ENHNTeU2MxKfb8B9uw6BC1EwAgACdpSA= Date: Thu, 11 Aug 2016 08:43:51 +0000 Message-ID: References: <1470882464-25832-1-git-send-email-lubo.zhang@intel.com> <7619447B08B8F74DA4FF2A813B79803B01A4EDF7@shsmsx102.ccr.corp.intel.com> In-Reply-To: <7619447B08B8F74DA4FF2A813B79803B01A4EDF7@shsmsx102.ccr.corp.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 08:43:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Zhang, Lubo > Sent: Thursday, August 11, 2016 3:19 PM > To: Dong, Eric > Cc: Ye, Ting; Fu, Siyuan; edk2-devel@lists.01.org > Subject: RE: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver >=20 > Hi Eric > Do you have any comments for this patch. >=20 > Best regards > Lubo >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zh= ang Lubo > Sent: Thursday, August 11, 2016 10:28 AM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Dong,= Eric > Subject: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver >=20 > The RSDT is only used when the bios need to support ACPI 1.0 version. Whe= n change PcdAcpiExposedTableVersions to 0x3C, it will not > support ACPI 1.0. The default is 0x3E. >=20 > 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(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeMod= ulePkg/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, (VOI= D **)&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; In= dex++) { > - if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfi= Acpi20TableGuid) || > - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAc= pi10TableGuid) || > - CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAc= piTableGuid) > - ) { > - // > - // A match was found. > - // > - Rsdp =3D (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->Con= figurationTable[Index].VendorTable; > - break; > - } > + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, (VOID > + **) &Rsdp); if (EFI_ERROR (Status)) { > + Status =3D EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, > + (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_PO= INTER_REVISION && Rsdp->XsdtAddress !=3D 0) { > + Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress; > + } 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 @@ IScsiP= ublishIbft ( > 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_R= EVISION) { > + 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= ); >=20 > Checksum =3D CalculateCheckSum8((UINT8 *)Table, Table->Length); > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel