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.100; helo=mga07.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1FD072119590F for ; Wed, 28 Nov 2018 06:18:39 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2018 06:18:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,290,1539673200"; d="scan'208";a="93488338" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 28 Nov 2018 06:18:34 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 06:18:34 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 28 Nov 2018 06:18:33 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.201]) with mapi id 14.03.0415.000; Wed, 28 Nov 2018 22:18:32 +0800 From: "Zhang, Chao B" To: "Chen, Chen A" , "edk2-devel@lists.01.org" CC: "Dong, Eric" Thread-Topic: [edk2] [PATCH] SecurityPkg: Remove dead code and inf redundant definitions. Thread-Index: AQHUhuNfPNKSMxdJm02a4tl8XOI14KVlPHmQ Date: Wed, 28 Nov 2018 14:18:30 +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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQxZTljMTAtNzBlYi00YWI0LWI5MDQtNGU3NGNkNjQ2YTA4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNkd0SjYraHJWWkpsTm9QbWllZ0Yydyt4Zlk3MVJ4ejA1dzFCeEtJU1laNWtHUnp6amN5M0Vzd0pMTm9nK0dIRSJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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: Wed, 28 Nov 2018 14:18:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Chen Chen: TCG part is good to me. For Opal part, please include Eric Dong as revie= wer. -----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 def= initions. Fix BZ1065, https://bugzilla.tianocore.org/show_bug.cgi?id=3D1065 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(-) diff --git a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf b/SecurityPk= g/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 at= tached ATA device. - @param[in, out] Buffer The Data Buffer to store IDENTIFY PACKET= 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 Dat= a. - - @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/Securit= yPkg/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, EITHE= R 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 disabled = or health has already been inspected\n", Index)); - } else if (OpalDeviceLocked (&OpalDisk->SupportedAttributes, &OpalDi= sk->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 Data= 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 Data= 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 Data= structure. - @param[in,out] Buffer - The Buffer used to store the Data re= ad 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 Data= structure. - @param[in] Buffer - The Buffer to be written into the de= vice. - @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 Data= 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 Data= structure. - @param[out] Buffer - The Buffer used to store the Data re= ad 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 << (Nvm= e->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 Data= structure. - @param[in] Buffer - The Buffer to be written into the de= vice. - @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 << (Nvm= e->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 Data= 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 Data= 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 Data= structure. - @param[in,out] Buffer - The Buffer used to store the Data re= ad 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 Data= structure. - @param[in] Buffer - The Buffer to be written into the de= vice. - @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 Data= 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 Data= structure. - @param[out] Buffer - The Buffer used to store the Data re= ad 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 Data= structure. - @param[in] Buffer - The Buffer to be written into the de= vice. - @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/Securi= tyPkg/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/Securi= tyPkg/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_CONSUMES 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/Tc= g/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_PRODUCE= S ## GUID # HII opcode ## PRODUCES ## HII ## CONSUMES ## HII gTcgConfigFormSetGuid diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBo= otConfigDxe.inf b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/Sec= ureBootConfigDxe.inf index caf95ddac7..8a1e2bc76b 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi= gDxe.inf +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi= gDxe.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 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel