From nobody Thu Apr 18 05:34:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533542277909636.1779066941642; Mon, 6 Aug 2018 00:57:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 84ED2210DA175; Mon, 6 Aug 2018 00:57:56 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 4761821CAD998 for ; Mon, 6 Aug 2018 00:57:55 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2018 00:57:54 -0700 Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga002.fm.intel.com with ESMTP; 06 Aug 2018 00:50:09 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=shenglei.zhang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,451,1526367600"; d="scan'208";a="73936495" From: shenglei To: edk2-devel@lists.01.org Date: Mon, 6 Aug 2018 15:49:58 +0800 Message-Id: <20180806074958.22808-1-shenglei.zhang@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg: Remove dead code in .c and .h files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Some dead code has been removed in .c and .h files. https://bugzilla.tianocore.org/show_bug.cgi?id=3D1062 Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei --- .../Application/CapsuleApp/CapsuleDump.c | 31 --- MdeModulePkg/Application/UiApp/FrontPage.c | 40 --- MdeModulePkg/Application/UiApp/Ui.h | 30 -- .../Bus/Ata/AtaAtapiPassThru/AhciMode.c | 104 ------- .../Bus/Ata/AtaAtapiPassThru/IdeMode.c | 257 ------------------ .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 26 -- .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h | 12 - MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c | 27 -- MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h | 11 - MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c | 44 --- .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 110 -------- .../Bus/Pci/PciBusDxe/PciDeviceSupport.c | 80 ------ .../Bus/Pci/PciBusDxe/PciDeviceSupport.h | 17 -- MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 41 --- MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h | 21 -- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 94 ------- MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c | 22 -- MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 125 --------- MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h | 78 ------ MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 66 ----- MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h | 28 -- MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 24 -- MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 22 -- MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h | 14 - .../Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c | 24 -- MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c | 24 -- .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c | 101 ------- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c | 24 -- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 180 ------------ .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 49 ---- MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c | 190 ------------- MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h | 98 ------- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c | 68 ----- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c | 146 ---------- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h | 114 -------- MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c | 39 --- MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h | 18 -- MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c | 77 ------ MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h | 35 --- MdeModulePkg/Core/Dxe/DxeMain.h | 13 - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 23 -- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 78 ------ MdeModulePkg/Core/PiSmmCore/HeapGuard.c | 166 ----------- .../Core/PiSmmCore/MemoryAttributesTable.c | 131 --------- MdeModulePkg/Core/PiSmmCore/Page.c | 121 --------- .../Universal/Console/TerminalDxe/Terminal.h | 12 - .../Console/TerminalDxe/TerminalConIn.c | 25 -- .../Universal/HiiDatabaseDxe/ConfigRouting.c | 47 ---- .../Universal/Network/IScsiDxe/IScsiProto.c | 31 --- .../Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 16 -- .../Universal/Network/Tcp4Dxe/SockImpl.c | 35 --- .../Universal/Network/Tcp4Dxe/SockInterface.c | 41 --- .../Universal/Network/Tcp4Dxe/Socket.h | 32 --- .../Universal/Network/Tcp4Dxe/Tcp4Option.c | 28 -- .../Universal/Network/Tcp4Dxe/Tcp4Option.h | 15 - .../Universal/SetupBrowserDxe/IfrParse.c | 33 --- 56 files changed, 3358 deletions(-) diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModuleP= kg/Application/CapsuleApp/CapsuleDump.c index 45c3ecd050..7a3eb94362 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c @@ -106,37 +106,6 @@ DumpUxCapsule ( Print(L" OffsetY - 0x%x\n", DisplayCapsule->ImagePayload.Offse= tY); } =20 -/** - Dump FMP image authentication information. - - @param[in] Image The FMP capsule image - @param[in] ImageSize The size of the FMP capsule image in bytes. - - @return the size of FMP authentication. -**/ -UINTN -DumpImageAuthentication ( - IN VOID *Image, - IN UINTN ImageSize - ) -{ - EFI_FIRMWARE_IMAGE_AUTHENTICATION *ImageAuthentication; - - ImageAuthentication =3D Image; - if (CompareGuid(&ImageAuthentication->AuthInfo.CertType, &gEfiCertPkcs7G= uid) || - CompareGuid(&ImageAuthentication->AuthInfo.CertType, &gEfiCertTypeRs= a2048Sha256Guid)) { - Print(L"[ImageAuthentication]\n"); - Print(L" MonotonicCount - 0x%lx\n", ImageAuthentication->MonotonicC= ount); - Print(L"WIN_CERTIFICATE:\n"); - Print(L" dwLength - 0x%x\n", ImageAuthentication->AuthInfo.Hd= r.dwLength); - Print(L" wRevision - 0x%x\n", ImageAuthentication->AuthInfo.Hd= r.wRevision); - Print(L" wCertificateType - 0x%x\n", ImageAuthentication->AuthInfo.Hd= r.wCertificateType); - Print(L" CertType - %g\n", &ImageAuthentication->AuthInfo.Cer= tType); - return sizeof(ImageAuthentication->MonotonicCount) + ImageAuthenticati= on->AuthInfo.Hdr.dwLength; - } else { - return 0; - } -} =20 /** Dump a non-nested FMP capsule. diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Appl= ication/UiApp/FrontPage.c index 2403aad9d9..f0513deb51 100644 --- a/MdeModulePkg/Application/UiApp/FrontPage.c +++ b/MdeModulePkg/Application/UiApp/FrontPage.c @@ -1042,34 +1042,7 @@ UiEntry ( // =20 =20 -/** - Enable the setup browser reset reminder feature. - This routine is used in platform tip. If the platform policy need the fe= ature, use the routine to enable it. =20 -**/ -VOID -EFIAPI -EnableResetReminderFeature ( - VOID - ) -{ - mFeaturerSwitch =3D TRUE; -} - - -/** - Disable the setup browser reset reminder feature. - This routine is used in platform tip. If the platform policy do not want= the feature, use the routine to disable it. - -**/ -VOID -EFIAPI -DisableResetReminderFeature ( - VOID - ) -{ - mFeaturerSwitch =3D FALSE; -} =20 =20 /** @@ -1087,19 +1060,6 @@ EnableResetRequired ( } =20 =20 -/** - Record the info that no reset is required. - A module boolean variable is used to record whether a reset is required. - -**/ -VOID -EFIAPI -DisableResetRequired ( - VOID - ) -{ - mResetRequired =3D FALSE; -} =20 =20 /** diff --git a/MdeModulePkg/Application/UiApp/Ui.h b/MdeModulePkg/Application= /UiApp/Ui.h index a9c30b0c56..7be164570c 100644 --- a/MdeModulePkg/Application/UiApp/Ui.h +++ b/MdeModulePkg/Application/UiApp/Ui.h @@ -53,27 +53,7 @@ typedef struct { // //The interface functions related to the Setup Browser Reset Reminder feat= ure // -/** - Enable the setup browser reset reminder feature. - This routine is used in a platform tip. If the platform policy needs the= feature, use the routine to enable it. =20 -**/ -VOID -EFIAPI -EnableResetReminderFeature ( - VOID - ); - -/** - Disable the setup browser reset reminder feature. - This routine is used in a platform tip. If the platform policy does not = want the feature, use the routine to disable it. - -**/ -VOID -EFIAPI -DisableResetReminderFeature ( - VOID - ); =20 /** Record the info that a reset is required. @@ -87,16 +67,6 @@ EnableResetRequired ( ); =20 =20 -/** - Record the info that no reset is required. - A module boolean variable is used to record whether a reset is required. - -**/ -VOID -EFIAPI -DisableResetRequired ( - VOID - ); =20 /** Check whether platform policy enables the reset reminder feature. The de= fault is enabled. diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePk= g/Bus/Ata/AtaAtapiPassThru/AhciMode.c index 79ae11bd20..d7a8b29666 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c @@ -294,41 +294,6 @@ AhciCheckMemSet ( } } =20 -/** - Check if the device is still on port. It also checks if the AHCI control= ler - supports the address and data count will be transferred. - - @param PciIo The PCI IO protocol instance. - @param Port The number of port. - - @retval EFI_SUCCESS The device is attached to port and the transfer= data is - supported by AHCI controller. - @retval EFI_UNSUPPORTED The transfer address and count is not supported= by AHCI - controller. - @retval EFI_NOT_READY The physical communication between AHCI control= ler and device - is not ready. - -**/ -EFI_STATUS -EFIAPI -AhciCheckDeviceStatus ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT8 Port - ) -{ - UINT32 Data; - UINT32 Offset; - - Offset =3D EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AH= CI_PORT_SSTS; - - Data =3D AhciReadReg (PciIo, Offset) & EFI_AHCI_PORT_SSTS_DET_MASK; - - if (Data =3D=3D EFI_AHCI_PORT_SSTS_DET_PCE) { - return EFI_SUCCESS; - } - - return EFI_NOT_READY; -} =20 /** =20 @@ -1361,75 +1326,6 @@ AhciStartCommand ( return EFI_SUCCESS; } =20 -/** - Do AHCI port reset. - - @param PciIo The PCI IO protocol instance. - @param Port The number of port. - @param Timeout The timeout value of reset, uses 100ns as a u= nit. - - @retval EFI_DEVICE_ERROR The port reset unsuccessfully - @retval EFI_TIMEOUT The reset operation is time out. - @retval EFI_SUCCESS The port reset successfully. - -**/ -EFI_STATUS -EFIAPI -AhciPortReset ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT8 Port, - IN UINT64 Timeout - ) -{ - EFI_STATUS Status; - UINT32 Offset; - - AhciClearPortStatus (PciIo, Port); - - AhciStopCommand (PciIo, Port, Timeout); - - AhciDisableFisReceive (PciIo, Port, Timeout); - - AhciEnableFisReceive (PciIo, Port, Timeout); - - Offset =3D EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AH= CI_PORT_SCTL; - - AhciOrReg (PciIo, Offset, EFI_AHCI_PORT_SCTL_DET_INIT); - - // - // wait 5 millisecond before de-assert DET - // - MicroSecondDelay (5000); - - AhciAndReg (PciIo, Offset, (UINT32)EFI_AHCI_PORT_SCTL_MASK); - - // - // wait 5 millisecond before de-assert DET - // - MicroSecondDelay (5000); - - // - // Wait for communication to be re-established - // - Offset =3D EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AH= CI_PORT_SSTS; - Status =3D AhciWaitMmioSet ( - PciIo, - Offset, - EFI_AHCI_PORT_SSTS_DET_MASK, - EFI_AHCI_PORT_SSTS_DET_PCE, - Timeout - ); - - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Port %d COMRESET failed: %r\n", Port, Status)); - return Status; - } - - Offset =3D EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AH= CI_PORT_SERR; - AhciOrReg (PciIo, Offset, EFI_AHCI_PORT_ERR_CLEAR); - - return EFI_SUCCESS; -} =20 /** Do AHCI HBA reset. diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg= /Bus/Ata/AtaAtapiPassThru/IdeMode.c index 6478f7be07..79142c330d 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -627,146 +627,8 @@ DRQReady2 ( return EFI_TIMEOUT; } =20 -/** - This function is used to poll for the DRDY bit set in the Status Registe= r. DRDY - bit is set when the device is ready to accept command. Most ATA commands= must be - sent after DRDY set except the ATAPI Packet Command. - - @param PciIo A pointer to EFI_PCI_IO_PROTOCOL data structure. - @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. - @param Timeout The time to complete the command, uses 100ns as = a unit. - - @retval EFI_SUCCESS DRDY bit set within the time out. - @retval EFI_TIMEOUT DRDY bit not set within the time out. - - @note Read Status Register will clear interrupt status. -**/ -EFI_STATUS -EFIAPI -DRDYReady ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN EFI_IDE_REGISTERS *IdeRegisters, - IN UINT64 Timeout - ) -{ - UINT64 Delay; - UINT8 StatusRegister; - UINT8 ErrorRegister; - BOOLEAN InfiniteWait; - - ASSERT (PciIo !=3D NULL); - ASSERT (IdeRegisters !=3D NULL); - - if (Timeout =3D=3D 0) { - InfiniteWait =3D TRUE; - } else { - InfiniteWait =3D FALSE; - } - - Delay =3D DivU64x32(Timeout, 1000) + 1; - do { - StatusRegister =3D IdeReadPortB (PciIo, IdeRegisters->CmdOrStatus); - // - // Wait for BSY =3D=3D 0, then judge if DRDY is set or ERR is set - // - if ((StatusRegister & ATA_STSREG_BSY) =3D=3D 0) { - if ((StatusRegister & ATA_STSREG_ERR) =3D=3D ATA_STSREG_ERR) { - ErrorRegister =3D IdeReadPortB (PciIo, IdeRegisters->ErrOrFeature); - - if ((ErrorRegister & ATA_ERRREG_ABRT) =3D=3D ATA_ERRREG_ABRT) { - return EFI_ABORTED; - } - return EFI_DEVICE_ERROR; - } - - if ((StatusRegister & ATA_STSREG_DRDY) =3D=3D ATA_STSREG_DRDY) { - return EFI_SUCCESS; - } else { - return EFI_DEVICE_ERROR; - } - } - - // - // Stall for 100 microseconds. - // - MicroSecondDelay (100); - - Delay--; - } while (InfiniteWait || (Delay > 0)); - - return EFI_TIMEOUT; -} - -/** - This function is used to poll for the DRDY bit set in the Alternate Stat= us Register. - DRDY bit is set when the device is ready to accept command. Most ATA com= mands must - be sent after DRDY set except the ATAPI Packet Command. - - @param PciIo A pointer to EFI_PCI_IO_PROTOCOL data structure. - @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. - @param Timeout The time to complete the command, uses 100ns as = a unit. - - @retval EFI_SUCCESS DRDY bit set within the time out. - @retval EFI_TIMEOUT DRDY bit not set within the time out. - - @note Read Alternate Status Register will clear interrupt status. - -**/ -EFI_STATUS -EFIAPI -DRDYReady2 ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN EFI_IDE_REGISTERS *IdeRegisters, - IN UINT64 Timeout - ) -{ - UINT64 Delay; - UINT8 AltRegister; - UINT8 ErrorRegister; - BOOLEAN InfiniteWait; - - ASSERT (PciIo !=3D NULL); - ASSERT (IdeRegisters !=3D NULL); - - if (Timeout =3D=3D 0) { - InfiniteWait =3D TRUE; - } else { - InfiniteWait =3D FALSE; - } - - Delay =3D DivU64x32(Timeout, 1000) + 1; - do { - AltRegister =3D IdeReadPortB (PciIo, IdeRegisters->AltOrDev); - // - // Wait for BSY =3D=3D 0, then judge if DRDY is set or ERR is set - // - if ((AltRegister & ATA_STSREG_BSY) =3D=3D 0) { - if ((AltRegister & ATA_STSREG_ERR) =3D=3D ATA_STSREG_ERR) { - ErrorRegister =3D IdeReadPortB (PciIo, IdeRegisters->ErrOrFeature); - - if ((ErrorRegister & ATA_ERRREG_ABRT) =3D=3D ATA_ERRREG_ABRT) { - return EFI_ABORTED; - } - return EFI_DEVICE_ERROR; - } - - if ((AltRegister & ATA_STSREG_DRDY) =3D=3D ATA_STSREG_DRDY) { - return EFI_SUCCESS; - } else { - return EFI_DEVICE_ERROR; - } - } - - // - // Stall for 100 microseconds. - // - MicroSecondDelay (100); =20 - Delay--; - } while (InfiniteWait || (Delay > 0)); =20 - return EFI_TIMEOUT; -} =20 /** This function is used to poll for the BSY bit clear in the Status Regist= er. BSY @@ -822,59 +684,6 @@ WaitForBSYClear ( return EFI_TIMEOUT; } =20 -/** - This function is used to poll for the BSY bit clear in the Status Regist= er. BSY - is clear when the device is not busy. Every command must be sent after d= evice is not busy. - - @param PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data s= tructure. - @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. - @param Timeout The time to complete the command, uses 100ns as = a unit. - - @retval EFI_SUCCESS BSY bit clear within the time out. - @retval EFI_TIMEOUT BSY bit not clear within the time out. - - @note Read Status Register will clear interrupt status. -**/ -EFI_STATUS -EFIAPI -WaitForBSYClear2 ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN EFI_IDE_REGISTERS *IdeRegisters, - IN UINT64 Timeout - ) -{ - UINT64 Delay; - UINT8 AltStatusRegister; - BOOLEAN InfiniteWait; - - ASSERT (PciIo !=3D NULL); - ASSERT (IdeRegisters !=3D NULL); - - if (Timeout =3D=3D 0) { - InfiniteWait =3D TRUE; - } else { - InfiniteWait =3D FALSE; - } - - Delay =3D DivU64x32(Timeout, 1000) + 1; - do { - AltStatusRegister =3D IdeReadPortB (PciIo, IdeRegisters->AltOrDev); - - if ((AltStatusRegister & ATA_STSREG_BSY) =3D=3D 0x00) { - return EFI_SUCCESS; - } - - // - // Stall for 100 microseconds. - // - MicroSecondDelay (100); - - Delay--; - - } while (InfiniteWait || (Delay > 0)); - - return EFI_TIMEOUT; -} =20 /** Get IDE i/o port registers' base addresses by mode. @@ -1017,72 +826,6 @@ GetIdeRegisterIoAddr ( return EFI_SUCCESS; } =20 -/** - This function is used to implement the Soft Reset on the specified devic= e. But, - the ATA Soft Reset mechanism is so strong a reset method that it will fo= rce - resetting on both devices connected to the same cable. - - It is called by IdeBlkIoReset(), a interface function of Block - I/O protocol. - - This function can also be used by the ATAPI device to perform reset when - ATAPI Reset command is failed. - - @param PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data s= tructure. - @param IdeRegisters A pointer to EFI_IDE_REGISTERS data structure. - @param Timeout The time to complete the command, uses 100ns as = a unit. - - @retval EFI_SUCCESS Soft reset completes successfully. - @retval EFI_DEVICE_ERROR Any step during the reset process is failed. - - @note The registers initial values after ATA soft reset are different - to the ATA device and ATAPI device. -**/ -EFI_STATUS -EFIAPI -AtaSoftReset ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN EFI_IDE_REGISTERS *IdeRegisters, - IN UINT64 Timeout - ) -{ - UINT8 DeviceControl; - - DeviceControl =3D 0; - // - // disable Interrupt and set SRST bit to initiate soft reset - // - DeviceControl =3D ATA_CTLREG_SRST | ATA_CTLREG_IEN_L; - - IdeWritePortB (PciIo, IdeRegisters->AltOrDev, DeviceControl); - - // - // SRST should assert for at least 5 us, we use 10 us for - // better compatibility - // - MicroSecondDelay (10); - - // - // Enable interrupt to support UDMA, and clear SRST bit - // - DeviceControl =3D 0; - IdeWritePortB (PciIo, IdeRegisters->AltOrDev, DeviceControl); - - // - // Wait for at least 10 ms to check BSY status, we use 10 ms - // for better compatibility - // - MicroSecondDelay (10000); - - // - // slave device needs at most 31ms to clear BSY - // - if (WaitForBSYClear (PciIo, IdeRegisters, Timeout) =3D=3D EFI_TIMEOUT) { - return EFI_DEVICE_ERROR; - } - - return EFI_SUCCESS; -} =20 /** Send ATA Ext command into device with NON_DATA protocol. diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/MdeModul= ePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c index 4def6d9271..2ee293d64d 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c @@ -1812,32 +1812,6 @@ Done: =20 } =20 -/** - Disable the keyboard interface of the 8042 controller. - - @param ConsoleIn The device instance - - @return status of issuing disable command - -**/ -EFI_STATUS -DisableKeyboard ( - IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn - ) -{ - EFI_STATUS Status; - - // - // Disable keyboard interface - // - Status =3D KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEY= BOARD_INTERFACE); - if (EFI_ERROR (Status)) { - KeyboardError (ConsoleIn, L"\n\r"); - return EFI_DEVICE_ERROR; - } - - return Status; -} =20 /** Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard C= ommand diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h b/MdeModuleP= kg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h index b6a4f3c6b9..e0950ce113 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h @@ -300,18 +300,6 @@ InitKeyboard ( IN BOOLEAN ExtendedVerification ); =20 -/** - Disable the keyboard interface of the 8042 controller. - - @param ConsoleIn - the device instance - - @return status of issuing disable command - -**/ -EFI_STATUS -DisableKeyboard ( - IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn - ); =20 /** Timer event handler: read a series of scancodes from 8042 diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c b/MdeModulePkg/Bus/Pc= i/EhciDxe/EhciDebug.c index 76368b4748..71755d421b 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.c @@ -228,31 +228,4 @@ EhcDumpBuf ( DEBUG ((EFI_D_VERBOSE, "\n")); } =20 -/** - Dump the EHCI status registers. - - @param Ehc USB EHCI Host Controller instance =20 -**/ -VOID -EhcDumpRegs ( - IN USB2_HC_DEV *Ehc - ) -{ - UINT8 Index; - - DEBUG ((EFI_D_VERBOSE, " EHC_CAPLENGTH_OFFSET =3D 0x%08x\n", EhcReadC= apRegister (Ehc, EHC_CAPLENGTH_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_HCSPARAMS_OFFSET =3D 0x%08x\n", EhcReadC= apRegister (Ehc, EHC_HCSPARAMS_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_HCCPARAMS_OFFSET =3D 0x%08x\n", EhcReadC= apRegister (Ehc, EHC_HCCPARAMS_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_USBCMD_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_USBCMD_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_USBSTS_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_USBSTS_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_USBINTR_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_USBINTR_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_FRINDEX_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_FRINDEX_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_CTRLDSSEG_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_CTRLDSSEG_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_FRAME_BASE_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_FRAME_BASE_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_ASYNC_HEAD_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_ASYNC_HEAD_OFFSET))); - DEBUG ((EFI_D_VERBOSE, " EHC_CONFIG_FLAG_OFFSET =3D 0x%08x\n", EhcReadO= pReg (Ehc, EHC_CONFIG_FLAG_OFFSET))); - for (Index =3D 0; Index < (UINT8) (Ehc->HcStructParams & HCSP_NPORTS); I= ndex++) { - DEBUG ((EFI_D_VERBOSE, " EHC_PORT_STAT_OFFSET(%d) =3D 0x%08x\n", Ind= ex, EhcReadOpReg (Ehc, EHC_PORT_STAT_OFFSET + (4 * Index)))); - } -} diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h b/MdeModulePkg/Bus/Pc= i/EhciDxe/EhciDebug.h index bc84bb7864..a64b0551a0 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDebug.h @@ -61,15 +61,4 @@ EhcDumpBuf ( ); =20 =20 -/** - Dump the EHCI status registers. - - @param Ehc USB EHCI Host Controller instance - -**/ -VOID -EhcDumpRegs ( - IN USB2_HC_DEV *Ehc - ); - #endif diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c b/MdeModulePkg/Bus/Pci/= EhciDxe/EhciReg.c index 34836eccf5..59752d1bdc 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.c @@ -372,29 +372,7 @@ EhcEnablePeriodSchd ( } =20 =20 -/** - Disable periodic schedule. =20 - @param Ehc The EHCI device. - @param Timeout Time to wait before abort (in millisecond, ms). - - @retval EFI_SUCCESS Periodic schedule is disabled. - @retval EFI_DEVICE_ERROR Fail to disable periodic schedule. - -**/ -EFI_STATUS -EhcDisablePeriodSchd ( - IN USB2_HC_DEV *Ehc, - IN UINT32 Timeout - ) -{ - EFI_STATUS Status; - - EhcClearOpRegBit (Ehc, EHC_USBCMD_OFFSET, USBCMD_ENABLE_PERIOD); - - Status =3D EhcWaitOpRegBit (Ehc, EHC_USBSTS_OFFSET, USBSTS_PERIOD_ENABLE= D, FALSE, Timeout); - return Status; -} =20 =20 =20 @@ -424,29 +402,7 @@ EhcEnableAsyncSchd ( =20 =20 =20 -/** - Disable asynchrounous schedule. =20 - @param Ehc The EHCI device. - @param Timeout Time to wait before abort (in millisecond, ms). - - @retval EFI_SUCCESS The asynchronous schedule is disabled. - @return Others Failed to disable the asynchronous schedule. - -**/ -EFI_STATUS -EhcDisableAsyncSchd ( - IN USB2_HC_DEV *Ehc, - IN UINT32 Timeout - ) -{ - EFI_STATUS Status; - - EhcClearOpRegBit (Ehc, EHC_USBCMD_OFFSET, USBCMD_ENABLE_ASYNC); - - Status =3D EhcWaitOpRegBit (Ehc, EHC_USBSTS_OFFSET, USBSTS_ASYNC_ENABLED= , FALSE, Timeout); - return Status; -} =20 =20 =20 diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModule= Pkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c index 30ade3a589..421561f16d 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c @@ -183,43 +183,7 @@ ReadNvmeControllerStatus ( return EFI_SUCCESS; } =20 -/** - Read Nvm Express admin queue attributes register. - - @param Private The pointer to the NVME_CONTROLLER_PRIVATE_DATA= data structure. - @param Aqa The buffer used to store admin queue attributes= register content. - - @return EFI_SUCCESS Successfully read the admin queue attributes re= gister content. - @return EFI_DEVICE_ERROR Fail to read the admin queue attributes registe= r. - -**/ -EFI_STATUS -ReadNvmeAdminQueueAttributes ( - IN NVME_CONTROLLER_PRIVATE_DATA *Private, - IN NVME_AQA *Aqa - ) -{ - EFI_PCI_IO_PROTOCOL *PciIo; - EFI_STATUS Status; - UINT32 Data; - - PciIo =3D Private->PciIo; - Status =3D PciIo->Mem.Read ( - PciIo, - EfiPciIoWidthUint32, - NVME_BAR, - NVME_AQA_OFFSET, - 1, - &Data - ); - - if (EFI_ERROR(Status)) { - return Status; - } =20 - WriteUnaligned32 ((UINT32*)Aqa, Data); - return EFI_SUCCESS; -} =20 /** Write Nvm Express admin queue attributes register. @@ -262,43 +226,6 @@ WriteNvmeAdminQueueAttributes ( return EFI_SUCCESS; } =20 -/** - Read Nvm Express admin submission queue base address register. - - @param Private The pointer to the NVME_CONTROLLER_PRIVATE_DATA= data structure. - @param Asq The buffer used to store admin submission queue= base address register content. - - @return EFI_SUCCESS Successfully read the admin submission queue ba= se address register content. - @return EFI_DEVICE_ERROR Fail to read the admin submission queue base ad= dress register. - -**/ -EFI_STATUS -ReadNvmeAdminSubmissionQueueBaseAddress ( - IN NVME_CONTROLLER_PRIVATE_DATA *Private, - IN NVME_ASQ *Asq - ) -{ - EFI_PCI_IO_PROTOCOL *PciIo; - EFI_STATUS Status; - UINT64 Data; - - PciIo =3D Private->PciIo; - Status =3D PciIo->Mem.Read ( - PciIo, - EfiPciIoWidthUint32, - NVME_BAR, - NVME_ASQ_OFFSET, - 2, - &Data - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - WriteUnaligned64 ((UINT64*)Asq, Data); - return EFI_SUCCESS; -} =20 /** Write Nvm Express admin submission queue base address register. @@ -341,44 +268,7 @@ WriteNvmeAdminSubmissionQueueBaseAddress ( return EFI_SUCCESS; } =20 -/** - Read Nvm Express admin completion queue base address register. - - @param Private The pointer to the NVME_CONTROLLER_PRIVATE_DATA= data structure. - @param Acq The buffer used to store admin completion queue= base address register content. - - @return EFI_SUCCESS Successfully read the admin completion queue ba= se address register content. - @return EFI_DEVICE_ERROR Fail to read the admin completion queue base ad= dress register. - -**/ -EFI_STATUS -ReadNvmeAdminCompletionQueueBaseAddress ( - IN NVME_CONTROLLER_PRIVATE_DATA *Private, - IN NVME_ACQ *Acq - ) -{ - EFI_PCI_IO_PROTOCOL *PciIo; - EFI_STATUS Status; - UINT64 Data; - - PciIo =3D Private->PciIo; =20 - Status =3D PciIo->Mem.Read ( - PciIo, - EfiPciIoWidthUint32, - NVME_BAR, - NVME_ACQ_OFFSET, - 2, - &Data - ); - - if (EFI_ERROR(Status)) { - return Status; - } - - WriteUnaligned64 ((UINT64*)Acq, Data); - return EFI_SUCCESS; -} =20 /** Write Nvm Express admin completion queue base address register. diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 48cf57a24f..f7039da992 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -1061,85 +1061,5 @@ ActiveVGADeviceOnTheRootBridge ( } =20 =20 -/** - Get HPC PCI address according to its device path. - - @param RootBridge Root bridege Io instance. - @param RemainingDevicePath Given searching device path. - @param PciAddress Buffer holding searched result. - - @retval EFI_SUCCESS PCI address was stored in PciAddress - @retval EFI_NOT_FOUND Can not find the specific device path. - -**/ -EFI_STATUS -GetHpcPciAddressFromRootBridge ( - IN PCI_IO_DEVICE *RootBridge, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, - OUT UINT64 *PciAddress - ) -{ - EFI_DEV_PATH_PTR Node; - PCI_IO_DEVICE *Temp; - EFI_DEVICE_PATH_PROTOCOL *CurrentDevicePath; - LIST_ENTRY *CurrentLink; - BOOLEAN MisMatch; - - MisMatch =3D FALSE; - - CurrentDevicePath =3D RemainingDevicePath; - Node.DevPath =3D CurrentDevicePath; - Temp =3D NULL; - - while (!IsDevicePathEnd (CurrentDevicePath)) { - - CurrentLink =3D RootBridge->ChildList.ForwardLink; - Node.DevPath =3D CurrentDevicePath; - - while (CurrentLink !=3D NULL && CurrentLink !=3D &RootBridge->ChildLis= t) { - Temp =3D PCI_IO_DEVICE_FROM_LINK (CurrentLink); - - if (Node.Pci->Device =3D=3D Temp->DeviceNumber && - Node.Pci->Function =3D=3D Temp->FunctionNumber) { - RootBridge =3D Temp; - break; - } - - CurrentLink =3D CurrentLink->ForwardLink; - } - - // - // Check if we find the bridge - // - if (CurrentLink =3D=3D &RootBridge->ChildList) { - - MisMatch =3D TRUE; - break; - - } - - CurrentDevicePath =3D NextDevicePathNode (CurrentDevicePath); - } - - if (MisMatch) { - - CurrentDevicePath =3D NextDevicePathNode (CurrentDevicePath); - - if (IsDevicePathEnd (CurrentDevicePath)) { - *PciAddress =3D EFI_PCI_ADDRESS (RootBridge->BusNumber, Node.Pci->De= vice, Node.Pci->Function, 0); - return EFI_SUCCESS; - } - - return EFI_NOT_FOUND; - } =20 - if (Temp !=3D NULL) { - *PciAddress =3D EFI_PCI_ADDRESS (Temp->BusNumber, Temp->DeviceNumber, = Temp->FunctionNumber, 0); - } else { - return EFI_NOT_FOUND; - } - - return EFI_SUCCESS; - -} =20 diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.h index 1a01e72b1e..c282381f85 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h @@ -255,23 +255,6 @@ ActiveVGADeviceOnTheRootBridge ( IN PCI_IO_DEVICE *RootBridge ); =20 -/** - Get HPC PCI address according to its device path. - - @param RootBridge Root bridege Io instance. - @param RemainingDevicePath Given searching device path. - @param PciAddress Buffer holding searched result. - - @retval EFI_SUCCESS PCI address was stored in PciAddress. - @retval EFI_NOT_FOUND Can not find the specific device path. - -**/ -EFI_STATUS -GetHpcPciAddressFromRootBridge ( - IN PCI_IO_DEVICE *RootBridge, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, - OUT UINT64 *PciAddress - ); =20 /** Destroy a pci device node. diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/= PciBusDxe/PciIo.c index 87b0b9884a..291578c63c 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -2061,47 +2061,6 @@ PciIoSetBarAttributes ( return EFI_SUCCESS; } =20 -/** - Program parent bridge's attribute recurrently. - - @param PciIoDevice Child Pci device instance - @param Operation The operation to perform on the attributes for this = PCI controller. - @param Attributes The mask of attributes that are used for Set, Enable= , and Disable - operations. - - @retval EFI_SUCCESS The operation on the PCI controller's attr= ibutes was completed. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_UNSUPPORTED one or more of the bits set in - Attributes are not supported by this PCI c= ontroller or one of - its parent bridges when Operation is Set, = Enable or Disable. - -**/ -EFI_STATUS -UpStreamBridgesAttributes ( - IN PCI_IO_DEVICE *PciIoDevice, - IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, - IN UINT64 Attributes - ) -{ - PCI_IO_DEVICE *Parent; - EFI_PCI_IO_PROTOCOL *PciIo; - - Parent =3D PciIoDevice->Parent; - - while (Parent !=3D NULL && IS_PCI_BRIDGE (&Parent->Pci)) { - - // - // Get the PciIo Protocol - // - PciIo =3D &Parent->PciIo; - - PciIo->Attributes (PciIo, Operation, Attributes, NULL); - - Parent =3D Parent->Parent; - } - - return EFI_SUCCESS; -} =20 /** Test whether two Pci devices has same parent bridge. diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h b/MdeModulePkg/Bus/Pci/= PciBusDxe/PciIo.h index b7e38ded3f..69e7c32881 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h @@ -646,27 +646,6 @@ PciIoSetBarAttributes ( IN OUT UINT64 *Length ); =20 -/** - Program parent bridge's attribute recurrently. - - @param PciIoDevice Child Pci device instance - @param Operation The operation to perform on the attributes for this = PCI controller. - @param Attributes The mask of attributes that are used for Set, Enable= , and Disable - operations. - - @retval EFI_SUCCESS The operation on the PCI controller's attr= ibutes was completed. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_UNSUPPORTED one or more of the bits set in - Attributes are not supported by this PCI c= ontroller or one of - its parent bridges when Operation is Set, = Enable or Disable. - -**/ -EFI_STATUS -UpStreamBridgesAttributes ( - IN PCI_IO_DEVICE *PciIoDevice, - IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, - IN UINT64 Attributes - ); =20 /** Test whether two Pci devices has same parent bridge. diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c b/MdeModulePkg/B= us/Pci/SdMmcPciHcDxe/SdDevice.c index 9e70de956f..27909f44d8 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c @@ -318,59 +318,7 @@ SdCardSetRca ( return Status; } =20 -/** - Send command SEND_CSD to the SD device to get the data of the CSD regist= er. - - Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. - - @param[in] PassThru A pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL= instance. - @param[in] Slot The slot number of the SD card to send the com= mand to. - @param[in] Rca The relative device address of selected device. - @param[out] Csd The buffer to store the content of the CSD reg= ister. - Note the caller should ignore the lowest byte = of this - buffer as the content of this byte is meaningl= ess even - if the operation succeeds. - - @retval EFI_SUCCESS The operation is done correctly. - @retval Others The operation fails. =20 -**/ -EFI_STATUS -SdCardGetCsd ( - IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, - IN UINT8 Slot, - IN UINT16 Rca, - OUT SD_CSD *Csd - ) -{ - EFI_SD_MMC_COMMAND_BLOCK SdMmcCmdBlk; - EFI_SD_MMC_STATUS_BLOCK SdMmcStatusBlk; - EFI_SD_MMC_PASS_THRU_COMMAND_PACKET Packet; - EFI_STATUS Status; - - ZeroMem (&SdMmcCmdBlk, sizeof (SdMmcCmdBlk)); - ZeroMem (&SdMmcStatusBlk, sizeof (SdMmcStatusBlk)); - ZeroMem (&Packet, sizeof (Packet)); - - Packet.SdMmcCmdBlk =3D &SdMmcCmdBlk; - Packet.SdMmcStatusBlk =3D &SdMmcStatusBlk; - Packet.Timeout =3D SD_MMC_HC_GENERIC_TIMEOUT; - - SdMmcCmdBlk.CommandIndex =3D SD_SEND_CSD; - SdMmcCmdBlk.CommandType =3D SdMmcCommandTypeAc; - SdMmcCmdBlk.ResponseType =3D SdMmcResponseTypeR2; - SdMmcCmdBlk.CommandArgument =3D (UINT32)Rca << 16; - - Status =3D SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (!EFI_ERROR (Status)) { - // - // For details, refer to SD Host Controller Simplified Spec 3.0 Table = 2-12. - // - CopyMem (((UINT8*)Csd) + 1, &SdMmcStatusBlk.Resp0, sizeof (SD_CSD) - 1= ); - } - - return Status; -} =20 /** Send command SEND_CSD to the SD device to get the data of the CSD regist= er. @@ -386,48 +334,6 @@ SdCardGetCsd ( @retval Others The operation fails. =20 **/ -EFI_STATUS -SdCardGetScr ( - IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, - IN UINT8 Slot, - IN UINT16 Rca, - OUT SD_SCR *Scr - ) -{ - EFI_SD_MMC_COMMAND_BLOCK SdMmcCmdBlk; - EFI_SD_MMC_STATUS_BLOCK SdMmcStatusBlk; - EFI_SD_MMC_PASS_THRU_COMMAND_PACKET Packet; - EFI_STATUS Status; - - ZeroMem (&SdMmcCmdBlk, sizeof (SdMmcCmdBlk)); - ZeroMem (&SdMmcStatusBlk, sizeof (SdMmcStatusBlk)); - ZeroMem (&Packet, sizeof (Packet)); - - Packet.SdMmcCmdBlk =3D &SdMmcCmdBlk; - Packet.SdMmcStatusBlk =3D &SdMmcStatusBlk; - Packet.Timeout =3D SD_MMC_HC_GENERIC_TIMEOUT; - - SdMmcCmdBlk.CommandIndex =3D SD_APP_CMD; - SdMmcCmdBlk.CommandType =3D SdMmcCommandTypeAc; - SdMmcCmdBlk.ResponseType =3D SdMmcResponseTypeR1; - SdMmcCmdBlk.CommandArgument =3D (UINT32)Rca << 16; - - Status =3D SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - if (EFI_ERROR (Status)) { - return Status; - } - - SdMmcCmdBlk.CommandIndex =3D SD_SEND_SCR; - SdMmcCmdBlk.CommandType =3D SdMmcCommandTypeAdtc; - SdMmcCmdBlk.ResponseType =3D SdMmcResponseTypeR1; - - Packet.InDataBuffer =3D Scr; - Packet.InTransferLength =3D sizeof (SD_SCR); - - Status =3D SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL); - - return Status; -} =20 /** Send command SELECT_DESELECT_CARD to the SD device to select/deselect it. diff --git a/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c b/MdeModulePkg/Bus/Pci/U= hciPei/DmaMem.c index c92bee4298..f4202ba6e6 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/DmaMem.c @@ -205,29 +205,7 @@ IoMmuAllocateBuffer ( return Status; } =20 -/** - Frees memory that was allocated with AllocateBuffer(). - - @param IoMmu Pointer to IOMMU PPI. - @param Pages The number of pages to free. - @param HostAddress The base system memory address of the allocate= d range. - @param Mapping The mapping value returned from Map(). =20 -**/ -VOID -IoMmuFreeBuffer ( - IN EDKII_IOMMU_PPI *IoMmu, - IN UINTN Pages, - IN VOID *HostAddress, - IN VOID *Mapping - ) -{ - if (IoMmu !=3D NULL) { - IoMmu->SetAttribute (IoMmu, Mapping, 0); - IoMmu->Unmap (IoMmu, Mapping); - IoMmu->FreeBuffer (IoMmu, Pages, HostAddress); - } -} =20 /** Initialize IOMMU. diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/= UhciPei/UhcPeim.c index ec2daf1649..645c946f29 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c @@ -1252,26 +1252,7 @@ IsStatusOK ( } } =20 -/** - Get Current Frame Number. - - @param UhcDev The UHCI device. - @param FrameNumberAddr The address of frame list register. - - @retval The content of the frame list register. =20 -**/ -UINT16 -GetCurrentFrameNumber ( - IN USB_UHC_DEV *UhcDev, - IN UINT32 FrameNumberAddr - ) -{ - // - // Gets value in the USB frame number register. - // - return (UINT16) (USBReadPortW (UhcDev, FrameNumberAddr) & 0x03FF); -} =20 /** Set Frame List Base Address. @@ -1349,25 +1330,7 @@ SetQHHorizontalLinkPtr ( PtrQH->QueueHead.QHHorizontalPtr =3D (UINT32) (UINTN) PtrNext >> 4; } =20 -/** - Get the horizontal link pointer in QH. - - @param PtrQH Place to store QH_STRUCT pointer. =20 - @retval The horizontal link pointer in QH. - -**/ -VOID * -GetQHHorizontalLinkPtr ( - IN QH_STRUCT *PtrQH - ) -{ - // - // Restore the 28bit address to 32bit address - // (take 32bit address as an example) - // - return (VOID *) (UINTN) ((PtrQH->QueueHead.QHHorizontalPtr) << 4); -} =20 /** Set a QH or TD horizontally to be connected with a specific QH. @@ -1470,25 +1433,7 @@ SetQHVerticalValidorInvalid ( PtrQH->QueueHead.QHVerticalTerminate =3D IsValid ? 0 : 1; } =20 -/** - Get the vertical validor bit in QH. =20 - @param PtrQH Place to store QH_STRUCT pointer. - - @retval The vertical linker is valid or not. - -**/ -BOOLEAN -GetQHHorizontalValidorInvalid ( - IN QH_STRUCT *PtrQH - ) -{ - // - // If TRUE, meaning the Horizontal Link Pointer field is valid, - // else, the field is invalid. - // - return (BOOLEAN) (!(PtrQH->QueueHead.QHHorizontalTerminate)); -} =20 /** Allocate TD or QH Struct. @@ -2000,26 +1945,7 @@ GetTDLinkPtr ( return (VOID *) (UINTN) ((PtrTDStruct->TDData.TDLinkPtr) << 4); } =20 -/** - Get the information about whether the Link Pointer field pointing to - a QH or a TD. =20 - @param PtrTDStruct Place to store TD_STRUCT pointer. - - @retval whether the Link Pointer field pointing to a QH or a TD. - -**/ -BOOLEAN -IsTDLinkPtrQHOrTD ( - IN TD_STRUCT *PtrTDStruct - ) -{ - // - // Get the information about whether the Link Pointer field pointing to - // a QH or a TD. - // - return (BOOLEAN) (PtrTDStruct->TDData.TDLinkPtrQSelect); -} =20 /** Enable/Disable short packet detection mechanism. @@ -3239,60 +3165,9 @@ InsertMemoryHeaderToList ( } } =20 -/** - Judge the memory block in the memory header is empty or not. - - @param MemoryHeaderPtr A pointer to the memory header list. - - @retval Whether the memory block in the memory header is empty or not. - -**/ -BOOLEAN -IsMemoryBlockEmptied ( - IN MEMORY_MANAGE_HEADER *MemoryHeaderPtr - ) -{ - UINTN Index; - - for (Index =3D 0; Index < MemoryHeaderPtr->BitArraySizeInBytes; Index++)= { - if (MemoryHeaderPtr->BitArrayPtr[Index] !=3D 0) { - return FALSE; - } - } - - return TRUE; -} - -/** - remove a memory header from list. =20 - @param FirstMemoryHeader A pointer to the memory header list. - @param FreeMemoryHeader A memory header to be removed into the list. =20 -**/ -VOID -DelinkMemoryBlock ( - IN MEMORY_MANAGE_HEADER *FirstMemoryHeader, - IN MEMORY_MANAGE_HEADER *FreeMemoryHeader - ) -{ - MEMORY_MANAGE_HEADER *TempHeaderPtr; =20 - if ((FirstMemoryHeader =3D=3D NULL) || (FreeMemoryHeader =3D=3D NULL)) { - return ; - } - - for (TempHeaderPtr =3D FirstMemoryHeader; TempHeaderPtr !=3D NULL; TempH= eaderPtr =3D TempHeaderPtr->Next) { - - if (TempHeaderPtr->Next =3D=3D FreeMemoryHeader) { - // - // Link the before and after - // - TempHeaderPtr->Next =3D FreeMemoryHeader->Next; - break; - } - } -} =20 /** Map address of request structure buffer. diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h b/MdeModulePkg/Bus/Pci/= UhciPei/UhcPeim.h index 33d4f2f65f..01a9782d76 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.h @@ -472,21 +472,6 @@ IsStatusOK ( IN UINT32 StatusRegAddr ); =20 -/** - Get Current Frame Number. - - @param UhcDev The UHCI device. - @param FrameNumberAddr The address of frame list register. - - @retval The content of the frame list register. - -**/ -UINT16 -GetCurrentFrameNumber ( - IN USB_UHC_DEV *UhcDev, - IN UINT32 FrameNumberAddr - ); - /** Set Frame List Base Address. =20 @@ -531,19 +516,6 @@ SetQHHorizontalLinkPtr ( IN VOID *PtrNext ); =20 -/** - Get the horizontal link pointer in QH. - - @param PtrQH Place to store QH_STRUCT pointer. - - @retval The horizontal link pointer in QH. - -**/ -VOID * -GetQHHorizontalLinkPtr ( - IN QH_STRUCT *PtrQH - ); - /** Set a QH or TD horizontally to be connected with a specific QH. =20 @@ -609,18 +581,6 @@ SetQHVerticalValidorInvalid ( IN BOOLEAN IsValid ); =20 -/** - Get the vertical validor bit in QH. - - @param PtrQH Place to store QH_STRUCT pointer. - - @retval The vertical linker is valid or not. - -**/ -BOOLEAN -GetQHHorizontalValidorInvalid ( - IN QH_STRUCT *PtrQH - ); =20 /** Allocate TD or QH Struct. @@ -805,19 +765,6 @@ GetTDLinkPtr ( IN TD_STRUCT *PtrTDStruct ); =20 -/** - Get the information about whether the Link Pointer field pointing to - a QH or a TD. - - @param PtrTDStruct Place to store TD_STRUCT pointer. - - @retval whether the Link Pointer field pointing to a QH or a TD. - -**/ -BOOLEAN -IsTDLinkPtrQHOrTD ( - IN TD_STRUCT *PtrTDStruct - ); =20 /** Enable/Disable short packet detection mechanism. @@ -1317,31 +1264,6 @@ InsertMemoryHeaderToList ( IN MEMORY_MANAGE_HEADER *NewMemoryHeader ); =20 -/** - Judge the memory block in the memory header is empty or not. - - @param MemoryHeaderPtr A pointer to the memory header list. - - @retval Whether the memory block in the memory header is empty or not. - -**/ -BOOLEAN -IsMemoryBlockEmptied ( - IN MEMORY_MANAGE_HEADER *MemoryHeaderPtr - ); - -/** - remove a memory header from list. - - @param FirstMemoryHeader A pointer to the memory header list. - @param FreeMemoryHeader A memory header to be removed into the list. - -**/ -VOID -DelinkMemoryBlock ( - IN MEMORY_MANAGE_HEADER *FirstMemoryHeader, - IN MEMORY_MANAGE_HEADER *FreeMemoryHeader - ); =20 /** Map address of request structure buffer. diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/= XhciDxe/XhciReg.c index 4d5937de53..5f0736a516 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c @@ -158,75 +158,9 @@ XhcWriteOpReg ( } } =20 -/** - Write the data to the 2-bytes width XHCI operational register. =20 - @param Xhc The XHCI Instance. - @param Offset The offset of the 2-bytes width operational registe= r. - @param Data The data to write. =20 -**/ -VOID -XhcWriteOpReg16 ( - IN USB_XHCI_INSTANCE *Xhc, - IN UINT32 Offset, - IN UINT16 Data - ) -{ - EFI_STATUS Status; - - ASSERT (Xhc->CapLength !=3D 0); - - Status =3D Xhc->PciIo->Mem.Write ( - Xhc->PciIo, - EfiPciIoWidthUint16, - XHC_BAR_INDEX, - Xhc->CapLength + Offset, - 1, - &Data - ); - - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "XhcWriteOpReg16: Pci Io Write error: %r at %d\n"= , Status, Offset)); - } -} - -/** - Read XHCI door bell register. - - @param Xhc The XHCI Instance. - @param Offset The offset of the door bell register. =20 - @return The register content read - -**/ -UINT32 -XhcReadDoorBellReg ( - IN USB_XHCI_INSTANCE *Xhc, - IN UINT32 Offset - ) -{ - UINT32 Data; - EFI_STATUS Status; - - ASSERT (Xhc->DBOff !=3D 0); - - Status =3D Xhc->PciIo->Mem.Read ( - Xhc->PciIo, - EfiPciIoWidthUint32, - XHC_BAR_INDEX, - Xhc->DBOff + Offset, - 1, - &Data - ); - - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "XhcReadDoorBellReg: Pci Io Read error - %r at %d= \n", Status, Offset)); - Data =3D 0xFFFFFFFF; - } - - return Data; -} =20 /** Write the data to the XHCI door bell register. diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h b/MdeModulePkg/Bus/Pci/= XhciDxe/XhciReg.h index 838a44628c..20e7ac0e8f 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h @@ -286,20 +286,6 @@ XhcWriteOpReg ( IN UINT32 Data ); =20 -/** - Write the data to the 2-bytes width XHCI operational register. - - @param Xhc The XHCI Instance. - @param Offset The offset of the 2-bytes width operational registe= r. - @param Data The data to write. - -**/ -VOID -XhcWriteOpReg16 ( - IN USB_XHCI_INSTANCE *Xhc, - IN UINT32 Offset, - IN UINT16 Data - ); =20 /** Read XHCI runtime register. @@ -331,20 +317,6 @@ XhcWriteRuntimeReg ( IN UINT32 Data ); =20 -/** - Read XHCI door bell register. - - @param Xhc The XHCI Instance. - @param Offset The offset of the door bell register. - - @return The register content read - -**/ -UINT32 -XhcReadDoorBellReg ( - IN USB_XHCI_INSTANCE *Xhc, - IN UINT32 Offset - ); =20 /** Write the data to the XHCI door bell register. diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c b/MdeModulePkg/Bus/Pci= /XhciPei/UsbHcMem.c index 5d0232ca56..442a613095 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c @@ -328,31 +328,7 @@ UsbHcIsMemBlockEmpty ( return TRUE; } =20 -/** - Unlink the memory block from the pool's list. - - @param Head The block list head of the memory's pool. - @param BlockToUnlink The memory block to unlink. =20 -**/ -VOID -UsbHcUnlinkMemBlock ( - IN USBHC_MEM_BLOCK *Head, - IN USBHC_MEM_BLOCK *BlockToUnlink - ) -{ - USBHC_MEM_BLOCK *Block; - - ASSERT ((Head !=3D NULL) && (BlockToUnlink !=3D NULL)); - - for (Block =3D Head; Block !=3D NULL; Block =3D Block->Next) { - if (Block->Next =3D=3D BlockToUnlink) { - Block->Next =3D BlockToUnlink->Next; - BlockToUnlink->Next =3D NULL; - break; - } - } -} =20 /** Initialize the memory management pool for the host controller. diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c b/MdeModulePkg/Bus/Pci/= XhciPei/XhcPeim.c index c5631e87ca..ee4d1f97bd 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c @@ -211,29 +211,7 @@ XhcPeiReadCapRegister ( return Data; } =20 -/** - Read XHCI door bell register. - - @param Xhc The XHCI device. - @param Offset The offset of the door bell register. - - @return The register content read =20 -**/ -UINT32 -XhcPeiReadDoorBellReg ( - IN PEI_XHC_DEV *Xhc, - IN UINT32 Offset - ) -{ - UINT32 Data; - - ASSERT (Xhc->DBOff !=3D 0); - - Data =3D MmioRead32 (Xhc->UsbHostControllerBaseAddress + Xhc->DBOff + Of= fset); - - return Data; -} =20 /** Write the data to the XHCI door bell register. diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h b/MdeModulePkg/Bus/Pci/= XhciPei/XhciReg.h index 0297072ffd..3787aeccf5 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciReg.h @@ -302,20 +302,6 @@ XhcPeiWaitOpRegBit ( IN UINT32 Timeout ); =20 -/** - Read XHCI door bell register. - - @param Xhc The XHCI device. - @param Offset The offset of the door bell register. - - @return The register content read - -**/ -UINT32 -XhcPeiReadDoorBellReg ( - IN PEI_XHC_DEV *Xhc, - IN UINT32 Offset - ); =20 /** Write the data to the XHCI door bell register. diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c b/MdeModulePkg/= Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c index a6f188f385..217736c1a6 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c @@ -219,31 +219,7 @@ EmmcPeimIsMemBlockEmpty ( return TRUE; } =20 -/** - Unlink the memory block from the pool's list. - - @param Head The block list head of the memory's pool. - @param BlockToUnlink The memory block to unlink. =20 -**/ -VOID -EmmcPeimUnlinkMemBlock ( - IN EMMC_PEIM_MEM_BLOCK *Head, - IN EMMC_PEIM_MEM_BLOCK *BlockToUnlink - ) -{ - EMMC_PEIM_MEM_BLOCK *Block; - - ASSERT ((Head !=3D NULL) && (BlockToUnlink !=3D NULL)); - - for (Block =3D Head; Block !=3D NULL; Block =3D Block->Next) { - if (Block->Next =3D=3D BlockToUnlink) { - Block->Next =3D BlockToUnlink->Next; - BlockToUnlink->Next =3D NULL; - break; - } - } -} =20 /** Initialize the memory management pool for the host controller. diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c b/MdeModulePkg/Bus/= Sd/SdBlockIoPei/SdHcMem.c index 24ad3dc6c2..0c3a424e3b 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c @@ -219,31 +219,7 @@ SdPeimIsMemBlockEmpty ( return TRUE; } =20 -/** - Unlink the memory block from the pool's list. - - @param Head The block list head of the memory's pool. - @param BlockToUnlink The memory block to unlink. =20 -**/ -VOID -SdPeimUnlinkMemBlock ( - IN SD_PEIM_MEM_BLOCK *Head, - IN SD_PEIM_MEM_BLOCK *BlockToUnlink - ) -{ - SD_PEIM_MEM_BLOCK *Block; - - ASSERT ((Head !=3D NULL) && (BlockToUnlink !=3D NULL)); - - for (Block =3D Head; Block !=3D NULL; Block =3D Block->Next) { - if (Block->Next =3D=3D BlockToUnlink) { - Block->Next =3D BlockToUnlink->Next; - BlockToUnlink->Next =3D NULL; - break; - } - } -} =20 /** Initialize the memory management pool for the host controller. diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c b/MdeModule= Pkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c index 505b92cfc1..204e456413 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.c @@ -137,53 +137,7 @@ UFS_PEIM_HC_PRIVATE_DATA gUfsHcPeimTemplate =3D { } }; =20 -/** - Execute Request Sense SCSI command on a specific UFS device. - - @param[in] Private A pointer to UFS_PEIM_HC_PRIVATE_DATA d= ata structure. - @param[in] Lun The lun on which the SCSI cmd executed. - @param[out] DataBuffer A pointer to output sense data. - @param[out] DataBufferLength The length of output sense data. - - @retval EFI_SUCCESS The command executed successfully. - @retval EFI_DEVICE_ERROR A device error occurred while attemptin= g to send SCSI Request Packet. - @retval EFI_TIMEOUT A timeout occurred while waiting for th= e SCSI Request Packet to execute. - -**/ -EFI_STATUS -UfsPeimRequestSense ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - IN UINTN Lun, - OUT VOID *DataBuffer, - OUT UINT32 *DataBufferLength - ) -{ - UFS_SCSI_REQUEST_PACKET Packet; - UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIX]; - EFI_STATUS Status; =20 - ZeroMem (&Packet, sizeof (UFS_SCSI_REQUEST_PACKET)); - ZeroMem (Cdb, sizeof (Cdb)); - - Cdb[0] =3D EFI_SCSI_OP_REQUEST_SENSE; - - Packet.Timeout =3D UFS_TIMEOUT; - Packet.Cdb =3D Cdb; - Packet.CdbLength =3D sizeof (Cdb); - Packet.DataDirection =3D UfsDataIn; - Packet.InDataBuffer =3D DataBuffer; - Packet.InTransferLength =3D *DataBufferLength; - Packet.SenseData =3D NULL; - Packet.SenseDataLength =3D 0; - - Status =3D UfsExecScsiCmds (Private,(UINT8)Lun, &Packet); - - if (!EFI_ERROR (Status)) { - *DataBufferLength =3D Packet.InTransferLength; - } - - return Status; -} =20 /** Execute TEST UNITY READY SCSI command on a specific UFS device. @@ -231,62 +185,7 @@ UfsPeimTestUnitReady ( return Status; } =20 -/** - Execute INQUIRY SCSI command on a specific UFS device. - - @param[in] Private A pointer to UFS_PEIM_HC_PRIVATE_DATA d= ata structure. - @param[in] Lun The lun on which the SCSI cmd executed. - @param[out] Inquiry A pointer to Inquiry data buffer. - @param[out] InquiryLengths The length of output Inquiry data. - @param[out] SenseData A pointer to output sense data. - @param[out] SenseDataLength The length of output sense data. - - @retval EFI_SUCCESS The command executed successfully. - @retval EFI_DEVICE_ERROR A device error occurred while attemptin= g to send SCSI Request Packet. - @retval EFI_TIMEOUT A timeout occurred while waiting for th= e SCSI Request Packet to execute. - -**/ -EFI_STATUS -UfsPeimInquiry ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - IN UINTN Lun, - OUT VOID *Inquiry, - OUT UINT32 *InquiryLength, - OUT VOID *SenseData, OPTIONAL - OUT UINT8 *SenseDataLength - ) -{ - UFS_SCSI_REQUEST_PACKET Packet; - UINT8 Cdb[UFS_SCSI_OP_LENGTH_SIX]; - EFI_STATUS Status; - - ZeroMem (&Packet, sizeof (UFS_SCSI_REQUEST_PACKET)); - ZeroMem (Cdb, sizeof (Cdb)); =20 - Cdb[0] =3D EFI_SCSI_OP_INQUIRY; - Cdb[4] =3D sizeof (EFI_SCSI_INQUIRY_DATA); - - Packet.Timeout =3D UFS_TIMEOUT; - Packet.Cdb =3D Cdb; - Packet.CdbLength =3D sizeof (Cdb); - Packet.InDataBuffer =3D Inquiry; - Packet.InTransferLength =3D *InquiryLength; - Packet.DataDirection =3D UfsDataIn; - Packet.SenseData =3D SenseData; - Packet.SenseDataLength =3D *SenseDataLength; - - Status =3D UfsExecScsiCmds (Private, (UINT8)Lun, &Packet); - - if (*SenseDataLength !=3D 0) { - *SenseDataLength =3D Packet.SenseDataLength; - } - - if (!EFI_ERROR (Status)) { - *InquiryLength =3D Packet.InTransferLength; - } - - return Status; -} =20 /** Execute READ CAPACITY(10) SCSI command on a specific UFS device. diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c b/MdeModulePkg/B= us/Ufs/UfsBlockIoPei/UfsHcMem.c index d69e6e7227..d334faa0bb 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c @@ -219,31 +219,7 @@ UfsPeimIsMemBlockEmpty ( return TRUE; } =20 -/** - Unlink the memory block from the pool's list. - - @param Head The block list head of the memory's pool. - @param BlockToUnlink The memory block to unlink. =20 -**/ -VOID -UfsPeimUnlinkMemBlock ( - IN UFS_PEIM_MEM_BLOCK *Head, - IN UFS_PEIM_MEM_BLOCK *BlockToUnlink - ) -{ - UFS_PEIM_MEM_BLOCK *Block; - - ASSERT ((Head !=3D NULL) && (BlockToUnlink !=3D NULL)); - - for (Block =3D Head; Block !=3D NULL; Block =3D Block->Next) { - if (Block->Next =3D=3D BlockToUnlink) { - Block->Next =3D BlockToUnlink->Next; - BlockToUnlink->Next =3D NULL; - break; - } - } -} =20 /** Initialize the memory management pool for the host controller. diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c b/MdeModulePkg/Bus= /Ufs/UfsBlockIoPei/UfsHci.c index e36ff8c02a..936f25da5e 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c @@ -694,31 +694,7 @@ UfsFindAvailableSlotInTrl ( return EFI_SUCCESS; } =20 -/** - Find out available slot in task management transfer list of a UFS device. - - @param[in] Private The pointer to the UFS_PEIM_HC_PRIVATE_DATA da= ta structure. - @param[out] Slot The available slot. - - @retval EFI_SUCCESS The available slot was found successfully. - -**/ -EFI_STATUS -UfsFindAvailableSlotInTmrl ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - OUT UINT8 *Slot - ) -{ - ASSERT ((Private !=3D NULL) && (Slot !=3D NULL)); - - // - // The simplest algo to always use slot 0. - // TODO: enhance it to support async transfer with multiple slot. - // - *Slot =3D 0; =20 - return EFI_SUCCESS; -} =20 /** Start specified slot in transfer list of a UFS device. @@ -897,113 +873,7 @@ Exit: return Status; } =20 -/** - Read or write specified attribute of a UFS device. - - @param[in] Private The pointer to the UFS_PEIM_HC_PRIVATE_DAT= A data structure. - @param[in] Read The boolean variable to show r/w direction. - @param[in] AttrId The ID of Attribute. - @param[in] Index The Index of Attribute. - @param[in] Selector The Selector of Attribute. - @param[in, out] Attributes The value of Attribute to be read or writt= en. - - @retval EFI_SUCCESS The Attribute was read/written successfull= y. - @retval EFI_DEVICE_ERROR A device error occurred while attempting t= o r/w the Attribute. - @retval EFI_TIMEOUT A timeout occurred while waiting for the c= ompletion of r/w the Attribute. - -**/ -EFI_STATUS -UfsRwAttributes ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - IN BOOLEAN Read, - IN UINT8 AttrId, - IN UINT8 Index, - IN UINT8 Selector, - IN OUT UINT32 *Attributes - ) -{ - EFI_STATUS Status; - UFS_DEVICE_MANAGEMENT_REQUEST_PACKET Packet; - UINT8 Slot; - UTP_TRD *Trd; - UINTN Address; - UTP_QUERY_RESP_UPIU *QueryResp; - UINT8 *CmdDescBase; - UINT32 CmdDescSize; - UINT32 ReturnData; - - ZeroMem (&Packet, sizeof (UFS_DEVICE_MANAGEMENT_REQUEST_PACKET)); - - if (Read) { - Packet.DataDirection =3D UfsDataIn; - Packet.Opcode =3D UtpQueryFuncOpcodeRdAttr; - } else { - Packet.DataDirection =3D UfsDataOut; - Packet.Opcode =3D UtpQueryFuncOpcodeWrAttr; - } - Packet.DescId =3D AttrId; - Packet.Index =3D Index; - Packet.Selector =3D Selector; - Packet.Timeout =3D UFS_TIMEOUT; - - // - // Find out which slot of transfer request list is available. - // - Status =3D UfsFindAvailableSlotInTrl (Private, &Slot); - if (EFI_ERROR (Status)) { - return Status; - } - - Trd =3D ((UTP_TRD*)Private->UtpTrlBase) + Slot; - // - // Fill transfer request descriptor to this slot. - // - Status =3D UfsCreateDMCommandDesc (Private, &Packet, Trd); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Check the transfer request result. - // - CmdDescBase =3D (UINT8 *)(UINTN)(LShiftU64 ((UINT64)Trd->UcdBaU, 32) | L= ShiftU64 ((UINT64)Trd->UcdBa, 7)); - QueryResp =3D (UTP_QUERY_RESP_UPIU*)(CmdDescBase + Trd->RuO * sizeof (= UINT32)); - CmdDescSize =3D Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32); - - // - // Start to execute the transfer request. - // - UfsStartExecCmd (Private, Slot); - - // - // Wait for the completion of the transfer request. - // - Address =3D Private->UfsHcBase + UFS_HC_UTRLDBR_OFFSET; - Status =3D UfsWaitMemSet (Address, BIT0 << Slot, 0, Packet.Timeout); - if (EFI_ERROR (Status)) { - goto Exit; - } - - if (QueryResp->QueryResp !=3D 0) { - DumpQueryResponseResult (QueryResp->QueryResp); - Status =3D EFI_DEVICE_ERROR; - goto Exit; - } - - if (Trd->Ocs =3D=3D 0) { - ReturnData =3D QueryResp->Tsf.Value; - SwapLittleEndianToBigEndian ((UINT8*)&ReturnData, sizeof (UINT32)); - *Attributes =3D ReturnData; - } else { - Status =3D EFI_DEVICE_ERROR; - } - -Exit: - UfsStopExecCmd (Private, Slot); - UfsPeimFreeMem (Private->Pool, CmdDescBase, CmdDescSize); =20 - return Status; -} =20 /** Read or write specified flag of a UFS device. @@ -1143,57 +1013,7 @@ UfsSetFlag ( return Status; } =20 -/** - Clear specified flag to 0 on a UFS device. - - @param[in] Private The pointer to the UFS_PEIM_HC_PRIVATE_DAT= A data structure. - @param[in] FlagId The ID of flag to be cleared. - - @retval EFI_SUCCESS The flag was cleared successfully. - @retval EFI_DEVICE_ERROR A device error occurred while attempting t= o clear the flag. - @retval EFI_TIMEOUT A timeout occurred while waiting for the c= ompletion of clearing the flag. - -**/ -EFI_STATUS -UfsClearFlag ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - IN UINT8 FlagId - ) -{ - EFI_STATUS Status; - UINT8 Value; - - Value =3D 0; - Status =3D UfsRwFlags (Private, FALSE, FlagId, &Value); - - return Status; -} - -/** - Read specified flag from a UFS device. - - @param[in] Private The pointer to the UFS_PEIM_HC_PRIVATE_DAT= A data structure. - @param[in] FlagId The ID of flag to be read. - @param[out] Value The flag's value. - - @retval EFI_SUCCESS The flag was read successfully. - @retval EFI_DEVICE_ERROR A device error occurred while attempting t= o read the flag. - @retval EFI_TIMEOUT A timeout occurred while waiting for the c= ompletion of reading the flag. - -**/ -EFI_STATUS -UfsReadFlag ( - IN UFS_PEIM_HC_PRIVATE_DATA *Private, - IN UINT8 FlagId, - OUT UINT8 *Value - ) -{ - EFI_STATUS Status; - - Status =3D UfsRwFlags (Private, TRUE, FlagId, Value); =20 - return Status; -} =20 /** Sends NOP IN cmd to a UFS device for initialization process request. diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModu= lePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index e868c8c07e..5756f637fd 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -753,31 +753,6 @@ UfsFindAvailableSlotInTrl ( return EFI_NOT_READY; } =20 -/** - Find out available slot in task management transfer list of a UFS device. - - @param[in] Private The pointer to the UFS_PASS_THRU_PRIVATE_DATA = data structure. - @param[out] Slot The available slot. - - @retval EFI_SUCCESS The available slot was found successfully. - -**/ -EFI_STATUS -UfsFindAvailableSlotInTmrl ( - IN UFS_PASS_THRU_PRIVATE_DATA *Private, - OUT UINT8 *Slot - ) -{ - ASSERT ((Private !=3D NULL) && (Slot !=3D NULL)); - - // - // The simplest algo to always use slot 0. - // TODO: enhance it to support async transfer with multiple slot. - // - *Slot =3D 0; - - return EFI_SUCCESS; -} =20 /** Start specified slot in transfer list of a UFS device. @@ -1229,31 +1204,7 @@ UfsSetFlag ( return Status; } =20 -/** - Clear specified flag to 0 on a UFS device. - - @param[in] Private The pointer to the UFS_PASS_THRU_PRIVATE_D= ATA data structure. - @param[in] FlagId The ID of flag to be cleared. - - @retval EFI_SUCCESS The flag was cleared successfully. - @retval EFI_DEVICE_ERROR A device error occurred while attempting t= o clear the flag. - @retval EFI_TIMEOUT A timeout occurred while waiting for the c= ompletion of clearing the flag. - -**/ -EFI_STATUS -UfsClearFlag ( - IN UFS_PASS_THRU_PRIVATE_DATA *Private, - IN UINT8 FlagId - ) -{ - EFI_STATUS Status; - UINT8 Value; - - Value =3D 0; - Status =3D UfsRwFlags (Private, FALSE, FlagId, &Value); =20 - return Status; -} =20 /** Read specified flag from a UFS device. diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c b/MdeModulePkg/Bus/= Usb/UsbBotPei/PeiUsbLib.c index 4f20c71144..cd765c40c5 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c @@ -17,92 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHE= R EXPRESS OR IMPLIED. #include "UsbPeim.h" #include "PeiUsbLib.h" =20 -/** - Get a given usb descriptor. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Value Request Value. - @param Index Request Index. - @param DescriptorLength Request descriptor Length. - @param Descriptor Request descriptor. - - - @retval EFI_SUCCESS Usb descriptor is obtained successfully. - @retval EFI_DEVICE_ERROR Cannot get the usb descriptor due to a hardwa= re error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbGetDescriptor ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT16 Value, - IN UINT16 Index, - IN UINT16 DescriptorLength, - OUT VOID *Descriptor - ) -{ - EFI_USB_DEVICE_REQUEST DevReq; - - ASSERT (UsbIoPpi !=3D NULL); - - DevReq.RequestType =3D USB_DEV_GET_DESCRIPTOR_REQ_TYPE; - DevReq.Request =3D USB_DEV_GET_DESCRIPTOR; - DevReq.Value =3D Value; - DevReq.Index =3D Index; - DevReq.Length =3D DescriptorLength; - - return UsbIoPpi->UsbControlTransfer ( - PeiServices, - UsbIoPpi, - &DevReq, - EfiUsbDataIn, - PcdGet32 (PcdUsbTransferTimeoutValue), - Descriptor, - DescriptorLength - ); -} - -/** - Set a usb device with a specified address. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param AddressValue The address to assign. - - @retval EFI_SUCCESS Usb device address is set successfully. - @retval EFI_DEVICE_ERROR Cannot set the usb address due to a hardware = error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbSetDeviceAddress ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT16 AddressValue - ) -{ - EFI_USB_DEVICE_REQUEST DevReq; - - ASSERT (UsbIoPpi !=3D NULL); - - DevReq.RequestType =3D USB_DEV_SET_ADDRESS_REQ_TYPE; - DevReq.Request =3D USB_DEV_SET_ADDRESS; - DevReq.Value =3D AddressValue; - DevReq.Index =3D 0; - DevReq.Length =3D 0; - - return UsbIoPpi->UsbControlTransfer ( - PeiServices, - UsbIoPpi, - &DevReq, - EfiUsbNoData, - PcdGet32 (PcdUsbTransferTimeoutValue), - NULL, - 0 - ); -} =20 /** Clear a given usb feature. @@ -161,40 +75,6 @@ PeiUsbClearDeviceFeature ( ); } =20 -/** - Configure a usb device to Configuration 1. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - - @retval EFI_SUCCESS Usb device is set to use Configuration 1 succe= ssfully. - @retval EFI_DEVICE_ERROR Cannot set the usb device due to a hardware er= ror. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbSetConfiguration ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi - ) -{ - EFI_USB_DEVICE_REQUEST DevReq; - ZeroMem (&DevReq, sizeof (EFI_USB_DEVICE_REQUEST)); - - DevReq.RequestType =3D USB_DEV_SET_CONFIGURATION_REQ_TYPE; - DevReq.Request =3D USB_DEV_SET_CONFIGURATION; - DevReq.Value =3D 1; - - return UsbIoPpi->UsbControlTransfer ( - PeiServices, - UsbIoPpi, - &DevReq, - EfiUsbNoData, - PcdGet32 (PcdUsbTransferTimeoutValue), - NULL, - 0 - ); -} =20 /** Clear Endpoint Halt. @@ -258,74 +138,4 @@ PeiUsbClearEndpointHalt ( return Status; } =20 -/** - Judge if the port is connected with a usb device or not. - - @param PortStatus The usb port status gotten. =20 - @retval TRUE A usb device is connected with the port. - @retval FALSE No usb device is connected with the port. - -**/ -BOOLEAN -IsPortConnect ( - IN UINT16 PortStatus - ) -{ - // - // return the bit 0 value of PortStatus - // - if ((PortStatus & USB_PORT_STAT_CONNECTION) !=3D 0) { - return TRUE; - } else { - return FALSE; - } -} - -/** - Judge if the port is connected with a low-speed usb device or not. - - @param PortStatus The usb port status gotten. - - @retval TRUE A low-speed usb device is connected with the port. - @retval FALSE No low-speed usb device is connected with the port. - -**/ -BOOLEAN -IsPortLowSpeedDeviceAttached ( - IN UINT16 PortStatus - ) -{ - // - // return the bit 9 value of PortStatus - // - if ((PortStatus & USB_PORT_STAT_LOW_SPEED) !=3D 0) { - return TRUE; - } else { - return FALSE; - } -} - -/** - Judge if the port is in "connection change" status or not. - - @param PortChangeStatus The usb port change status gotten. - - @retval TRUE The port is in "connection change" status. - @retval FALSE The port is NOT in "connection change" status. - -**/ -BOOLEAN -IsPortConnectChange ( - IN UINT16 PortChangeStatus - ) -{ - // - // return the bit 0 value of PortChangeStatus - // - if ((PortChangeStatus & USB_PORT_STAT_C_CONNECTION) !=3D 0) { - return TRUE; - } else { - return FALSE; - } -} diff --git a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h b/MdeModulePkg/Bus/= Usb/UsbBotPei/PeiUsbLib.h index 6d39b764eb..a160146cae 100644 --- a/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h +++ b/MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h @@ -100,50 +100,6 @@ typedef enum { EfiUsbEndpoint } EFI_USB_RECIPIENT; =20 -/** - Get a given usb descriptor. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Value Request Value. - @param Index Request Index. - @param DescriptorLength Request descriptor Length. - @param Descriptor Request descriptor. - - - @retval EFI_SUCCESS Usb descriptor is obtained successfully. - @retval EFI_DEVICE_ERROR Cannot get the usb descriptor due to a hardwar= e error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbGetDescriptor ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT16 Value, - IN UINT16 Index, - IN UINT16 DescriptorLength, - OUT VOID *Descriptor - ); - -/** - Set a usb device with a specified address. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param AddressValue The address to assign. - - @retval EFI_SUCCESS Usb device address is set successfully. - @retval EFI_DEVICE_ERROR Cannot set the usb address due to a hardware = error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbSetDeviceAddress ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT16 AddressValue - ); =20 /** Clear a given usb feature. @@ -168,22 +124,6 @@ PeiUsbClearDeviceFeature ( IN UINT16 Target ); =20 -/** - Configure a usb device to Configuration 1. - - @param PeiServices General-purpose services that are available t= o every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - - @retval EFI_SUCCESS Usb device is set to use Configuration 1 succ= essfully. - @retval EFI_DEVICE_ERROR Cannot set the usb device due to a hardware e= rror. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbSetConfiguration ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi - ); =20 /** Clear Endpoint Halt. @@ -204,45 +144,7 @@ PeiUsbClearEndpointHalt ( IN UINT8 EndpointAddress ); =20 -/** - Judge if the port is connected with a usb device or not. - - @param PortStatus The usb port status gotten. - - @retval TRUE A usb device is connected with the port. - @retval FALSE No usb device is connected with the port. - -**/ -BOOLEAN -IsPortConnect ( - IN UINT16 PortStatus - ); - -/** - Judge if the port is connected with a low-speed usb device or not. - - @param PortStatus The usb port status gotten. =20 - @retval TRUE A low-speed usb device is connected with the port. - @retval FALSE No low-speed usb device is connected with the port. =20 -**/ -BOOLEAN -IsPortLowSpeedDeviceAttached ( - IN UINT16 PortStatus - ); =20 -/** - Judge if the port is in "connection change" status or not. - - @param PortChangeStatus The usb port change status gotten. - - @retval TRUE The port is in "connection change" status. - @retval FALSE The port is NOT in "connection change" status. - -**/ -BOOLEAN -IsPortConnectChange ( - IN UINT16 PortChangeStatus - ); #endif diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb= /UsbBusDxe/UsbHub.c index 2ce5726e63..fdb3276a82 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c @@ -317,74 +317,6 @@ UsbHubCtrlGetPortStatus ( } =20 =20 -/** - Usb hub control transfer to reset the TT (Transaction Transaltor). - - @param HubDev The hub device. - @param Port The port of the hub. - - @retval EFI_SUCCESS The TT of the hub is reset. - @retval Others Failed to reset the port. - -**/ -EFI_STATUS -UsbHubCtrlResetTT ( - IN USB_DEVICE *HubDev, - IN UINT8 Port - ) -{ - EFI_STATUS Status; - - Status =3D UsbCtrlRequest ( - HubDev, - EfiUsbNoData, - USB_REQ_TYPE_CLASS, - USB_HUB_TARGET_HUB, - USB_HUB_REQ_RESET_TT, - 0, - (UINT16) (Port + 1), - NULL, - 0 - ); - - return Status; -} - - -/** - Usb hub control transfer to set the hub feature. - - @param HubDev The hub device. - @param Feature The feature to set. - - @retval EFI_SUCESS The feature is set for the hub. - @retval Others Failed to set the feature. - -**/ -EFI_STATUS -UsbHubCtrlSetHubFeature ( - IN USB_DEVICE *HubDev, - IN UINT8 Feature - ) -{ - EFI_STATUS Status; - - Status =3D UsbCtrlRequest ( - HubDev, - EfiUsbNoData, - USB_REQ_TYPE_CLASS, - USB_HUB_TARGET_HUB, - USB_HUB_REQ_SET_FEATURE, - Feature, - 0, - NULL, - 0 - ); - - return Status; -} - - /** Usb hub control transfer to set the port feature. =20 diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c b/MdeModulePkg/Bus= /Usb/UsbBusDxe/UsbUtility.c index e9b5fefb9a..e405edfd4a 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c @@ -90,90 +90,12 @@ UsbHcGetCapability ( } =20 =20 -/** - Reset the host controller. =20 - @param UsbBus The usb bus driver. - @param Attributes The reset type, only global reset is used = by this driver. =20 - @retval EFI_SUCCESS The reset operation succeeded. - @retval EFI_INVALID_PARAMETER Attributes is not valid. - @retval EFI_UNSUPPOURTED The type of reset specified by Attributes = is - not currently supported by the host contro= ller. - @retval EFI_DEVICE_ERROR Host controller isn't halted to reset. -**/ -EFI_STATUS -UsbHcReset ( - IN USB_BUS *UsbBus, - IN UINT16 Attributes - ) -{ - EFI_STATUS Status; =20 - if (UsbBus->Usb2Hc !=3D NULL) { - Status =3D UsbBus->Usb2Hc->Reset (UsbBus->Usb2Hc, Attributes); - } else { - Status =3D UsbBus->UsbHc->Reset (UsbBus->UsbHc, Attributes); - } =20 - return Status; -} =20 =20 -/** - Get the current operation state of the host controller. - - @param UsbBus The USB bus driver. - @param State The host controller operation state. - - @retval EFI_SUCCESS The operation state is returned in State. - @retval Others Failed to get the host controller state. - -**/ -EFI_STATUS -UsbHcGetState ( - IN USB_BUS *UsbBus, - OUT EFI_USB_HC_STATE *State - ) -{ - EFI_STATUS Status; - - if (UsbBus->Usb2Hc !=3D NULL) { - Status =3D UsbBus->Usb2Hc->GetState (UsbBus->Usb2Hc, State); - } else { - Status =3D UsbBus->UsbHc->GetState (UsbBus->UsbHc, State); - } - - return Status; -} - - -/** - Set the host controller operation state. - - @param UsbBus The USB bus driver. - @param State The state to set. - - @retval EFI_SUCCESS The host controller is now working at State. - @retval Others Failed to set operation state. - -**/ -EFI_STATUS -UsbHcSetState ( - IN USB_BUS *UsbBus, - IN EFI_USB_HC_STATE State - ) -{ - EFI_STATUS Status; - - if (UsbBus->Usb2Hc !=3D NULL) { - Status =3D UsbBus->Usb2Hc->SetState (UsbBus->Usb2Hc, State); - } else { - Status =3D UsbBus->UsbHc->SetState (UsbBus->UsbHc, State); - } - - return Status; -} =20 =20 /** @@ -563,78 +485,10 @@ UsbHcSyncInterruptTransfer ( } =20 =20 -/** - Execute a synchronous Isochronous USB transfer. - - @param UsbBus The USB bus driver. - @param DevAddr The target device address. - @param EpAddr The target endpoint address, with direction enc= oded in - bit 7. - @param DevSpeed The device's speed. - @param MaxPacket The endpoint's max packet size. - @param BufferNum The number of data buffer. - @param Data Array of pointers to data buffer. - @param DataLength The length of data buffer. - @param Translator The transaction translator for low/full speed d= evice. - @param UsbResult The result of USB execution. - - @retval EFI_UNSUPPORTED The isochronous transfer isn't supported now. - -**/ -EFI_STATUS -UsbHcIsochronousTransfer ( - IN USB_BUS *UsbBus, - IN UINT8 DevAddr, - IN UINT8 EpAddr, - IN UINT8 DevSpeed, - IN UINTN MaxPacket, - IN UINT8 BufferNum, - IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM= ], - IN UINTN DataLength, - IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, - OUT UINT32 *UsbResult - ) -{ - return EFI_UNSUPPORTED; -} =20 =20 -/** - Queue an asynchronous isochronous transfer. =20 - @param UsbBus The USB bus driver. - @param DevAddr The target device address. - @param EpAddr The target endpoint address, with direction enc= oded in - bit 7. - @param DevSpeed The device's speed. - @param MaxPacket The endpoint's max packet size. - @param BufferNum The number of data buffer. - @param Data Array of pointers to data buffer. - @param DataLength The length of data buffer. - @param Translator The transaction translator for low/full speed d= evice. - @param Callback The function to call when data is transferred. - @param Context The context to the callback function. - - @retval EFI_UNSUPPORTED The asynchronous isochronous transfer isn't sup= ported. =20 -**/ -EFI_STATUS -UsbHcAsyncIsochronousTransfer ( - IN USB_BUS *UsbBus, - IN UINT8 DevAddr, - IN UINT8 EpAddr, - IN UINT8 DevSpeed, - IN UINTN MaxPacket, - IN UINT8 BufferNum, - IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM= ], - IN UINTN DataLength, - IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, - IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, - IN VOID *Context - ) -{ - return EFI_UNSUPPORTED; -} =20 =20 /** diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h b/MdeModulePkg/Bus= /Usb/UsbBusDxe/UsbUtility.h index 26709caa36..ef19e77c40 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.h @@ -36,55 +36,6 @@ UsbHcGetCapability ( OUT UINT8 *Is64BitCapable ); =20 -/** - Reset the host controller. - - @param UsbBus The usb bus driver. - @param Attributes The reset type, only global reset is used = by this driver. - - @retval EFI_SUCCESS The reset operation succeeded. - @retval EFI_INVALID_PARAMETER Attributes is not valid. - @retval EFI_UNSUPPOURTED The type of reset specified by Attributes = is - not currently supported by the host contro= ller. - @retval EFI_DEVICE_ERROR Host controller isn't halted to reset. -**/ -EFI_STATUS -UsbHcReset ( - IN USB_BUS *UsbBus, - IN UINT16 Attributes - ); - -/** - Get the current operation state of the host controller. - - @param UsbBus The USB bus driver. - @param State The host controller operation state. - - @retval EFI_SUCCESS The operation state is returned in State. - @retval Others Failed to get the host controller state. - -**/ -EFI_STATUS -UsbHcGetState ( - IN USB_BUS *UsbBus, - OUT EFI_USB_HC_STATE *State - ); - -/** - Set the host controller operation state. - - @param UsbBus The USB bus driver. - @param State The state to set. - - @retval EFI_SUCCESS The host controller is now working at State. - @retval Others Failed to set operation state. - -**/ -EFI_STATUS -UsbHcSetState ( - IN USB_BUS *UsbBus, - IN EFI_USB_HC_STATE State - ); =20 /** Get the root hub port state. @@ -286,71 +237,6 @@ UsbHcSyncInterruptTransfer ( OUT UINT32 *UsbResult ); =20 -/** - Execute a synchronous Isochronous USB transfer. - - @param UsbBus The USB bus driver. - @param DevAddr The target device address. - @param EpAddr The target endpoint address, with direction enc= oded in - bit 7. - @param DevSpeed The device's speed. - @param MaxPacket The endpoint's max packet size. - @param BufferNum The number of data buffer. - @param Data Array of pointers to data buffer. - @param DataLength The length of data buffer. - @param Translator The transaction translator for low/full speed d= evice. - @param UsbResult The result of USB execution. - - @retval EFI_UNSUPPORTED The isochronous transfer isn't supported now. - -**/ -EFI_STATUS -UsbHcIsochronousTransfer ( - IN USB_BUS *UsbBus, - IN UINT8 DevAddr, - IN UINT8 EpAddr, - IN UINT8 DevSpeed, - IN UINTN MaxPacket, - IN UINT8 BufferNum, - IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM= ], - IN UINTN DataLength, - IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, - OUT UINT32 *UsbResult - ); - -/** - Queue an asynchronous isochronous transfer. - - @param UsbBus The USB bus driver. - @param DevAddr The target device address. - @param EpAddr The target endpoint address, with direction enc= oded in - bit 7. - @param DevSpeed The device's speed. - @param MaxPacket The endpoint's max packet size. - @param BufferNum The number of data buffer. - @param Data Array of pointers to data buffer. - @param DataLength The length of data buffer. - @param Translator The transaction translator for low/full speed d= evice. - @param Callback The function to call when data is transferred. - @param Context The context to the callback function. - - @retval EFI_UNSUPPORTED The asynchronous isochronous transfer isn't sup= ported. - -**/ -EFI_STATUS -UsbHcAsyncIsochronousTransfer ( - IN USB_BUS *UsbBus, - IN UINT8 DevAddr, - IN UINT8 EpAddr, - IN UINT8 DevSpeed, - IN UINTN MaxPacket, - IN UINT8 BufferNum, - IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM= ], - IN UINTN DataLength, - IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, - IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, - IN VOID *Context - ); =20 /** Open the USB host controller protocol BY_CHILD. diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c b/MdeModulePkg/Bus/Us= b/UsbBusPei/HubPeim.c index 806602511c..5607c65b13 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c @@ -193,46 +193,7 @@ PeiHubGetHubStatus ( ); } =20 -/** - Set specified feature to a given hub. - - @param PeiServices General-purpose services that are available to eve= ry PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Value New feature value. - - @retval EFI_SUCCESS Port feature is set successfully. - @retval EFI_DEVICE_ERROR Cannot set the port feature due to a hardware = error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiHubSetHubFeature ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT8 Value - ) -{ - EFI_USB_DEVICE_REQUEST DeviceRequest; =20 - ZeroMem (&DeviceRequest, sizeof (EFI_USB_DEVICE_REQUEST)); - - // - // Fill Device request packet - // - DeviceRequest.RequestType =3D USB_HUB_SET_HUB_FEATURE_REQ_TYPE; - DeviceRequest.Request =3D USB_HUB_SET_HUB_FEATURE; - DeviceRequest.Value =3D Value; - - return UsbIoPpi->UsbControlTransfer ( - PeiServices, - UsbIoPpi, - &DeviceRequest, - EfiUsbNoData, - PcdGet32 (PcdUsbTransferTimeoutValue), - NULL, - 0 - ); -} =20 /** Clear specified feature on a given hub. diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h b/MdeModulePkg/Bus/Us= b/UsbBusPei/HubPeim.h index 385a14ec0d..d21057c349 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h @@ -145,24 +145,6 @@ PeiHubSetPortFeature ( IN UINT8 Value ); =20 -/** - Set specified feature to a given hub. - - @param PeiServices General-purpose services that are available to eve= ry PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Value New feature value. - - @retval EFI_SUCCESS Port feature is set successfully. - @retval EFI_DEVICE_ERROR Cannot set the port feature due to a hardware = error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiHubSetHubFeature ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN UINT8 Value - ); =20 /** Get a given hub status. diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c b/MdeModulePkg/Bus/= Usb/UsbBusPei/PeiUsbLib.c index c5e599e2f7..73a163e7a0 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c @@ -104,62 +104,7 @@ PeiUsbSetDeviceAddress ( ); } =20 -/** - Clear a given usb feature. - - @param PeiServices General-purpose services that are available to= every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Recipient The recipient of ClearFeature Request, should = be one of Device/Interface/Endpoint. - @param Value Request Value. - @param Target Request Index. - - @retval EFI_SUCCESS Usb feature is cleared successfully. - @retval EFI_DEVICE_ERROR Cannot clear the usb feature due to a hardware= error. - @retval Others Other failure occurs. =20 -**/ -EFI_STATUS -PeiUsbClearDeviceFeature ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN EFI_USB_RECIPIENT Recipient, - IN UINT16 Value, - IN UINT16 Target - ) -{ - EFI_USB_DEVICE_REQUEST DevReq; - - ASSERT (UsbIoPpi !=3D NULL); - - switch (Recipient) { - case EfiUsbDevice: - DevReq.RequestType =3D USB_DEV_CLEAR_FEATURE_REQ_TYPE_D; - break; - - case EfiUsbInterface: - DevReq.RequestType =3D USB_DEV_CLEAR_FEATURE_REQ_TYPE_I; - break; - - case EfiUsbEndpoint: - DevReq.RequestType =3D USB_DEV_CLEAR_FEATURE_REQ_TYPE_E; - break; - } - - DevReq.Request =3D USB_DEV_CLEAR_FEATURE; - DevReq.Value =3D Value; - DevReq.Index =3D Target; - DevReq.Length =3D 0; - - return UsbIoPpi->UsbControlTransfer ( - PeiServices, - UsbIoPpi, - &DevReq, - EfiUsbNoData, - PcdGet32 (PcdUsbTransferTimeoutValue), - NULL, - 0 - ); -} =20 /** Configure a usb device to Configuration 1. @@ -244,26 +189,4 @@ PeiUsbGetDeviceSpeed ( } } =20 -/** - Judge if the port is in "connection change" status or not. - - @param PortChangeStatus The usb port change status gotten. - - @retval TRUE The port is in "connection change" status. - @retval FALSE The port is NOT in "connection change" status. =20 -**/ -BOOLEAN -IsPortConnectChange ( - IN UINT16 PortChangeStatus - ) -{ - // - // return the bit 0 value of PortChangeStatus - // - if ((PortChangeStatus & USB_PORT_STAT_C_CONNECTION) !=3D 0) { - return TRUE; - } else { - return FALSE; - } -} diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h b/MdeModulePkg/Bus/= Usb/UsbBusPei/PeiUsbLib.h index 35f47a35ec..e3afee6e84 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h @@ -148,28 +148,6 @@ PeiUsbSetDeviceAddress ( IN UINT16 AddressValue ); =20 -/** - Clear a given usb feature. - - @param PeiServices General-purpose services that are available to= every PEIM. - @param UsbIoPpi Indicates the PEI_USB_IO_PPI instance. - @param Recipient The recipient of ClearFeature Request, should = be one of Device/Interface/Endpoint. - @param Value Request Value. - @param Target Request Index. - - @retval EFI_SUCCESS Usb feature is cleared successfully. - @retval EFI_DEVICE_ERROR Cannot clear the usb feature due to a hardware= error. - @retval Others Other failure occurs. - -**/ -EFI_STATUS -PeiUsbClearDeviceFeature ( - IN EFI_PEI_SERVICES **PeiServices, - IN PEI_USB_IO_PPI *UsbIoPpi, - IN EFI_USB_RECIPIENT Recipient, - IN UINT16 Value, - IN UINT16 Target - ); =20 /** Configure a usb device to Configuration 1. @@ -215,17 +193,4 @@ PeiUsbGetDeviceSpeed ( IN UINT16 PortStatus ); =20 -/** - Judge if the port is in "connection change" status or not. - - @param PortChangeStatus The usb port change status gotten. - - @retval TRUE The port is in "connection change" status. - @retval FALSE The port is NOT in "connection change" status. - -**/ -BOOLEAN -IsPortConnectChange ( - IN UINT16 PortChangeStatus - ); #endif diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMai= n.h index 7ec82388a3..8f0b28d095 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -2178,19 +2178,6 @@ CoreDisplayDiscoveredNotDispatched ( ); =20 =20 -/** - Place holder function until all the Boot Services and Runtime Services a= re - available. - - @return EFI_NOT_AVAILABLE_YET - -**/ -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg0 ( - VOID - ); - =20 /** Place holder function until all the Boot Services and Runtime Services a= re diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dx= e/DxeMain/DxeMain.c index fc46022c3c..312131f1c2 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -560,29 +560,6 @@ DxeMain ( =20 =20 =20 -/** - Place holder function until all the Boot Services and Runtime Services a= re - available. - - @return EFI_NOT_AVAILABLE_YET - -**/ -EFI_STATUS -EFIAPI -CoreEfiNotAvailableYetArg0 ( - VOID - ) -{ - // - // This function should never be executed. If it does, then the archite= ctural protocols - // have not been designed correctly. The CpuBreakpoint () is commented = out for now until the - // DXE Core and all the Architectural Protocols are complete. - // - - return EFI_NOT_AVAILABLE_YET; -} - - /** Place holder function until all the Boot Services and Runtime Services a= re available. diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/= Mem/HeapGuard.c index 447c56bb11..663f969c0d 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -443,51 +443,6 @@ GetGuardMapBit ( return 0; } =20 -/** - Set the bit in bitmap table for the given address. - - @param[in] Address The address to set for. - - @return VOID. -**/ -VOID -EFIAPI -SetGuardMapBit ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - UINT64 *GuardMap; - UINT64 BitMask; - - FindGuardedMemoryMap (Address, TRUE, &GuardMap); - if (GuardMap !=3D NULL) { - BitMask =3D LShiftU64 (1, GUARDED_HEAP_MAP_ENTRY_BIT_INDEX (Address)); - *GuardMap |=3D BitMask; - } -} - -/** - Clear the bit in bitmap table for the given address. - - @param[in] Address The address to clear for. - - @return VOID. -**/ -VOID -EFIAPI -ClearGuardMapBit ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - UINT64 *GuardMap; - UINT64 BitMask; - - FindGuardedMemoryMap (Address, TRUE, &GuardMap); - if (GuardMap !=3D NULL) { - BitMask =3D LShiftU64 (1, GUARDED_HEAP_MAP_ENTRY_BIT_INDEX (Address)); - *GuardMap &=3D ~BitMask; - } -} =20 /** Check to see if the page at the given address is a Guard page or not. @@ -514,39 +469,6 @@ IsGuardPage ( return ((BitMap =3D=3D BIT0) || (BitMap =3D=3D BIT2) || (BitMap =3D=3D (= BIT2 | BIT0))); } =20 -/** - Check to see if the page at the given address is a head Guard page or no= t. - - @param[in] Address The address to check for - - @return TRUE The page at Address is a head Guard page - @return FALSE The page at Address is not a head Guard page -**/ -BOOLEAN -EFIAPI -IsHeadGuard ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - return (GetGuardedMemoryBits (Address, 2) =3D=3D BIT1); -} - -/** - Check to see if the page at the given address is a tail Guard page or no= t. - - @param[in] Address The address to check for. - - @return TRUE The page at Address is a tail Guard page. - @return FALSE The page at Address is not a tail Guard page. -**/ -BOOLEAN -EFIAPI -IsTailGuard ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - return (GetGuardedMemoryBits (Address - EFI_PAGE_SIZE, 2) =3D=3D BIT0); -} =20 /** Check to see if the page at the given address is guarded or not. diff --git a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c b/MdeModulePkg/Core/Pi= SmmCore/HeapGuard.c index d9e54b96cb..f7ae9ae286 100644 --- a/MdeModulePkg/Core/PiSmmCore/HeapGuard.c +++ b/MdeModulePkg/Core/PiSmmCore/HeapGuard.c @@ -455,51 +455,6 @@ GetGuardMapBit ( return 0; } =20 -/** - Set the bit in bitmap table for the given address. - - @param[in] Address The address to set for. - - @return VOID. -**/ -VOID -EFIAPI -SetGuardMapBit ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - UINT64 *GuardMap; - UINT64 BitMask; - - FindGuardedMemoryMap (Address, TRUE, &GuardMap); - if (GuardMap !=3D NULL) { - BitMask =3D LShiftU64 (1, GUARDED_HEAP_MAP_ENTRY_BIT_INDEX (Address)); - *GuardMap |=3D BitMask; - } -} - -/** - Clear the bit in bitmap table for the given address. - - @param[in] Address The address to clear for. - - @return VOID. -**/ -VOID -EFIAPI -ClearGuardMapBit ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - UINT64 *GuardMap; - UINT64 BitMask; - - FindGuardedMemoryMap (Address, TRUE, &GuardMap); - if (GuardMap !=3D NULL) { - BitMask =3D LShiftU64 (1, GUARDED_HEAP_MAP_ENTRY_BIT_INDEX (Address)); - *GuardMap &=3D ~BitMask; - } -} =20 /** Check to see if the page at the given address is a Guard page or not. @@ -526,39 +481,7 @@ IsGuardPage ( return ((BitMap =3D=3D BIT0) || (BitMap =3D=3D BIT2) || (BitMap =3D=3D (= BIT2 | BIT0))); } =20 -/** - Check to see if the page at the given address is a head Guard page or no= t. =20 - @param[in] Address The address to check for. - - @return TRUE The page at Address is a head Guard page. - @return FALSE The page at Address is not a head Guard page. -**/ -BOOLEAN -EFIAPI -IsHeadGuard ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - return (GetGuardedMemoryBits (Address, 2) =3D=3D BIT1); -} - -/** - Check to see if the page at the given address is a tail Guard page or no= t. - - @param[in] Address The address to check for. - - @return TRUE The page at Address is a tail Guard page. - @return FALSE The page at Address is not a tail Guard page. -**/ -BOOLEAN -EFIAPI -IsTailGuard ( - IN EFI_PHYSICAL_ADDRESS Address - ) -{ - return (GetGuardedMemoryBits (Address - EFI_PAGE_SIZE, 2) =3D=3D BIT0); -} =20 /** Check to see if the page at the given address is guarded or not. @@ -864,66 +787,7 @@ UnsetGuardForMemory ( ClearGuardedMemoryBits(Memory, NumberOfPages); } =20 -/** - Adjust address of free memory according to existing and/or required Guar= d. - - This function will check if there're existing Guard pages of adjacent - memory blocks, and try to use it as the Guard page of the memory to be - allocated. =20 - @param[in] Start Start address of free memory block. - @param[in] Size Size of free memory block. - @param[in] SizeRequested Size of memory to allocate. - - @return The end address of memory block found. - @return 0 if no enough space for the required size of memory and its Gua= rd. -**/ -UINT64 -AdjustMemoryS ( - IN UINT64 Start, - IN UINT64 Size, - IN UINT64 SizeRequested - ) -{ - UINT64 Target; - - // - // UEFI spec requires that allocated pool must be 8-byte aligned. If it's - // indicated to put the pool near the Tail Guard, we need extra bytes to - // make sure alignment of the returned pool address. - // - if ((PcdGet8 (PcdHeapGuardPropertyMask) & BIT7) =3D=3D 0) { - SizeRequested =3D ALIGN_VALUE(SizeRequested, 8); - } - - Target =3D Start + Size - SizeRequested; - ASSERT (Target >=3D Start); - if (Target =3D=3D 0) { - return 0; - } - - if (!IsGuardPage (Start + Size)) { - // No Guard at tail to share. One more page is needed. - Target -=3D EFI_PAGES_TO_SIZE (1); - } - - // Out of range? - if (Target < Start) { - return 0; - } - - // At the edge? - if (Target =3D=3D Start) { - if (!IsGuardPage (Target - EFI_PAGES_TO_SIZE (1))) { - // No enough space for a new head Guard if no Guard at head to share. - return 0; - } - } - - // OK, we have enough pages for memory and its Guards. Return the End of= the - // free space. - return Target + SizeRequested - 1; -} =20 /** Adjust the start address and number of pages to free according to Guard. @@ -1049,36 +913,6 @@ AdjustMemoryF ( *NumberOfPages =3D PagesToFree; } =20 -/** - Adjust the base and number of pages to really allocate according to Guar= d. - - @param[in,out] Memory Base address of free memory. - @param[in,out] NumberOfPages Size of memory to allocate. - - @return VOID. -**/ -VOID -AdjustMemoryA ( - IN OUT EFI_PHYSICAL_ADDRESS *Memory, - IN OUT UINTN *NumberOfPages - ) -{ - // - // FindFreePages() has already taken the Guard into account. It's safe to - // adjust the start address and/or number of pages here, to make sure th= at - // the Guards are also "allocated". - // - if (!IsGuardPage (*Memory + EFI_PAGES_TO_SIZE (*NumberOfPages))) { - // No tail Guard, add one. - *NumberOfPages +=3D 1; - } - - if (!IsGuardPage (*Memory - EFI_PAGE_SIZE)) { - // No head Guard, add one. - *Memory -=3D EFI_PAGE_SIZE; - *NumberOfPages +=3D 1; - } -} =20 /** Adjust the pool head position to make sure the Guard page is adjavent to diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c b/MdeModul= ePkg/Core/PiSmmCore/MemoryAttributesTable.c index 36ccf65fa3..1682d0f9e4 100644 --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c @@ -114,34 +114,6 @@ EfiSizeToPages ( return RShiftU64 (Size, EFI_PAGE_SHIFT) + ((((UINTN)Size) & EFI_PAGE_MAS= K) ? 1 : 0); } =20 -/** - Check the consistency of Smm memory attributes table. - - @param[in] MemoryAttributesTable PI SMM memory attributes table -**/ -VOID -SmmMemoryAttributesTableConsistencyCheck ( - IN EDKII_PI_SMM_MEMORY_ATTRIBUTES_TABLE *MemoryAttributesTable - ) -{ - EFI_MEMORY_DESCRIPTOR *MemoryMap; - UINTN MemoryMapEntryCount; - UINTN DescriptorSize; - UINTN Index; - UINT64 Address; - - Address =3D 0; - MemoryMapEntryCount =3D MemoryAttributesTable->NumberOfEntries; - DescriptorSize =3D MemoryAttributesTable->DescriptorSize; - MemoryMap =3D (EFI_MEMORY_DESCRIPTOR *)(MemoryAttributesTable + 1); - for (Index =3D 0; Index < MemoryMapEntryCount; Index++) { - if (Address !=3D 0) { - ASSERT (Address =3D=3D MemoryMap->PhysicalStart); - } - Address =3D MemoryMap->PhysicalStart + EfiPagesToSize(MemoryMap->Numbe= rOfPages); - MemoryMap =3D NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize); - } -} =20 /** Sort memory map entries based upon PhysicalStart, from low to high. @@ -1224,85 +1196,6 @@ Finish: return ; } =20 -/** - Find image record according to image base and size. - - @param[in] ImageBase Base of PE image - @param[in] ImageSize Size of PE image - - @return image record -**/ -STATIC -IMAGE_PROPERTIES_RECORD * -FindImageRecord ( - IN EFI_PHYSICAL_ADDRESS ImageBase, - IN UINT64 ImageSize - ) -{ - IMAGE_PROPERTIES_RECORD *ImageRecord; - LIST_ENTRY *ImageRecordLink; - LIST_ENTRY *ImageRecordList; - - ImageRecordList =3D &mImagePropertiesPrivateData.ImageRecordList; - - for (ImageRecordLink =3D ImageRecordList->ForwardLink; - ImageRecordLink !=3D ImageRecordList; - ImageRecordLink =3D ImageRecordLink->ForwardLink) { - ImageRecord =3D CR ( - ImageRecordLink, - IMAGE_PROPERTIES_RECORD, - Link, - IMAGE_PROPERTIES_RECORD_SIGNATURE - ); - - if ((ImageBase =3D=3D ImageRecord->ImageBase) && - (ImageSize =3D=3D ImageRecord->ImageSize)) { - return ImageRecord; - } - } - - return NULL; -} - -/** - Remove Image record. - - @param[in] DriverEntry Driver information -**/ -VOID -SmmRemoveImageRecord ( - IN EFI_SMM_DRIVER_ENTRY *DriverEntry - ) -{ - IMAGE_PROPERTIES_RECORD *ImageRecord; - LIST_ENTRY *CodeSegmentListHead; - IMAGE_PROPERTIES_RECORD_CODE_SECTION *ImageRecordCodeSection; - - DEBUG ((DEBUG_VERBOSE, "SMM RemoveImageRecord - 0x%x\n", DriverEntry)); - DEBUG ((DEBUG_VERBOSE, "SMM RemoveImageRecord - 0x%016lx - 0x%016lx\n", = DriverEntry->ImageBuffer, DriverEntry->NumberOfPage)); - - ImageRecord =3D FindImageRecord (DriverEntry->ImageBuffer, EfiPagesToSiz= e(DriverEntry->NumberOfPage)); - if (ImageRecord =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "SMM !!!!!!!! ImageRecord not found !!!!!!!!\n")); - return ; - } - - CodeSegmentListHead =3D &ImageRecord->CodeSegmentList; - while (!IsListEmpty (CodeSegmentListHead)) { - ImageRecordCodeSection =3D CR ( - CodeSegmentListHead->ForwardLink, - IMAGE_PROPERTIES_RECORD_CODE_SECTION, - Link, - IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNAT= URE - ); - RemoveEntryList (&ImageRecordCodeSection->Link); - FreePool (ImageRecordCodeSection); - } - - RemoveEntryList (&ImageRecord->Link); - FreePool (ImageRecord); - mImagePropertiesPrivateData.ImageRecordCount--; -} =20 /** Publish MemoryAttributesTable to SMM configuration table. @@ -1386,30 +1279,6 @@ PublishMemoryAttributesTable ( ASSERT_EFI_ERROR (Status); } =20 -/** - This function returns if image is inside SMRAM. - - @param[in] LoadedImage LoadedImage protocol instance for an image. - - @retval TRUE the image is inside SMRAM. - @retval FALSE the image is outside SMRAM. -**/ -BOOLEAN -IsImageInsideSmram ( - IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage - ) -{ - UINTN Index; - - for (Index =3D 0; Index < mFullSmramRangeCount; Index++) { - if ((mFullSmramRanges[Index].PhysicalStart <=3D (UINTN)LoadedImage->Im= ageBase)&& - (mFullSmramRanges[Index].PhysicalStart + mFullSmramRanges[Index].P= hysicalSize >=3D (UINTN)LoadedImage->ImageBase + LoadedImage->ImageSize)) { - return TRUE; - } - } - - return FALSE; -} =20 /** This function installs all SMM image record information. diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c b/MdeModulePkg/Core/PiSmmCo= re/Page.c index 3699af7424..cd7d7ece0c 100644 --- a/MdeModulePkg/Core/PiSmmCore/Page.c +++ b/MdeModulePkg/Core/PiSmmCore/Page.c @@ -451,128 +451,7 @@ GetSmmMemoryMapEntryCount ( return Count; } =20 -/** - Dump Smm memory map entry. -**/ -VOID -DumpSmmMemoryMapEntry ( - VOID - ) -{ - LIST_ENTRY *Link; - MEMORY_MAP *Entry; - EFI_PHYSICAL_ADDRESS Last; - - Last =3D 0; - DEBUG ((DEBUG_INFO, "DumpSmmMemoryMapEntry:\n")); - Link =3D gMemoryMap.ForwardLink; - while (Link !=3D &gMemoryMap) { - Entry =3D CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE); - Link =3D Link->ForwardLink; - - if ((Last !=3D 0) && (Last !=3D (UINT64)-1)) { - if (Last + 1 !=3D Entry->Start) { - Last =3D (UINT64)-1; - } else { - Last =3D Entry->End; - } - } else if (Last =3D=3D 0) { - Last =3D Entry->End; - } - - DEBUG ((DEBUG_INFO, "Entry (Link - 0x%x)\n", &Entry->Link)); - DEBUG ((DEBUG_INFO, " Signature - 0x%x\n", Entry->Signature)); - DEBUG ((DEBUG_INFO, " Link.ForwardLink - 0x%x\n", Entry->Link.Forwar= dLink)); - DEBUG ((DEBUG_INFO, " Link.BackLink - 0x%x\n", Entry->Link.BackLi= nk)); - DEBUG ((DEBUG_INFO, " Type - 0x%x\n", Entry->Type)); - DEBUG ((DEBUG_INFO, " Start - 0x%016lx\n", Entry->Start)); - DEBUG ((DEBUG_INFO, " End - 0x%016lx\n", Entry->End)); - } - - ASSERT (Last !=3D (UINT64)-1); -} - -/** - Dump Smm memory map. -**/ -VOID -DumpSmmMemoryMap ( - VOID - ) -{ - LIST_ENTRY *Node; - FREE_PAGE_LIST *Pages; - - DEBUG ((DEBUG_INFO, "DumpSmmMemoryMap\n")); - - Pages =3D NULL; - Node =3D mSmmMemoryMap.ForwardLink; - while (Node !=3D &mSmmMemoryMap) { - Pages =3D BASE_CR (Node, FREE_PAGE_LIST, Link); - DEBUG ((DEBUG_INFO, "Pages - 0x%x\n", Pages)); - DEBUG ((DEBUG_INFO, "Pages->NumberOfPages - 0x%x\n", Pages->NumberOfPa= ges)); - Node =3D Node->ForwardLink; - } -} =20 -/** - Check if a Smm base~length is in Smm memory map. - - @param[in] Base The base address of Smm memory to be checked. - @param[in] Length THe length of Smm memory to be checked. - - @retval TRUE Smm base~length is in smm memory map. - @retval FALSE Smm base~length is in smm memory map. -**/ -BOOLEAN -SmmMemoryMapConsistencyCheckRange ( - IN EFI_PHYSICAL_ADDRESS Base, - IN UINTN Length - ) -{ - LIST_ENTRY *Link; - MEMORY_MAP *Entry; - BOOLEAN Result; - - Result =3D FALSE; - Link =3D gMemoryMap.ForwardLink; - while (Link !=3D &gMemoryMap) { - Entry =3D CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE); - Link =3D Link->ForwardLink; - - if (Entry->Type !=3D EfiConventionalMemory) { - continue; - } - if (Entry->Start =3D=3D Base && Entry->End =3D=3D Base + Length - 1) { - Result =3D TRUE; - break; - } - } - - return Result; -} - -/** - Check the consistency of Smm memory map. -**/ -VOID -SmmMemoryMapConsistencyCheck ( - VOID - ) -{ - LIST_ENTRY *Node; - FREE_PAGE_LIST *Pages; - BOOLEAN Result; - - Pages =3D NULL; - Node =3D mSmmMemoryMap.ForwardLink; - while (Node !=3D &mSmmMemoryMap) { - Pages =3D BASE_CR (Node, FREE_PAGE_LIST, Link); - Result =3D SmmMemoryMapConsistencyCheckRange ((EFI_PHYSICAL_ADDRESS)(U= INTN)Pages, (UINTN)EFI_PAGES_TO_SIZE(Pages->NumberOfPages)); - ASSERT (Result); - Node =3D Node->ForwardLink; - } -} =20 /** Internal Function. Allocate n pages from given free page node. diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeMod= ulePkg/Universal/Console/TerminalDxe/Terminal.h index a4543fc8de..84808d55a0 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -1131,18 +1131,6 @@ IsUnicodeFiFoFull ( TERMINAL_DEV *TerminalDevice ); =20 -/** - Count Unicode FIFO buffer. - - @param TerminalDevice Terminal driver private structure - - @return The count in bytes of Unicode FIFO. - -**/ -UINT8 -UnicodeFiFoGetKeyCount ( - TERMINAL_DEV *TerminalDevice - ); =20 /** Translate raw data into Unicode (according to different encode), and diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/M= deModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 80c4f6b483..33f9b6e585 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -1200,31 +1200,6 @@ IsUnicodeFiFoFull ( return FALSE; } =20 -/** - Count Unicode FIFO buffer. - - @param TerminalDevice Terminal driver private structure - - @return The count in bytes of Unicode FIFO. - -**/ -UINT8 -UnicodeFiFoGetKeyCount ( - TERMINAL_DEV *TerminalDevice - ) -{ - UINT8 Tail; - UINT8 Head; - - Tail =3D TerminalDevice->UnicodeFiFo->Tail; - Head =3D TerminalDevice->UnicodeFiFo->Head; - - if (Tail >=3D Head) { - return (UINT8) (Tail - Head); - } else { - return (UINT8) (Tail + FIFO_MAX_NUMBER + 1 - Head); - } -} =20 /** Update the Unicode characters from a terminal input device into EFI Keys= FIFO. diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeMod= ulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index c778cd92f8..39e1811e69 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -3590,53 +3590,6 @@ Done: return Status; } =20 -/** - Get Data buffer size based on data type. - - @param ValueType The input data type. - - @retval The data buffer size for the input type. -**/ -UINT16 -GetStorageWidth ( - IN UINT8 ValueType - ) -{ - UINT16 StorageWidth; - - switch (ValueType) { - case EFI_IFR_NUMERIC_SIZE_1: - case EFI_IFR_TYPE_BOOLEAN: - StorageWidth =3D (UINT16) sizeof (UINT8); - break; - - case EFI_IFR_NUMERIC_SIZE_2: - StorageWidth =3D (UINT16) sizeof (UINT16); - break; - - case EFI_IFR_NUMERIC_SIZE_4: - StorageWidth =3D (UINT16) sizeof (UINT32); - break; - - case EFI_IFR_NUMERIC_SIZE_8: - StorageWidth =3D (UINT16) sizeof (UINT64); - break; - - case EFI_IFR_TYPE_TIME: - StorageWidth =3D (UINT16) sizeof (EFI_IFR_TIME); - break; - - case EFI_IFR_TYPE_DATE: - StorageWidth =3D (UINT16) sizeof (EFI_IFR_DATE); - break; - - default: - StorageWidth =3D 0; - break; - } - - return StorageWidth; -} =20 /** Update the default value in the block data which is used as bit var stor= e. diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModu= lePkg/Universal/Network/IScsiDxe/IScsiProto.c index 9fb848080a..b4a5c2d024 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c @@ -1738,37 +1738,6 @@ IScsiDelTcb ( FreePool (Tcb); } =20 -/** - Find the task control block by the initator task tag. - - @param[in] TcbList The tcb list. - @param[in] InitiatorTaskTag The initiator task tag. - - @return The task control block found. -**/ -ISCSI_TCB * -IScsiFindTcbByITT ( - IN LIST_ENTRY *TcbList, - IN UINT32 InitiatorTaskTag - ) -{ - ISCSI_TCB *Tcb; - LIST_ENTRY *Entry; - - Tcb =3D NULL; - - NET_LIST_FOR_EACH (Entry, TcbList) { - Tcb =3D NET_LIST_USER_STRUCT (Entry, ISCSI_TCB, Link); - - if (Tcb->InitiatorTaskTag =3D=3D InitiatorTaskTag) { - break; - } - - Tcb =3D NULL; - } - - return Tcb; -} =20 /** Create a data segment, pad it and calculate the CRC if needed. diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeMo= dulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c index 043341d6e9..c19a72730e 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c @@ -1628,22 +1628,6 @@ Ip4Config2InitIfInfo ( CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAd= dressSize); } =20 -/** - The event handle routine when DHCPv4 process is finished or is updated. - - @param[in] Event Not used. - @param[in] Context The pointer to the IP4 configuration instan= ce data. - -**/ -VOID -EFIAPI -Ip4Config2OnDhcp4Event ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - return ; -} =20 =20 /** diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModuleP= kg/Universal/Network/Tcp4Dxe/SockImpl.c index 0476077c20..adb5aa35cd 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c @@ -1107,41 +1107,6 @@ SockGetFreeSpace ( } =20 =20 -/** - Signal the receive token with the specific error or - set socket error code after error is received. - - @param Sock Pointer to the socket. - @param Error The error code received. - -**/ -VOID -SockRcvdErr ( - IN OUT SOCKET *Sock, - IN EFI_STATUS Error - ) -{ - SOCK_TOKEN *SockToken; - - if (!IsListEmpty (&Sock->RcvTokenList)) { - - SockToken =3D NET_LIST_HEAD ( - &Sock->RcvTokenList, - SOCK_TOKEN, - TokenList - ); - - RemoveEntryList (&SockToken->TokenList); - - SIGNAL_TOKEN (SockToken->Token, Error); - - FreePool (SockToken); - } else { - - SOCK_ERROR (Sock, Error); - } -} - =20 /** Called by the low layer protocol to indicate that there will be no more = data diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeMo= dulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index 6dbabc4e51..cd20b8bcb2 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -938,48 +938,7 @@ SockGetMode ( } =20 =20 -/** - Configure the low level protocol to join a multicast group for - this socket's connection. - - @param Sock Pointer to the socket of the connection to = join the - specific multicast group. - @param GroupInfo Pointer to the multicast group info. - - @retval EFI_SUCCESS The configuration is done successfully. - @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket. - @retval EFI_NOT_STARTED The socket is not configured. - -**/ -EFI_STATUS -SockGroup ( - IN SOCKET *Sock, - IN VOID *GroupInfo - ) -{ - EFI_STATUS Status; - - Status =3D EfiAcquireLockOrFail (&(Sock->Lock)); - - if (EFI_ERROR (Status)) { =20 - DEBUG ((EFI_D_ERROR, "SockGroup: Get the access for socket" - " failed with %r", Status)); - - return EFI_ACCESS_DENIED; - } - - if (SOCK_IS_UNCONFIGURED (Sock)) { - Status =3D EFI_NOT_STARTED; - goto Exit; - } - - Status =3D Sock->ProtoHandler (Sock, SOCK_GROUP, GroupInfo); - -Exit: - EfiReleaseLock (&(Sock->Lock)); - return Status; -} =20 =20 /** diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg= /Universal/Network/Tcp4Dxe/Socket.h index 7ff2fc565e..650a7dd865 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h @@ -550,19 +550,6 @@ SockClone ( IN SOCKET *Sock ); =20 -/** - Signal the receive token with the specific error or - set socket error code after error is received. - - @param Sock Pointer to the socket. - @param Error The error code received. - -**/ -VOID -SockRcvdErr ( - IN OUT SOCKET *Sock, - IN EFI_STATUS Error - ); =20 /// /// Proto type of the create callback @@ -909,25 +896,6 @@ SockGetMode ( IN OUT VOID *Mode ); =20 -/** - Configure the low level protocol to join a multicast group for - this socket's connection. - - @param Sock Pointer to the socket of the connection to = join the - specific multicast group. - @param GroupInfo Pointer to the multicast group info. - - @retval EFI_SUCCESS The configuration is done successfully. - @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket. - @retval EFI_NOT_STARTED The socket is not configured. - -**/ -EFI_STATUS -SockGroup ( - IN SOCKET *Sock, - IN VOID *GroupInfo - ); - /** Add or remove route information in IP route table associated with this socket. diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c b/MdeModul= ePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c index 2817b80295..e84310f6c6 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c @@ -350,31 +350,3 @@ TcpParseOption ( } =20 =20 -/** - Check the segment against PAWS. - - @param Tcb Pointer to the TCP_CB of this TCP instance. - @param TSVal The timestamp value. - - @retval 1 The segment passed the PAWS check. - @retval 0 The segment failed to pass the PAWS check. - -**/ -UINT32 -TcpPawsOK ( - IN TCP_CB *Tcb, - IN UINT32 TSVal - ) -{ - // - // PAWS as defined in RFC1323, buggy... - // - if (TCP_TIME_LT (TSVal, Tcb->TsRecent) && - TCP_TIME_LT (Tcb->TsRecentAge + TCP_PAWS_24DAY, mTcpTick)) { - - return 0; - - } - - return 1; -} diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h b/MdeModul= ePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h index 5185aecea8..f9782cb598 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h @@ -126,20 +126,5 @@ TcpParseOption ( IN OUT TCP_OPTION *Option ); =20 -/** - Check the segment against PAWS. - - @param Tcb Pointer to the TCP_CB of this TCP instance. - @param TSVal The timestamp value. - - @retval 1 The segment passed the PAWS check. - @retval 0 The segment failed to pass the PAWS check. - -**/ -UINT32 -TcpPawsOK ( - IN TCP_CB *Tcb, - IN UINT32 TSVal - ); =20 #endif diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModuleP= kg/Universal/SetupBrowserDxe/IfrParse.c index 3d28e7aa50..042bd4b30d 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -452,39 +452,6 @@ IntializeBrowserStorage ( } } =20 -/** - Check whether exist device path info in the ConfigHdr string. - - @param String UEFI configuration string - - @retval TRUE Device Path exist. - @retval FALSE Not exist device path info. - -**/ -BOOLEAN -IsDevicePathExist ( - IN EFI_STRING String - ) -{ - UINTN Length; - - for (; (*String !=3D 0 && StrnCmp (String, L"PATH=3D", StrLen (L"PATH=3D= ")) !=3D 0); String++); - if (*String =3D=3D 0) { - return FALSE; - } - - String +=3D StrLen (L"PATH=3D"); - if (*String =3D=3D 0) { - return FALSE; - } - - for (Length =3D 0; *String !=3D 0 && *String !=3D L'&'; String++, Length= ++); - if (((Length + 1) / 2) < sizeof (EFI_DEVICE_PATH_PROTOCOL)) { - return FALSE; - } - - return TRUE; -} =20 /** Allocate a FORMSET_STORAGE data structure and insert to FormSet Storage = List. --=20 2.18.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel