From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=jordan.l.justen@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 0F54121F2E108 for ; Tue, 10 Apr 2018 11:27:26 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 11:26:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,433,1517904000"; d="scan'208";a="219337134" Received: from jlmillig-mobl.amr.corp.intel.com (HELO localhost) ([10.254.47.69]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2018 11:26:45 -0700 MIME-Version: 1.0 To: Laszlo Ersek , edk2-devel-01 Message-ID: <152338480498.26190.3275925878177025934@jljusten-skl> From: Jordan Justen In-Reply-To: <20180410180950.16343-1-lersek@redhat.com> Cc: Ard Biesheuvel , Steven Shi References: <20180410180950.16343-1-lersek@redhat.com> User-Agent: alot/0.7 Date: Tue, 10 Apr 2018 11:26:45 -0700 Subject: Re: [PATCH] OvmfPkg: remove BLOCK_MMIO_PROTOCOL and BlockMmioToBlockIoDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2018 18:27:27 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jordan Justen On 2018-04-10 11:09:50, Laszlo Ersek wrote: > BLOCK_MMIO_PROTOCOL and BlockMmioToBlockIoDxe were introduced to OvmfPkg > in March 2010, in adjacent commits b0f5144676fa and efd82c5794ec. In the > past eight years, no driver or application seems to have materialized that > produced BLOCK_MMIO_PROTOCOL instances. Meanwhile the UEFI spec has > developed the EFI_RAM_DISK_PROTOCOL, which edk2 implements (and OVMF > includes) as RamDiskDxe. > = > Rather than fixing issues in the unused BlockMmioToBlockIoDxe driver, > remove the driver, together with the BLOCK_MMIO_PROTOCOL definition that > now becomes unused too. > = > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Steven Shi > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D926 > Reported-by: Steven Shi > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- > = > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: drop_blkmmio > = > OvmfPkg/OvmfPkg.dec | 1 - > OvmfPkg/OvmfPkgIa32.dsc | 1 - > OvmfPkg/OvmfPkgIa32X64.dsc | 1 - > OvmfPkg/OvmfPkgX64.dsc | 1 - > OvmfPkg/OvmfPkgIa32.fdf | 1 - > OvmfPkg/OvmfPkgIa32X64.fdf | 1 - > OvmfPkg/OvmfPkgX64.fdf | 1 - > OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf | 56 --- > OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.h | 346 ------------- > OvmfPkg/Include/Protocol/BlockMmio.h | 50 -- > OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c | 528 -------------------- > OvmfPkg/BlockMmioToBlockIoDxe/ComponentName.c | 162 ------ > 12 files changed, 1149 deletions(-) > = > diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec > index 27bcfc141e5a..c01a2ca7219a 100644 > --- a/OvmfPkg/OvmfPkg.dec > +++ b/OvmfPkg/OvmfPkg.dec > @@ -66,7 +66,6 @@ [Guids] > = > [Protocols] > gVirtioDeviceProtocolGuid =3D {0xfa920010, 0x6785, 0x4941, {= 0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}} > - gBlockMmioProtocolGuid =3D {0x6b558ce3, 0x69e5, 0x4c67, {= 0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}} > gXenBusProtocolGuid =3D {0x3d3ca290, 0xb9a5, 0x11e3, {= 0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}} > gXenIoProtocolGuid =3D {0x6efac84f, 0x0ab0, 0x4747, {= 0x81, 0xbe, 0x85, 0x55, 0x62, 0x59, 0x04, 0x49}} > gIoMmuAbsentProtocolGuid =3D {0xf8775d50, 0x8abd, 0x4adf, {= 0x92, 0xac, 0x85, 0x3e, 0x51, 0xf6, 0xc8, 0xdc}} > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > index c9eb248506c5..2d6c4c4615b6 100644 > --- a/OvmfPkg/OvmfPkgIa32.dsc > +++ b/OvmfPkg/OvmfPkgIa32.dsc > @@ -698,7 +698,6 @@ [Components] > NULL|IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBo= otMaintUiLib.inf > !endif > } > - OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > OvmfPkg/Virtio10Dxe/Virtio10.inf > OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc > index 17aef2d4830f..43158c5f0627 100644 > --- a/OvmfPkg/OvmfPkgIa32X64.dsc > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc > @@ -707,7 +707,6 @@ [Components.X64] > NULL|IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBo= otMaintUiLib.inf > !endif > } > - OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > OvmfPkg/Virtio10Dxe/Virtio10.inf > OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 8af763ea9e9e..d1fdf7c307c2 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -705,7 +705,6 @@ [Components] > NULL|IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBo= otMaintUiLib.inf > !endif > } > - OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > OvmfPkg/Virtio10Dxe/Virtio10.inf > OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf > index 938bf7195ec4..0427ded49239 100644 > --- a/OvmfPkg/OvmfPkgIa32.fdf > +++ b/OvmfPkg/OvmfPkgIa32.fdf > @@ -225,7 +225,6 @@ [FV.DXEFV] > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntime= Dxe.inf > = > -INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > INF OvmfPkg/Virtio10Dxe/Virtio10.inf > INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf > index 246e1dc8278a..6df47f48cd2c 100644 > --- a/OvmfPkg/OvmfPkgIa32X64.fdf > +++ b/OvmfPkg/OvmfPkgIa32X64.fdf > @@ -226,7 +226,6 @@ [FV.DXEFV] > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntime= Dxe.inf > = > -INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > INF OvmfPkg/Virtio10Dxe/Virtio10.inf > INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf > index 1a46104fc63d..2e2a1749b5d2 100644 > --- a/OvmfPkg/OvmfPkgX64.fdf > +++ b/OvmfPkg/OvmfPkgX64.fdf > @@ -226,7 +226,6 @@ [FV.DXEFV] > INF MdeModulePkg/Universal/Metronome/Metronome.inf > INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntime= Dxe.inf > = > -INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > INF OvmfPkg/Virtio10Dxe/Virtio10.inf > INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf b/OvmfPkg/BlockMmi= oToBlockIoDxe/BlockIo.inf > deleted file mode 100644 > index e2f5bb8a6888..000000000000 > --- a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf > +++ /dev/null > @@ -1,56 +0,0 @@ > -## @file > -# The driver wrappers BlockMmio protocol instances to produce > -# Block I/O Protocol instances. > -# > -# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
> -# > -# This program and the accompanying materials > -# are licensed and made available under the terms and conditions of the= BSD License > -# which accompanies this distribution. The full text of the license may= be found at > -# http://opensource.org/licenses/bsd-license.php > -# > -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. > -# > -# > -## > - > -[Defines] > - INF_VERSION =3D 0x00010005 > - BASE_NAME =3D BlockMmioToBlockIoDxe > - FILE_GUID =3D 33cb97af-6c33-4c42-986b-07581fa366d4 > - MODULE_TYPE =3D UEFI_DRIVER > - VERSION_STRING =3D 1.0 > - ENTRY_POINT =3D BlockMmioToBlockIoEntryPoint > - > -# > -# The following information is for reference only and not required by th= e build tools. > -# > -# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC > -# > - > -[Sources] > - BlockIo.c > - BlockIo.h > - ComponentName.c > - > -[Packages] > - MdePkg/MdePkg.dec > - OvmfPkg/OvmfPkg.dec > - > -[LibraryClasses] > - BaseLib > - BaseMemoryLib > - DebugLib > - DevicePathLib > - MemoryAllocationLib > - UefiBootServicesTableLib > - UefiDriverEntryPoint > - UefiLib > - > -[Protocols] > - gBlockMmioProtocolGuid ## TO_START > - gEfiCpuIo2ProtocolGuid ## TO_START > - gEfiDevicePathProtocolGuid ## TO_START > - gEfiBlockIoProtocolGuid ## BY_START > - > diff --git a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.h b/OvmfPkg/BlockMmioT= oBlockIoDxe/BlockIo.h > deleted file mode 100644 > index d33f56448ac2..000000000000 > --- a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.h > +++ /dev/null > @@ -1,346 +0,0 @@ > -/** @file > - Definitions of functions for Driver Binding Protocol and Block I/O Pro= tocol, > - and other internal definitions. > - > - Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
> - This program and the accompanying materials > - are licensed and made available under the terms and conditions of the = BSD License > - which accompanies this distribution. The full text of the license may= be found at > - http://opensource.org/licenses/bsd-license.php > - > - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > - > -**/ > - > -#ifndef _EFI_BLOCK_MMIO_TO_BLOCK_IO_H_ > -#define _EFI_BLOCK_MMIO_TO_BLOCK_IO_H_ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define BLOCK_MMIO_TO_BLOCK_IO_SIGNATURE SIGNATURE_32 ('B', 'M', 'I'= , 'O') > - > -#define PRIVATE_FROM_BLOCK_IO(a) \ > - CR (a, BLOCK_MMIO_TO_BLOCK_IO_DEVICE, BlockIo, BLOCK_MMIO_TO_BLO= CK_IO_SIGNATURE) > - > -extern EFI_COMPONENT_NAME_PROTOCOL gBlockMmioToBlockIoComponentName; > -extern EFI_COMPONENT_NAME2_PROTOCOL gBlockMmioToBlockIoComponentName2; > - > -typedef struct { > - UINT32 Signature; > - EFI_HANDLE Controller; > - BLOCK_MMIO_PROTOCOL *BlockMmio; > - EFI_CPU_IO2_PROTOCOL *CpuIo; > - EFI_DEVICE_PATH_PROTOCOL *DevicePath; > - EFI_BLOCK_IO_PROTOCOL BlockIo; > -} BLOCK_MMIO_TO_BLOCK_IO_DEVICE; > - > -// > -// Functions for Driver Binding Protocol > -// > - > -/** > - Check whether the controller is a supported. > - > - @param This The driver binding protocol. > - @param Controller The controller handle to check. > - @param RemainingDevicePath The remaining device path. > - > - @retval EFI_SUCCESS The driver supports this controller. > - @retval other This device isn't supported. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingSupported ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath > - ); > - > -/** > - Starts the BlockIo device with this driver. > - > - This function consumes Block MMIO Portocol and > - installs Block I/O Protocol. > - > - @param This The driver binding protocol. > - @param Controller The Block MMIO device to start on > - @param RemainingDevicePath The remaining device path. > - > - @retval EFI_SUCCESS This driver supports this device. > - @retval EFI_UNSUPPORTED This driver does not support this device. > - @retval EFI_DEVICE_ERROR This driver cannot be started due to dev= ice Error. > - @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources. > - @retval EFI_ALREADY_STARTED This driver has been started. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingStart ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath > - ); > - > -/** > - Stop controlling the device. > - > - @param This The driver binding > - @param Controller The device controller controlled by the= driver. > - @param NumberOfChildren The number of children of this device > - @param ChildHandleBuffer The buffer of children handle. > - > - @retval EFI_SUCCESS The driver stopped from controlling the= device. > - @retval EFI_DEVICE_ERROR The device could not be stopped due to = a device error. > - @retval EFI_UNSUPPORTED Block I/O Protocol is not installed on = Controller. > - @retval Others Failed to stop the driver > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingStop ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN UINTN NumberOfChildren, > - IN EFI_HANDLE *ChildHandleBuffer > - ); > - > -// > -// Functions for Block I/O Protocol > -// > - > -/** > - Reset the block device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.Reset(). = > - It resets the block device hardware. > - ExtendedVerification is ignored in this implementation. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param ExtendedVerification Indicates that the driver may perform a= more exhaustive > - verification operation of the device du= ring reset. > - > - @retval EFI_SUCCESS The block device was reset. > - @retval EFI_DEVICE_ERROR The block device is not functioning cor= rectly and could not be reset. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoReset ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN BOOLEAN ExtendedVerification > - ); > - > -/** > - Reads the requested number of blocks from the device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks(). = > - It reads the requested number of blocks from the device. > - All the blocks are read, or an error is returned. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param MediaId The media ID that the read request is f= or. > - @param Lba The starting logical block address to r= ead from on the device. > - @param BufferSize The size of the Buffer in bytes. > - This must be a multiple of the intrinsi= c block size of the device. > - @param Buffer A pointer to the destination buffer for= the data. The caller is > - responsible for either having implicit = or explicit ownership of the buffer. > - > - @retval EFI_SUCCESS The data was read correctly from the de= vice. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to perform the read operation. > - @retval EFI_NO_MEDIA There is no media in the device. > - @retval EFI_MEDIA_CHANGED The MediaId is not for the current medi= a. > - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multi= ple of the intrinsic block size of the device. > - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are= not valid, > - or the buffer is not on proper alignmen= t. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoReadBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN UINT32 MediaId, > - IN EFI_LBA Lba, > - IN UINTN BufferSize, > - OUT VOID *Buffer > - ); > - > -/** > - Writes a specified number of blocks to the device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks(). = > - It writes a specified number of blocks to the device. > - All blocks are written, or an error is returned. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param MediaId The media ID that the write request is = for. > - @param Lba The starting logical block address to b= e written. > - @param BufferSize The size of the Buffer in bytes. > - This must be a multiple of the intrinsi= c block size of the device. > - @param Buffer Pointer to the source buffer for the da= ta. > - > - @retval EFI_SUCCESS The data were written correctly to the = device. > - @retval EFI_WRITE_PROTECTED The device cannot be written to. > - @retval EFI_NO_MEDIA There is no media in the device. > - @retval EFI_MEDIA_CHANGED The MediaId is not for the current medi= a. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to perform the write operation. > - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multi= ple of the intrinsic > - block size of the device. > - @retval EFI_INVALID_PARAMETER The write request contains LBAs that ar= e not valid, > - or the buffer is not on proper alignmen= t. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoWriteBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN UINT32 MediaId, > - IN EFI_LBA Lba, > - IN UINTN BufferSize, > - IN VOID *Buffer > - ); > - > -/** > - Flushes all modified data to a physical block device. > - > - @param This Indicates a pointer to the calling cont= ext. > - > - @retval EFI_SUCCESS All outstanding data were written corre= ctly to the device. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to write data. > - @retval EFI_NO_MEDIA There is no media in the device. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoFlushBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This > - ); > - > -// > -// EFI Component Name Functions > -// > - > -/** > - Retrieves a Unicode string that is the user readable name of the drive= r. > - > - This function retrieves the user readable name of a driver in the form= of a > - Unicode string. If the driver specified by This has a user readable na= me in > - the language specified by Language, then a pointer to the driver name = is > - returned in DriverName, and EFI_SUCCESS is returned. If the driver spe= cified > - by This does not support the language specified by Language, > - then EFI_UNSUPPORTED is returned. > - > - @param This A pointer to the EFI_COMPONENT_NAME2_PRO= TOCOL or > - EFI_COMPONENT_NAME_PROTOCOL instance. > - @param Language A pointer to a Null-terminated ASCII str= ing > - array indicating the language. This is t= he > - language of the driver name that the cal= ler is > - requesting, and it must match one of the > - languages specified in SupportedLanguage= s. The > - number of languages supported by a drive= r is up > - to the driver writer. Language is specif= ied > - in RFC 4646 or ISO 639-2 language code f= ormat. > - @param DriverName A pointer to the Unicode string to retur= n. > - This Unicode string is the name of the > - driver specified by This in the language > - specified by Language. > - > - @retval EFI_SUCCESS The Unicode string for the Driver specif= ied by > - This and the language specified by Langu= age was > - returned in DriverName. > - @retval EFI_INVALID_PARAMETER Language is NULL. > - @retval EFI_INVALID_PARAMETER DriverName is NULL. > - @retval EFI_UNSUPPORTED The driver specified by This does not su= pport > - the language specified by Language. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockMmioToBlockIoGetDriverName ( > - IN EFI_COMPONENT_NAME_PROTOCOL *This, > - IN CHAR8 *Language, > - OUT CHAR16 **DriverName > - ); > - > - > -/** > - Retrieves a Unicode string that is the user readable name of the contr= oller > - that is being managed by a driver. > - > - This function retrieves the user readable name of the controller speci= fied by > - ControllerHandle and ChildHandle in the form of a Unicode string. If t= he > - driver specified by This has a user readable name in the language spec= ified by > - Language, then a pointer to the controller name is returned in Control= lerName, > - and EFI_SUCCESS is returned. If the driver specified by This is not c= urrently > - managing the controller specified by ControllerHandle and ChildHandle, > - then EFI_UNSUPPORTED is returned. If the driver specified by This doe= s not > - support the language specified by Language, then EFI_UNSUPPORTED is re= turned. > - > - @param This A pointer to the EFI_COMPONENT_NAME2_PRO= TOCOL or > - EFI_COMPONENT_NAME_PROTOCOL instance. > - @param ControllerHandle The handle of a controller that the driv= er > - specified by This is managing. This han= dle > - specifies the controller whose name is t= o be > - returned. > - @param ChildHandle The handle of the child controller to re= trieve > - the name of. This is an optional parame= ter that > - may be NULL. It will be NULL for device > - drivers. It will also be NULL for a bus= drivers > - that wish to retrieve the name of the bus > - controller. It will not be NULL for a b= us > - driver that wishes to retrieve the name = of a > - child controller. > - @param Language A pointer to a Null-terminated ASCII str= ing > - array indicating the language. This is = the > - language of the driver name that the cal= ler is > - requesting, and it must match one of the > - languages specified in SupportedLanguage= s. The > - number of languages supported by a drive= r is up > - to the driver writer. Language is specif= ied in > - RFC 4646 or ISO 639-2 language code form= at. > - @param ControllerName A pointer to the Unicode string to retur= n. > - This Unicode string is the name of the > - controller specified by ControllerHandle= and > - ChildHandle in the language specified by > - Language from the point of view of the d= river > - specified by This. > - > - @retval EFI_SUCCESS The Unicode string for the user readable= name in > - the language specified by Language for t= he > - driver specified by This was returned in > - DriverName. > - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HAND= LE. > - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a = valid > - EFI_HANDLE. > - @retval EFI_INVALID_PARAMETER Language is NULL. > - @retval EFI_INVALID_PARAMETER ControllerName is NULL. > - @retval EFI_UNSUPPORTED The driver specified by This is not curr= ently > - managing the controller specified by > - ControllerHandle and ChildHandle. > - @retval EFI_UNSUPPORTED The driver specified by This does not su= pport > - the language specified by Language. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockMmioToBlockIoGetControllerName ( > - IN EFI_COMPONENT_NAME_PROTOCOL *This, > - IN EFI_HANDLE ControllerHandle, > - IN EFI_HANDLE ChildHandle = OPTIONAL, > - IN CHAR8 *Language, > - OUT CHAR16 **ControllerName > - ); > - > -#endif > diff --git a/OvmfPkg/Include/Protocol/BlockMmio.h b/OvmfPkg/Include/Proto= col/BlockMmio.h > deleted file mode 100644 > index 6edd23ca1f0e..000000000000 > --- a/OvmfPkg/Include/Protocol/BlockMmio.h > +++ /dev/null > @@ -1,50 +0,0 @@ > -/** @file > - Block IO (memory mapped) > - > - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
> - This program and the accompanying materials = > - are licensed and made available under the terms and conditions of the = BSD License = > - which accompanies this distribution. The full text of the license may= be found at = > - http://opensource.org/licenses/bsd-license.php = = > - > - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = = > - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. = > - > -**/ > - > -#ifndef __BLOCK_MMIO_H__ > -#define __BLOCK_MMIO_H__ > - > -#include > - > -#define BLOCK_MMIO_PROTOCOL_GUID \ > - { \ > - 0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xb= e, 0x84 } \ > - } > - > -typedef struct _BLOCK_MMIO_PROTOCOL BLOCK_MMIO_PROTOCOL; > - > - > -/// > -/// This protocol provides control over block devices. > -/// > -struct _BLOCK_MMIO_PROTOCOL { > - /// > - /// The revision to which the block IO interface adheres. All future > - /// revisions must be backwards compatible. If a future version is not > - /// back wards compatible, it is not the same GUID. > - /// > - UINT64 Revision; > - /// > - /// Pointer to the EFI_BLOCK_IO_MEDIA data for this device. > - /// > - EFI_BLOCK_IO_MEDIA *Media; > - > - EFI_PHYSICAL_ADDRESS BaseAddress; > - > -}; > - > -extern EFI_GUID gBlockMmioProtocolGuid; > - > -#endif > - > diff --git a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c b/OvmfPkg/BlockMmioT= oBlockIoDxe/BlockIo.c > deleted file mode 100644 > index 939792f2ada2..000000000000 > --- a/OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.c > +++ /dev/null > @@ -1,528 +0,0 @@ > -/** @file > - The driver wrappers BlockMmio protocol instances to produce > - Block I/O Protocol instances. > - > - Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
> - This program and the accompanying materials > - are licensed and made available under the terms and conditions of the = BSD License > - which accompanies this distribution. The full text of the license may= be found at > - http://opensource.org/licenses/bsd-license.php > - = > - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > - > -**/ > - > -#include "BlockIo.h" > - > -EFI_DRIVER_BINDING_PROTOCOL gBlockIoDriverBinding =3D { > - BlockIoDriverBindingSupported, > - BlockIoDriverBindingStart, > - BlockIoDriverBindingStop, > - 0x11, > - NULL, > - NULL > -}; > - > -/** > - Reset the block device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.Reset(). = > - It resets the block device hardware. > - ExtendedVerification is ignored in this implementation. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param ExtendedVerification Indicates that the driver may perform a= more exhaustive > - verification operation of the device du= ring reset. > - > - @retval EFI_SUCCESS The block device was reset. > - @retval EFI_DEVICE_ERROR The block device is not functioning cor= rectly and could not be reset. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoReset ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN BOOLEAN ExtendedVerification > - ) > -{ > - return EFI_SUCCESS; > -} > - > -/** > - Reads the requested number of blocks from the device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks(). = > - It reads the requested number of blocks from the device. > - All the blocks are read, or an error is returned. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param ReadData If TRUE then read data. If FALSE then = write data. > - @param MediaId The media ID that the read request is f= or. > - @param Lba The starting logical block address to r= ead from on the device. > - @param BufferSize The size of the Buffer in bytes. > - This must be a multiple of the intrinsi= c block size of the device. > - @param Buffer A pointer to the destination buffer for= the data. The caller is > - responsible for either having implicit = or explicit ownership of the buffer. > - > - @retval EFI_SUCCESS The data was read correctly from the de= vice. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to perform the read operation. > - @retval EFI_NO_MEDIA There is no media in the device. > - @retval EFI_MEDIA_CHANGED The MediaId is not for the current medi= a. > - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multi= ple of the intrinsic block size of the device. > - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are= not valid, > - or the buffer is not on proper alignmen= t. > - > -**/ > -EFI_STATUS > -EFIAPI > -ReadOrWriteBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN BOOLEAN ReadData, > - IN UINT32 MediaId, > - IN EFI_LBA Lba, > - IN UINTN BufferSize, > - OUT VOID *Buffer > - ) > -{ > - EFI_STATUS Status; > - BLOCK_MMIO_TO_BLOCK_IO_DEVICE *Private; > - UINTN TotalBlock; > - EFI_BLOCK_IO_MEDIA *Media; > - UINT64 Address; > - UINTN Count; > - EFI_CPU_IO_PROTOCOL_IO_MEM CpuAccessFunction; > - > - // > - // First, validate the parameters > - // > - if ((Buffer =3D=3D NULL) || (BufferSize =3D=3D 0)) { > - return EFI_INVALID_PARAMETER; > - } > - > - // > - // Get private data structure > - // > - Private =3D PRIVATE_FROM_BLOCK_IO (This); > - Media =3D Private->BlockMmio->Media; > - > - // > - // BufferSize must be a multiple of the intrinsic block size of the de= vice. > - // > - if (ModU64x32 (BufferSize, Media->BlockSize) !=3D 0) { > - return EFI_BAD_BUFFER_SIZE; > - } > - > - TotalBlock =3D (UINTN) DivU64x32 (BufferSize, Media->BlockSize); > - > - // > - // Make sure the range to read is valid. > - // > - if (Lba + TotalBlock - 1 > Media->LastBlock) { > - return EFI_INVALID_PARAMETER; > - } > - > - if (!(Media->MediaPresent)) { > - return EFI_NO_MEDIA; > - } > - > - if (MediaId !=3D Media->MediaId) { > - return EFI_MEDIA_CHANGED; > - } > - > - Address =3D Private->BlockMmio->BaseAddress; > - Address +=3D MultU64x32 (Lba, Media->BlockSize); > - > - Count =3D BufferSize >> 3; > - > - if (ReadData) { > - CpuAccessFunction =3D Private->CpuIo->Mem.Read; > - } else { > - CpuAccessFunction =3D Private->CpuIo->Mem.Write; > - } > - > - Status =3D (CpuAccessFunction) ( > - Private->CpuIo, > - EfiCpuIoWidthUint64, > - Address, > - Count, > - Buffer > - ); > - > - return Status; > -} > - > - > -/** > - Reads the requested number of blocks from the device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks(). = > - It reads the requested number of blocks from the device. > - All the blocks are read, or an error is returned. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param MediaId The media ID that the read request is f= or. > - @param Lba The starting logical block address to r= ead from on the device. > - @param BufferSize The size of the Buffer in bytes. > - This must be a multiple of the intrinsi= c block size of the device. > - @param Buffer A pointer to the destination buffer for= the data. The caller is > - responsible for either having implicit = or explicit ownership of the buffer. > - > - @retval EFI_SUCCESS The data was read correctly from the de= vice. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to perform the read operation. > - @retval EFI_NO_MEDIA There is no media in the device. > - @retval EFI_MEDIA_CHANGED The MediaId is not for the current medi= a. > - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multi= ple of the intrinsic block size of the device. > - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are= not valid, > - or the buffer is not on proper alignmen= t. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoReadBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN UINT32 MediaId, > - IN EFI_LBA Lba, > - IN UINTN BufferSize, > - OUT VOID *Buffer > - ) > -{ > - DEBUG ((EFI_D_INFO, "BlockIo (MMIO) ReadBlocks: lba=3D0x%Lx, size=3D0x= %Lx\n", > - Lba, (UINT64)BufferSize)); > - return ReadOrWriteBlocks ( > - This, > - TRUE, > - MediaId, > - Lba, > - BufferSize, > - Buffer > - ); > -} > - > - > -/** > - Writes a specified number of blocks to the device. > - > - This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks(). = > - It writes a specified number of blocks to the device. > - All blocks are written, or an error is returned. > - > - @param This Indicates a pointer to the calling cont= ext. > - @param MediaId The media ID that the write request is = for. > - @param Lba The starting logical block address to b= e written. > - @param BufferSize The size of the Buffer in bytes. > - This must be a multiple of the intrinsi= c block size of the device. > - @param Buffer Pointer to the source buffer for the da= ta. > - > - @retval EFI_SUCCESS The data were written correctly to the = device. > - @retval EFI_WRITE_PROTECTED The device cannot be written to. > - @retval EFI_NO_MEDIA There is no media in the device. > - @retval EFI_MEDIA_CHANGED The MediaId is not for the current medi= a. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to perform the write operation. > - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multi= ple of the intrinsic > - block size of the device. > - @retval EFI_INVALID_PARAMETER The write request contains LBAs that ar= e not valid, > - or the buffer is not on proper alignmen= t. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoWriteBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This, > - IN UINT32 MediaId, > - IN EFI_LBA Lba, > - IN UINTN BufferSize, > - IN VOID *Buffer > - ) > -{ > - DEBUG ((EFI_D_INFO, "BlockIo (MMIO) WriteBlocks: lba=3D0x%Lx, size=3D0= x%Lx\n", > - Lba, (UINT64)BufferSize)); > - return ReadOrWriteBlocks ( > - This, > - FALSE, > - MediaId, > - Lba, > - BufferSize, > - Buffer > - ); > -} > - > -/** > - Flushes all modified data to a physical block device. > - > - @param This Indicates a pointer to the calling cont= ext. > - > - @retval EFI_SUCCESS All outstanding data were written corre= ctly to the device. > - @retval EFI_DEVICE_ERROR The device reported an error while atte= mpting to write data. > - @retval EFI_NO_MEDIA There is no media in the device. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoFlushBlocks ( > - IN EFI_BLOCK_IO_PROTOCOL *This > - ) > -{ > - return EFI_SUCCESS; > -} > - > - > -/** > - Initialize data for device that does not support multiple LUNSs. > - > - @param This The Driver Binding Protocol instance. > - @param Controller The device to initialize. > - @param BlockMmio Pointer to USB_MASS_TRANSPORT. > - @param Context Parameter for USB_MASS_DEVICE.Context. > - > - @retval EFI_SUCCESS Initialization succeeds. > - @retval Other Initialization fails. > - > -**/ > -EFI_STATUS > -BlockIoInit ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller > - ) > -{ > - EFI_STATUS Status; > - BLOCK_MMIO_TO_BLOCK_IO_DEVICE *Private; > - BLOCK_MMIO_PROTOCOL *BlockMmio; > - > - Private =3D (BLOCK_MMIO_TO_BLOCK_IO_DEVICE*) AllocateZeroPool (sizeof = (*Private)); > - ASSERT (Private !=3D NULL); > - > - Status =3D gBS->LocateProtocol ( > - &gEfiCpuIo2ProtocolGuid, > - NULL, > - (VOID **) &(Private->CpuIo) > - ); > - ASSERT_EFI_ERROR (Status); > - > - Status =3D gBS->OpenProtocol ( > - Controller, > - &gBlockMmioProtocolGuid, > - (VOID **) &BlockMmio, > - This->DriverBindingHandle, > - Controller, > - EFI_OPEN_PROTOCOL_BY_DRIVER > - ); > - if (EFI_ERROR (Status)) { > - DEBUG ((EFI_D_ERROR, "BlockIoInit: OpenBlockMmioProtocol By Driver (= %r)\n", Status)); > - goto ON_ERROR; > - } > - DEBUG ((EFI_D_INFO, "BlockMmio: %p\n", BlockMmio)); > - DEBUG ((EFI_D_INFO, "BlockMmio->Media->LastBlock: 0x%lx\n", BlockMmio-= >Media->LastBlock)); > - = > - Private->Signature =3D BLOCK_MMIO_TO_BLOCK_IO_SIGNATURE; > - Private->Controller =3D Controller; > - Private->BlockMmio =3D BlockMmio; > - Private->BlockIo.Media =3D BlockMmio->Media; > - Private->BlockIo.Reset =3D BlockIoReset; > - Private->BlockIo.ReadBlocks =3D BlockIoReadBlocks; > - Private->BlockIo.WriteBlocks =3D BlockIoWriteBlocks; > - Private->BlockIo.FlushBlocks =3D BlockIoFlushBlocks; > - > - DEBUG ((EFI_D_INFO, "Private->BlockIo.Media->LastBlock: 0x%lx\n", Priv= ate->BlockIo.Media->LastBlock)); > - > - Status =3D gBS->InstallProtocolInterface ( > - &Controller, > - &gEfiBlockIoProtocolGuid, > - EFI_NATIVE_INTERFACE, > - &Private->BlockIo > - ); > - if (EFI_ERROR (Status)) { > - goto ON_ERROR; > - } > - > - return EFI_SUCCESS; > - > -ON_ERROR: > - if (Private !=3D NULL) { > - FreePool (Private); > - } > - if (BlockMmio !=3D NULL) { > - gBS->CloseProtocol ( > - Controller, > - &gBlockMmioProtocolGuid, > - This->DriverBindingHandle, > - Controller > - ); > - } > - return Status; = > -} > - > - > -/** > - Check whether the controller is a supported USB mass storage. > - > - @param This The USB mass storage driver binding pro= tocol. > - @param Controller The controller handle to check. > - @param RemainingDevicePath The remaining device path. > - > - @retval EFI_SUCCESS The driver supports this controller. > - @retval other This device isn't supported. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingSupported ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath > - ) > -{ > - EFI_STATUS Status; > - BLOCK_MMIO_PROTOCOL *BlockMmio; > - > - Status =3D gBS->OpenProtocol ( > - Controller, > - &gBlockMmioProtocolGuid, > - (VOID **) &BlockMmio, > - This->DriverBindingHandle, > - Controller, > - EFI_OPEN_PROTOCOL_BY_DRIVER > - ); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - gBS->CloseProtocol ( > - Controller, > - &gBlockMmioProtocolGuid, > - This->DriverBindingHandle, > - Controller > - ); > - > - return Status; > -} > - > -/** > - Starts the USB mass storage device with this driver. > - > - This function consumes USB I/O Portocol, intializes USB mass storage d= evice, > - installs Block I/O Protocol, and submits Asynchronous Interrupt > - Transfer to manage the USB mass storage device. > - > - @param This The USB mass storage driver binding prot= ocol. > - @param Controller The USB mass storage device to start on > - @param RemainingDevicePath The remaining device path. > - > - @retval EFI_SUCCESS This driver supports this device. > - @retval EFI_UNSUPPORTED This driver does not support this device. > - @retval EFI_DEVICE_ERROR This driver cannot be started due to dev= ice Error. > - @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources. > - @retval EFI_ALREADY_STARTED This driver has been started. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingStart ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath > - ) > -{ > - EFI_STATUS Status; > - = > - Status =3D BlockIoInit (This, Controller); > - if (EFI_ERROR (Status)) { > - DEBUG ((EFI_D_ERROR, "BlockIoDriverBindingStart: BlockIoInit (%r)\n"= , Status)); > - return Status; > - } > - > - DEBUG ((EFI_D_INIT, "BlockIoDriverBindingStart: Successfully started\n= ")); > - return Status; > -} > - > - > -/** > - Stop controlling the device. > - > - @param This The USB mass storage driver binding > - @param Controller The device controller controlled by the= driver. > - @param NumberOfChildren The number of children of this device > - @param ChildHandleBuffer The buffer of children handle. > - > - @retval EFI_SUCCESS The driver stopped from controlling the= device. > - @retval EFI_DEVICE_ERROR The device could not be stopped due to = a device error. > - @retval EFI_UNSUPPORTED Block I/O Protocol is not installed on = Controller. > - @retval Others Failed to stop the driver > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockIoDriverBindingStop ( > - IN EFI_DRIVER_BINDING_PROTOCOL *This, > - IN EFI_HANDLE Controller, > - IN UINTN NumberOfChildren, > - IN EFI_HANDLE *ChildHandleBuffer > - ) > -{ > - EFI_STATUS Status; > - BLOCK_MMIO_TO_BLOCK_IO_DEVICE *Private; > - > - Private =3D PRIVATE_FROM_BLOCK_IO (This); > - > - // > - // Uninstall Block I/O protocol from the device handle, > - // then call the transport protocol to stop itself. > - // > - Status =3D gBS->UninstallProtocolInterface ( > - Controller, > - &gEfiBlockIoProtocolGuid, > - &Private->BlockIo > - ); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - gBS->CloseProtocol ( > - Controller, > - &gBlockMmioProtocolGuid, > - This->DriverBindingHandle, > - Controller > - ); > - > - FreePool (Private); > - = > - DEBUG ((EFI_D_INFO, "Successfully stopped BlockIo on BlockMmio\n")); > - return EFI_SUCCESS; > -} > - > -/** > - Entrypoint of Block MMIO to Block IO Driver. > - > - This function is the entrypoint of USB Mass Storage Driver. It install= s Driver Binding > - Protocol together with Component Name Protocols. > - > - @param ImageHandle The firmware allocated handle for the EFI im= age. > - @param SystemTable A pointer to the EFI System Table. > - > - @retval EFI_SUCCESS The entry point is executed successfully. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockMmioToBlockIoEntryPoint ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > - ) > -{ > - EFI_STATUS Status; > - > - // > - // Install driver binding protocol > - // > - Status =3D EfiLibInstallDriverBindingComponentName2 ( > - ImageHandle, > - SystemTable, > - &gBlockIoDriverBinding, > - ImageHandle, > - &gBlockMmioToBlockIoComponentName, > - &gBlockMmioToBlockIoComponentName2 > - ); > - ASSERT_EFI_ERROR (Status); > - > - return EFI_SUCCESS; > -} > diff --git a/OvmfPkg/BlockMmioToBlockIoDxe/ComponentName.c b/OvmfPkg/Bloc= kMmioToBlockIoDxe/ComponentName.c > deleted file mode 100644 > index 1baa9489d5a4..000000000000 > --- a/OvmfPkg/BlockMmioToBlockIoDxe/ComponentName.c > +++ /dev/null > @@ -1,162 +0,0 @@ > -/** @file > - UEFI Component Name(2) protocol implementation for Block MMIO to Block= IO driver. > - > - Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.
> - This program and the accompanying materials > - are licensed and made available under the terms and conditions of the = BSD License > - which accompanies this distribution. The full text of the license may= be found at > - http://opensource.org/licenses/bsd-license.php > - > - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > - > -**/ > - > -#include "BlockIo.h" > - > -// > -// EFI Component Name Protocol > -// > -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBlockMmioToB= lockIoComponentName =3D { > - BlockMmioToBlockIoGetDriverName, > - BlockMmioToBlockIoGetControllerName, > - "eng" > -}; > - > -// > -// EFI Component Name 2 Protocol > -// > -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBlockMmioToB= lockIoComponentName2 =3D { > - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BlockMmioToBlockIoGetDriverName, > - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BlockMmioToBlockIoGetControl= lerName, > - "en" > -}; > - > - > -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE > -mBlockMmioToBlockIoDriverNameTable[] =3D { > - {"eng;en", L"Block MMIO to Block IO Driver"}, > - {NULL, NULL} > -}; > - > -/** > - Retrieves a Unicode string that is the user readable name of the drive= r. > - > - This function retrieves the user readable name of a driver in the form= of a > - Unicode string. If the driver specified by This has a user readable na= me in > - the language specified by Language, then a pointer to the driver name = is > - returned in DriverName, and EFI_SUCCESS is returned. If the driver spe= cified > - by This does not support the language specified by Language, > - then EFI_UNSUPPORTED is returned. > - > - @param This A pointer to the EFI_COMPONENT_NAME2_PRO= TOCOL or > - EFI_COMPONENT_NAME_PROTOCOL instance. > - @param Language A pointer to a Null-terminated ASCII str= ing > - array indicating the language. This is t= he > - language of the driver name that the cal= ler is > - requesting, and it must match one of the > - languages specified in SupportedLanguage= s. The > - number of languages supported by a drive= r is up > - to the driver writer. Language is specif= ied > - in RFC 4646 or ISO 639-2 language code f= ormat. > - @param DriverName A pointer to the Unicode string to retur= n. > - This Unicode string is the name of the > - driver specified by This in the language > - specified by Language. > - > - @retval EFI_SUCCESS The Unicode string for the Driver specif= ied by > - This and the language specified by Langu= age was > - returned in DriverName. > - @retval EFI_INVALID_PARAMETER Language is NULL. > - @retval EFI_INVALID_PARAMETER DriverName is NULL. > - @retval EFI_UNSUPPORTED The driver specified by This does not su= pport > - the language specified by Language. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockMmioToBlockIoGetDriverName ( > - IN EFI_COMPONENT_NAME_PROTOCOL *This, > - IN CHAR8 *Language, > - OUT CHAR16 **DriverName > - ) > -{ > - return LookupUnicodeString2 ( > - Language, > - This->SupportedLanguages, > - mBlockMmioToBlockIoDriverNameTable, > - DriverName, > - (BOOLEAN)(This =3D=3D &gBlockMmioToBlockIoComponentName) > - ); > -} > - > -/** > - Retrieves a Unicode string that is the user readable name of the contr= oller > - that is being managed by a driver. > - > - This function retrieves the user readable name of the controller speci= fied by > - ControllerHandle and ChildHandle in the form of a Unicode string. If t= he > - driver specified by This has a user readable name in the language spec= ified by > - Language, then a pointer to the controller name is returned in Control= lerName, > - and EFI_SUCCESS is returned. If the driver specified by This is not c= urrently > - managing the controller specified by ControllerHandle and ChildHandle, > - then EFI_UNSUPPORTED is returned. If the driver specified by This doe= s not > - support the language specified by Language, then EFI_UNSUPPORTED is re= turned. > - > - @param This A pointer to the EFI_COMPONENT_NAME2_PRO= TOCOL or > - EFI_COMPONENT_NAME_PROTOCOL instance. > - @param ControllerHandle The handle of a controller that the driv= er > - specified by This is managing. This han= dle > - specifies the controller whose name is t= o be > - returned. > - @param ChildHandle The handle of the child controller to re= trieve > - the name of. This is an optional parame= ter that > - may be NULL. It will be NULL for device > - drivers. It will also be NULL for a bus= drivers > - that wish to retrieve the name of the bus > - controller. It will not be NULL for a b= us > - driver that wishes to retrieve the name = of a > - child controller. > - @param Language A pointer to a Null-terminated ASCII str= ing > - array indicating the language. This is = the > - language of the driver name that the cal= ler is > - requesting, and it must match one of the > - languages specified in SupportedLanguage= s. The > - number of languages supported by a drive= r is up > - to the driver writer. Language is specif= ied in > - RFC 4646 or ISO 639-2 language code form= at. > - @param ControllerName A pointer to the Unicode string to retur= n. > - This Unicode string is the name of the > - controller specified by ControllerHandle= and > - ChildHandle in the language specified by > - Language from the point of view of the d= river > - specified by This. > - > - @retval EFI_SUCCESS The Unicode string for the user readable= name in > - the language specified by Language for t= he > - driver specified by This was returned in > - DriverName. > - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HAND= LE. > - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a = valid > - EFI_HANDLE. > - @retval EFI_INVALID_PARAMETER Language is NULL. > - @retval EFI_INVALID_PARAMETER ControllerName is NULL. > - @retval EFI_UNSUPPORTED The driver specified by This is not curr= ently > - managing the controller specified by > - ControllerHandle and ChildHandle. > - @retval EFI_UNSUPPORTED The driver specified by This does not su= pport > - the language specified by Language. > - > -**/ > -EFI_STATUS > -EFIAPI > -BlockMmioToBlockIoGetControllerName ( > - IN EFI_COMPONENT_NAME_PROTOCOL *This, > - IN EFI_HANDLE ControllerHandle, > - IN EFI_HANDLE ChildHandle = OPTIONAL, > - IN CHAR8 *Language, > - OUT CHAR16 **ControllerName > - ) > -{ > - return EFI_UNSUPPORTED; > -} > -- = > 2.14.1.3.gb7cf6e02401b >=20