From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0C24221B02822 for ; Wed, 28 Nov 2018 17:20:00 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2018 17:20:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,292,1539673200"; d="scan'208";a="95553719" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 28 Nov 2018 17:20:00 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 17:20:00 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 17:19:59 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.203]) with mapi id 14.03.0415.000; Thu, 29 Nov 2018 09:19:57 +0800 From: "Dong, Eric" To: "Chen, Chen A" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [edk2] [PATCH] SecurityPkg: Remove dead code and inf redundant definitions. Thread-Index: AQHUhuNfkCLCHVCZPkK4jKFOMDm9iqVl8WJQ Date: Thu, 29 Nov 2018 01:19:57 +0000 Message-ID: References: <20181128062640.17320-1-chen.a.chen@intel.com> In-Reply-To: <20181128062640.17320-1-chen.a.chen@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] SecurityPkg: Remove dead code and inf redundant definitions. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 01:20:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong for Opal part. > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Chen A Chen > Sent: Wednesday, November 28, 2018 2:27 PM > To: edk2-devel@lists.01.org > Cc: Zhang, Chao B > Subject: [edk2] [PATCH] SecurityPkg: Remove dead code and inf redundant > definitions. >=20 > Fix BZ1065, https://bugzilla.tianocore.org/show_bug.cgi?id=3D1065 >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chen A Chen > Cc: Zhang Chao B > --- > SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf | 1 - > SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c | 52 ---- > SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h | 23 -- > SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h | 11 - > .../Tcg/Opal/OpalPassword/OpalHiiCallbacks.c | 87 ------ > SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c | 321 ---------------= - > ----- > SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h | 128 -------- > .../Tcg/Opal/OpalPassword/OpalPasswordDxe.inf | 2 - > .../Tcg/Opal/OpalPassword/OpalPasswordPei.inf | 1 - > SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 1 - > SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf | 1 - > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf | 1 - > SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf | 1 - > .../SecureBootConfigDxe/SecureBootConfigDxe.inf | 2 - > 14 files changed, 632 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf > b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf > index 6f9a77b868..a17fa4046d 100644 > --- a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf > +++ b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf > @@ -43,7 +43,6 @@ > UefiDriverEntryPoint > UefiBootServicesTableLib > UefiRuntimeServicesTableLib > - ReportStatusCodeLib > DebugLib > UefiLib > MemoryAllocationLib > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c > index d51865380f..0c4edd5346 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.c > @@ -969,58 +969,6 @@ AhciReset ( >=20 > } >=20 > -/** > - Send Buffer cmd to specific device. > - > - @param[in] AhciContext The pointer to the AHCI_CONTEXT. > - @param[in] Port The port number of attached ATA device= . > - @param[in] PortMultiplier The port number of port multiplier of > attached ATA device. > - @param[in, out] Buffer The Data Buffer to store IDENTIFY PACK= ET Data. > - > - @retval EFI_DEVICE_ERROR The cmd abort with error occurs. > - @retval EFI_TIMEOUT The operation is time out. > - @retval EFI_UNSUPPORTED The device is not ready for executing. > - @retval EFI_SUCCESS The cmd executes successfully. > - > -**/ > -EFI_STATUS > -EFIAPI > -AhciIdentify ( > - IN AHCI_CONTEXT *AhciContext, > - IN UINT8 Port, > - IN UINT8 PortMultiplier, > - IN OUT ATA_IDENTIFY_DATA *Buffer > - ) > -{ > - EFI_STATUS Status; > - EFI_ATA_COMMAND_BLOCK AtaCommandBlock; > - > - if (AhciContext =3D=3D NULL || Buffer =3D=3D NULL) { > - return EFI_INVALID_PARAMETER; > - } > - > - ZeroMem (&AtaCommandBlock, sizeof (EFI_ATA_COMMAND_BLOCK)); > - > - AtaCommandBlock.AtaCommand =3D ATA_CMD_IDENTIFY_DRIVE; > - AtaCommandBlock.AtaSectorCount =3D 1; > - > - Status =3D AhciPioTransfer ( > - AhciContext, > - Port, > - PortMultiplier, > - NULL, > - 0, > - TRUE, > - &AtaCommandBlock, > - NULL, > - Buffer, > - sizeof (ATA_IDENTIFY_DATA), > - ATA_TIMEOUT > - ); > - > - return Status; > -} > - > /** > Allocate transfer-related data struct which is used at AHCI mode. >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h > index 037f81ac24..2076b0411b 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalAhciMode.h > @@ -293,29 +293,6 @@ typedef struct { > UINT32 AhciBar; > } AHCI_CONTEXT; >=20 > -/** > - Send Buffer cmd to specific device. > - > - @param AhciContext The pointer to the AHCI_CONTEXT. > - @param Port The number of port. > - @param PortMultiplier The timeout Value of stop. > - @param Buffer The Data Buffer to store IDENTIFY PACKET D= ata. > - > - @retval EFI_DEVICE_ERROR The cmd abort with error occurs. > - @retval EFI_TIMEOUT The operation is time out. > - @retval EFI_UNSUPPORTED The device is not ready for executing. > - @retval EFI_SUCCESS The cmd executes successfully. > - > -**/ > -EFI_STATUS > -EFIAPI > -AhciIdentify ( > - IN AHCI_CONTEXT *AhciContext, > - IN UINT8 Port, > - IN UINT8 PortMultiplier, > - IN OUT ATA_IDENTIFY_DATA *Buffer > - ); > - > /** > Allocate transfer-related data struct which is used at AHCI mode. >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h > index a4bb19ad60..8b368fe995 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.h > @@ -285,17 +285,6 @@ OpalHiiAddPackages( > VOID > ); >=20 > -/** > - Check whether enable feature or not. > - > - @retval Return the disk number. > - > -**/ > -UINT8 > -HiiGetNumConfigRequiredOpalDisksCB( > - VOID > - ); > - > /** > Returns the driver name. >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c > index b07e38c144..31e1aa2240 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c > @@ -15,56 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > KIND, EITHER EXPRESS OR IMPLIED. >=20 > #include "OpalHii.h" >=20 > -/** > - Get Opal var name. > - The return Value must be freed by caller if not NULL > - > - @param OpalDisk The disk. > - @param Prefix The prefix string. > - > - @retval The var name string. > - > -**/ > -CHAR16* > -OpalDriverGetOpalVarName( > - OPAL_DISK *OpalDisk, > - const CHAR16 *Prefix > - ) > -{ > - OPAL_DRIVER_DEVICE* Dev; > - UINTN PrefixLen; > - UINTN NameLen; > - UINTN VarNameLen; > - CHAR16* VarName; > - > - Dev =3D DRIVER_DEVICE_FROM_OPALDISK(OpalDisk); > - if (Dev =3D=3D NULL) { > - return NULL; > - } > - > - PrefixLen =3D StrLen(Prefix); > - > - NameLen =3D 0; > - if (Dev->Name16 !=3D NULL) { > - NameLen =3D StrLen(Dev->Name16); > - } > - > - VarNameLen =3D PrefixLen + NameLen; > - > - VarName =3D (CHAR16*)AllocateZeroPool((VarNameLen + 1) * > sizeof(CHAR16)); > - if (VarName =3D=3D NULL) { > - return NULL; > - } > - > - CopyMem(VarName, Prefix, PrefixLen * sizeof(CHAR16)); > - if (Dev->Name16 !=3D NULL) { > - CopyMem(VarName + PrefixLen, Dev->Name16, NameLen * > sizeof(CHAR16)); > - } > - VarName[VarNameLen] =3D 0; > - > - return VarName; > -} > - > /** > Get the driver image handle. >=20 > @@ -79,43 +29,6 @@ HiiGetDriverImageHandleCB( > return gImageHandle; > } >=20 > -/** > - Check whether enable feature or not. > - > - @retval Return the disk number. > - > -**/ > -UINT8 > -HiiGetNumConfigRequiredOpalDisksCB( > - VOID > - ) > -{ > - UINT8 NumDisks; > - UINT8 NumLockedOpalDisks; > - OPAL_DISK *OpalDisk; > - UINT8 Index; > - > - NumLockedOpalDisks =3D 0; > - > - NumDisks =3D GetDeviceCount(); > - > - for (Index =3D 0; Index < NumDisks; Index++) { > - OpalDisk =3D HiiGetOpalDiskCB(Index); > - > - if (OpalDisk !=3D NULL) { > - if (!OpalFeatureEnabled (&OpalDisk->SupportedAttributes, &OpalDisk= - > >LockingFeature)) { > - DEBUG ((DEBUG_INFO, "Ignoring disk %u because feature is disable= d or > health has already been inspected\n", Index)); > - } else if (OpalDeviceLocked (&OpalDisk->SupportedAttributes, > &OpalDisk->LockingFeature)) { > - NumLockedOpalDisks++; > - } > - } > - } > - > - return NumLockedOpalDisks; > -} > - > - > - > /** > Returns the opaque pointer to a physical disk context. >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c > index 7657bb26e2..01c316d597 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.c > @@ -793,46 +793,6 @@ NvmeCreatePrpList ( > return PrpListPhyAddr; > } >=20 > -/** > - Check whether there are available command slots. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Qid - Queue index > - > - @retval EFI_SUCCESS - Available command slot is found > - @retval EFI_NOT_READY - No available command slot is found > - @retval EFI_DEVICE_ERROR - Error occurred on device side. > - > -**/ > -EFI_STATUS > -NvmeHasFreeCmdSlot ( > - IN NVME_CONTEXT *Nvme, > - IN UINT8 Qid > - ) > -{ > - return TRUE; > -} > - > -/** > - Check whether all command slots are clean. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Qid - Queue index > - > - @retval EFI_SUCCESS - All command slots are clean > - @retval EFI_NOT_READY - Not all command slots are clean > - @retval EFI_DEVICE_ERROR - Error occurred on device side. > - > -**/ > -EFI_STATUS > -NvmeIsAllCmdSlotClean ( > - IN NVME_CONTEXT *Nvme, > - IN UINT8 Qid > - ) > -{ > - return EFI_SUCCESS; > -} > - > /** > Waits until all NVME commands completed. >=20 > @@ -1861,284 +1821,3 @@ NvmeControllerExit ( > Nvme->State =3D NvmeStatusUnknown; > return Status; > } > - > -/** > - Read sector Data from the NVMe device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in,out] Buffer - The Buffer used to store the Data = read from > the device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be read. > - > - @retval EFI_SUCCESS - Datum are read from the device. > - @retval Others - Fail to read all the datum. > - > -**/ > -EFI_STATUS > -NvmeReadSectors ( > - IN NVME_CONTEXT *Nvme, > - IN OUT UINT64 Buffer, > - IN UINT64 Lba, > - IN UINT32 Blocks > - ) > -{ > - UINT32 Bytes; > - NVM_EXPRESS_PASS_THRU_COMMAND_PACKET CommandPacket; > - NVM_EXPRESS_COMMAND Command; > - NVM_EXPRESS_RESPONSE Response; > - EFI_STATUS Status; > - UINT32 BlockSize; > - > - BlockSize =3D Nvme->BlockSize; > - Bytes =3D Blocks * BlockSize; > - > - ZeroMem (&CommandPacket, > sizeof(NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); > - ZeroMem (&Command, sizeof(NVM_EXPRESS_COMMAND)); > - ZeroMem (&Response, sizeof(NVM_EXPRESS_RESPONSE)); > - > - CommandPacket.NvmeCmd =3D &Command; > - CommandPacket.NvmeResponse =3D &Response; > - > - CommandPacket.NvmeCmd->Cdw0.Opcode =3D NVME_IO_READ_OPC; > - CommandPacket.NvmeCmd->Cdw0.Cid =3D Nvme- > >Cid[NVME_IO_QUEUE]++; > - CommandPacket.NvmeCmd->Nsid =3D Nvme->Nsid; > - CommandPacket.TransferBuffer =3D Buffer; > - > - CommandPacket.TransferLength =3D Bytes; > - CommandPacket.CommandTimeout =3D NVME_GENERIC_TIMEOUT; > - CommandPacket.QueueId =3D NVME_IO_QUEUE; > - > - CommandPacket.NvmeCmd->Cdw10 =3D (UINT32)Lba; > - CommandPacket.NvmeCmd->Cdw11 =3D (UINT32)(RShiftU64 (Lba, 32)); > - CommandPacket.NvmeCmd->Cdw12 =3D (Blocks - 1) & 0xFFFF; > - > - CommandPacket.NvmeCmd->Flags =3D CDW10_VALID | CDW11_VALID | > CDW12_VALID; > - > - Status =3D NvmePassThru ( > - Nvme, > - Nvme->Nsid, > - 0, > - &CommandPacket > - ); > - > - return Status; > -} > - > -/** > - Write sector Data to the NVMe device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Buffer - The Buffer to be written into the = device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be written. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeWriteSectors ( > - IN NVME_CONTEXT *Nvme, > - IN UINT64 Buffer, > - IN UINT64 Lba, > - IN UINT32 Blocks > - ) > -{ > - NVM_EXPRESS_PASS_THRU_COMMAND_PACKET CommandPacket; > - NVM_EXPRESS_COMMAND Command; > - NVM_EXPRESS_RESPONSE Response; > - EFI_STATUS Status; > - UINT32 Bytes; > - UINT32 BlockSize; > - > - BlockSize =3D Nvme->BlockSize; > - Bytes =3D Blocks * BlockSize; > - > - ZeroMem (&CommandPacket, > sizeof(NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); > - ZeroMem (&Command, sizeof(NVM_EXPRESS_COMMAND)); > - ZeroMem (&Response, sizeof(NVM_EXPRESS_RESPONSE)); > - > - CommandPacket.NvmeCmd =3D &Command; > - CommandPacket.NvmeResponse =3D &Response; > - > - CommandPacket.NvmeCmd->Cdw0.Opcode =3D NVME_IO_WRITE_OPC; > - CommandPacket.NvmeCmd->Cdw0.Cid =3D Nvme- > >Cid[NVME_IO_QUEUE]++; > - CommandPacket.NvmeCmd->Nsid =3D Nvme->Nsid; > - CommandPacket.TransferBuffer =3D Buffer; > - > - CommandPacket.TransferLength =3D Bytes; > - CommandPacket.CommandTimeout =3D NVME_GENERIC_TIMEOUT; > - CommandPacket.QueueId =3D NVME_IO_QUEUE; > - > - CommandPacket.NvmeCmd->Cdw10 =3D (UINT32)Lba; > - CommandPacket.NvmeCmd->Cdw11 =3D (UINT32)(RShiftU64 (Lba, 32)); > - CommandPacket.NvmeCmd->Cdw12 =3D (Blocks - 1) & 0xFFFF; > - > - CommandPacket.MetadataBuffer =3D (UINT64)(UINTN)NULL; > - CommandPacket.MetadataLength =3D 0; > - > - CommandPacket.NvmeCmd->Flags =3D CDW10_VALID | CDW11_VALID | > CDW12_VALID; > - > - Status =3D NvmePassThru ( > - Nvme, > - Nvme->Nsid, > - 0, > - &CommandPacket > - ); > - > - return Status; > -} > - > -/** > - Flushes all modified Data to the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeFlush ( > - IN NVME_CONTEXT *Nvme > - ) > -{ > - NVM_EXPRESS_PASS_THRU_COMMAND_PACKET CommandPacket; > - NVM_EXPRESS_COMMAND Command; > - NVM_EXPRESS_RESPONSE Response; > - EFI_STATUS Status; > - > - ZeroMem (&CommandPacket, > sizeof(NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); > - ZeroMem (&Command, sizeof(NVM_EXPRESS_COMMAND)); > - ZeroMem (&Response, sizeof(NVM_EXPRESS_RESPONSE)); > - > - CommandPacket.NvmeCmd =3D &Command; > - CommandPacket.NvmeResponse =3D &Response; > - > - CommandPacket.NvmeCmd->Cdw0.Opcode =3D NVME_IO_FLUSH_OPC; > - CommandPacket.NvmeCmd->Cdw0.Cid =3D Nvme- > >Cid[NVME_IO_QUEUE]++; > - CommandPacket.NvmeCmd->Nsid =3D Nvme->Nsid; > - CommandPacket.CommandTimeout =3D NVME_GENERIC_TIMEOUT; > - CommandPacket.QueueId =3D NVME_IO_QUEUE; > - > - Status =3D NvmePassThru ( > - Nvme, > - Nvme->Nsid, > - 0, > - &CommandPacket > - ); > - if (!EFI_ERROR (Status)) { > - Status =3D NvmeWaitAllComplete (Nvme, CommandPacket.QueueId); > - } > - > - return Status; > -} > - > -/** > - Read some blocks from the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[out] Buffer - The Buffer used to store the Data = read from > the device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be read. > - > - @retval EFI_SUCCESS - Datum are read from the device. > - @retval Others - Fail to read all the datum. > - > -**/ > -EFI_STATUS > -NvmeRead ( > - IN NVME_CONTEXT *Nvme, > - OUT UINT64 Buffer, > - IN UINT64 Lba, > - IN UINTN Blocks > - ) > -{ > - EFI_STATUS Status; > - UINT32 BlockSize; > - UINT32 MaxTransferBlocks; > - > - ASSERT (Blocks <=3D NVME_MAX_SECTORS); > - Status =3D EFI_SUCCESS; > - BlockSize =3D Nvme->BlockSize; > - if (Nvme->ControllerData->Mdts !=3D 0) { > - MaxTransferBlocks =3D (1 << (Nvme->ControllerData->Mdts)) * (1 << > (Nvme->Cap.Mpsmin + 12)) / BlockSize; > - } else { > - MaxTransferBlocks =3D 1024; > - } > - > - while (Blocks > 0) { > - if (Blocks > MaxTransferBlocks) { > - Status =3D NvmeReadSectors (Nvme, Buffer, Lba, MaxTransferBlocks); > - > - Blocks -=3D MaxTransferBlocks; > - Buffer +=3D (MaxTransferBlocks * BlockSize); > - Lba +=3D MaxTransferBlocks; > - } else { > - Status =3D NvmeReadSectors (Nvme, Buffer, Lba, (UINT32) Blocks); > - Blocks =3D 0; > - } > - > - if (EFI_ERROR(Status)) { > - DEBUG ((DEBUG_ERROR, "NvmeRead fail, Status =3D %r\n", Status)); > - break; > - } > - } > - > - return Status; > -} > - > -/** > - Write some blocks to the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Buffer - The Buffer to be written into the = device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be written. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeWrite ( > - IN NVME_CONTEXT *Nvme, > - IN UINT64 Buffer, > - IN UINT64 Lba, > - IN UINTN Blocks > - ) > -{ > - EFI_STATUS Status; > - UINT32 BlockSize; > - UINT32 MaxTransferBlocks; > - > - ASSERT (Blocks <=3D NVME_MAX_SECTORS); > - Status =3D EFI_SUCCESS; > - BlockSize =3D Nvme->BlockSize; > - > - if (Nvme->ControllerData->Mdts !=3D 0) { > - MaxTransferBlocks =3D (1 << (Nvme->ControllerData->Mdts)) * (1 << > (Nvme->Cap.Mpsmin + 12)) / BlockSize; > - } else { > - MaxTransferBlocks =3D 1024; > - } > - > - while (Blocks > 0) { > - if (Blocks > MaxTransferBlocks) { > - Status =3D NvmeWriteSectors (Nvme, Buffer, Lba, MaxTransferBlocks)= ; > - > - Blocks -=3D MaxTransferBlocks; > - Buffer +=3D (MaxTransferBlocks * BlockSize); > - Lba +=3D MaxTransferBlocks; > - } else { > - Status =3D NvmeWriteSectors (Nvme, Buffer, Lba, (UINT32) Blocks); > - Blocks =3D 0; > - } > - > - if (EFI_ERROR(Status)) { > - DEBUG ((DEBUG_ERROR, "NvmeWrite fail, Status =3D %r\n", Status)); > - break; > - } > - } > - > - return Status; > -} > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h > index 3fef3dbc1c..bd2bd5239d 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalNvmeMode.h > @@ -300,134 +300,6 @@ NvmeControllerExit ( > IN NVME_CONTEXT *Nvme > ); >=20 > -/** > - Check whether there are available command slots. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Qid - Queue index > - > - @retval EFI_SUCCESS - Available command slot is found > - @retval EFI_NOT_READY - No available command slot is found > - @retval EFI_DEVICE_ERROR - Error occurred on device side. > - > -**/ > -EFI_STATUS > -NvmeHasFreeCmdSlot ( > - IN NVME_CONTEXT *Nvme, > - IN UINT8 Qid > - ); > - > -/** > - Check whether all command slots are clean. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Qid - Queue index > - > - @retval EFI_SUCCESS - All command slots are clean > - @retval EFI_NOT_READY - Not all command slots are clean > - @retval EFI_DEVICE_ERROR - Error occurred on device side. > - > -**/ > -EFI_STATUS > -NvmeIsAllCmdSlotClean ( > - IN NVME_CONTEXT *Nvme, > - IN UINT8 Qid > - ); > - > -/** > - Read sector Data from the NVMe device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in,out] Buffer - The Buffer used to store the Data = read from > the device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be read. > - > - @retval EFI_SUCCESS - Datum are read from the device. > - @retval Others - Fail to read all the datum. > - > -**/ > -EFI_STATUS > -NvmeReadSectors ( > - IN NVME_CONTEXT *Nvme, > - IN OUT UINT64 Buffer, > - IN UINT64 Lba, > - IN UINT32 Blocks > - ); > - > -/** > - Write sector Data to the NVMe device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Buffer - The Buffer to be written into the = device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be written. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeWriteSectors ( > - IN NVME_CONTEXT *Nvme, > - IN UINT64 Buffer, > - IN UINT64 Lba, > - IN UINT32 Blocks > - ); > - > -/** > - Flushes all modified Data to the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeFlush ( > - IN NVME_CONTEXT *Nvme > - ); > - > -/** > - Read some blocks from the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[out] Buffer - The Buffer used to store the Data = read from > the device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be read. > - > - @retval EFI_SUCCESS - Datum are read from the device. > - @retval Others - Fail to read all the datum. > - > -**/ > -EFI_STATUS > -NvmeRead ( > - IN NVME_CONTEXT *Nvme, > - OUT UINT64 Buffer, > - IN UINT64 Lba, > - IN UINTN Blocks > - ); > - > -/** > - Write some blocks to the device. > - > - @param[in] Nvme - The pointer to the NVME_CONTEXT Da= ta > structure. > - @param[in] Buffer - The Buffer to be written into the = device. > - @param[in] Lba - The start block number. > - @param[in] Blocks - Total block number to be written. > - > - @retval EFI_SUCCESS - Datum are written into the Buffer. > - @retval Others - Fail to write all the datum. > - > -**/ > -EFI_STATUS > -NvmeWrite ( > - IN NVME_CONTEXT *Nvme, > - IN UINT64 Buffer, > - IN UINT64 Lba, > - IN UINTN Blocks > - ); > - > /** > Security send and receive commands. >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > index 0a82f30959..cfa55dded7 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > @@ -71,8 +71,6 @@ > gEfiComponentNameProtocolGuid ## PRODUCES > gEfiComponentName2ProtocolGuid ## PRODUCES > gEfiBlockIoProtocolGuid ## CONSUMES > - gEfiPciIoProtocolGuid ## CONSUMES > - gEfiDevicePathToTextProtocolGuid ## CONSUMES >=20 > [Guids] > gEfiEndOfDxeEventGroupGuid ## CONSUMES = ## Event > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf > index 81c57c36d2..482b7c25af 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf > @@ -50,7 +50,6 @@ > BaseMemoryLib > MemoryAllocationLib > TimerLib > - HobLib > LockBoxLib > TcgStorageOpalLib > Tcg2PhysicalPresenceLib > diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > index 581669a277..4477c6fcad 100644 > --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf > @@ -43,7 +43,6 @@ > [LibraryClasses] > BaseLib > BaseMemoryLib > - MemoryAllocationLib > PeiServicesLib > PeimEntryPoint > DebugLib > diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf > b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf > index 12b7448ade..87f0492750 100644 > --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf > +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf > @@ -92,7 +92,6 @@ > [Protocols] > gEfiTcg2ProtocolGuid ## PRODUCES > gEfiTcg2FinalEventsTableGuid ## PRODUCES > - gEfiAcpiTableProtocolGuid ## NOTIFY > gEfiMpServiceProtocolGuid ## SOMETIMES_CONSUM= ES > gEfiVariableWriteArchProtocolGuid ## NOTIFY > gEfiResetNotificationProtocolGuid ## CONSUMES > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > index 0a08885786..97cec443e4 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > @@ -59,7 +59,6 @@ > TpmMeasurementLib > Tpm2CommandLib > Tcg2PhysicalPresenceLib > - IoLib > PcdLib >=20 > [Guids] > diff --git a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf > b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf > index 179426978c..2a9f61a8c2 100644 > --- a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf > +++ b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf > @@ -59,7 +59,6 @@ > ## SOMETIMES_CONSUMES ## Variable:L"PhysicalPresence" > gEfiPhysicalPresenceGuid >=20 > - gEfiIfrTianoGuid ## SOMETIMES_PRODU= CES ## GUID > # HII opcode > ## PRODUCES ## HII > ## CONSUMES ## HII > gTcgConfigFormSetGuid > diff --git > a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCon > figDxe.inf > b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCon > figDxe.inf > index caf95ddac7..8a1e2bc76b 100644 > --- > a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCon > figDxe.inf > +++ > b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCon > figDxe.inf > @@ -105,7 +105,6 @@ > gEfiCertPkcs7Guid ## SOMETIMES_PRODUCES #= # GUID # > Unique ID for the type of the certificate. > gEfiCertTypeRsa2048Sha256Guid ## SOMETIMES_CONSUMES #= # > GUID # Unique ID for the type of the certificate. > gEfiFileSystemVolumeLabelInfoIdGuid ## SOMETIMES_CONSUMES > ## GUID # Indicate the information type > - gEfiFileInfoGuid ## SOMETIMES_CONSUMES #= # GUID # > Indicate the information type >=20 > gEfiCertX509Sha256Guid ## SOMETIMES_PRODUCES #= # GUID > # Unique ID for the type of the certificate. > gEfiCertX509Sha384Guid ## SOMETIMES_PRODUCES #= # GUID > # Unique ID for the type of the certificate. > @@ -114,7 +113,6 @@ > [Protocols] > gEfiHiiConfigAccessProtocolGuid ## PRODUCES > gEfiDevicePathProtocolGuid ## PRODUCES > - gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES >=20 > [Depex] > gEfiHiiConfigRoutingProtocolGuid AND > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel