From nobody Fri May 3 17:44:05 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=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1523383798562942.6259098599112; Tue, 10 Apr 2018 11:09:58 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0A79F2270D356; Tue, 10 Apr 2018 11:09:57 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 DCE252270D331 for ; Tue, 10 Apr 2018 11:09:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 256088185338; Tue, 10 Apr 2018 18:09:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-125.rdu2.redhat.com [10.10.120.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F8FE10B2B47; Tue, 10 Apr 2018 18:09:52 +0000 (UTC) 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=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 10 Apr 2018 20:09:50 +0200 Message-Id: <20180410180950.16343-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Apr 2018 18:09:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Apr 2018 18:09:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [edk2] [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: , Cc: Jordan Justen , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jordan Justen --- 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] =20 [Protocols] gVirtioDeviceProtocolGuid =3D {0xfa920010, 0x6785, 0x4941, {0x= b6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}} - gBlockMmioProtocolGuid =3D {0x6b558ce3, 0x69e5, 0x4c67, {0x= a6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}} gXenBusProtocolGuid =3D {0x3d3ca290, 0xb9a5, 0x11e3, {0x= b7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}} gXenIoProtocolGuid =3D {0x6efac84f, 0x0ab0, 0x4747, {0x= 81, 0xbe, 0x85, 0x55, 0x62, 0x59, 0x04, 0x49}} gIoMmuAbsentProtocolGuid =3D {0xf8775d50, 0x8abd, 0x4adf, {0x= 92, 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/LegacyBoot= MaintUiLib.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/LegacyBoot= MaintUiLib.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/LegacyBoot= MaintUiLib.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/PcatRealTimeClockRuntimeDx= e.inf =20 -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/PcatRealTimeClockRuntimeDx= e.inf =20 -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/PcatRealTimeClockRuntimeDx= e.inf =20 -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/BlockMmioT= oBlockIoDxe/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 B= SD License -# which accompanies this distribution. The full text of the license may b= e 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 IM= PLIED. -# -# -## - -[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 the = 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/BlockMmioToB= lockIoDxe/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 Proto= col, - 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 BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#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_BLOCK= _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 devic= e 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 d= river. - @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 d= evice. - @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 Co= ntroller. - @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().=20 - It resets the block device hardware. - ExtendedVerification is ignored in this implementation. - - @param This Indicates a pointer to the calling contex= t. - @param ExtendedVerification Indicates that the driver may perform a m= ore exhaustive - verification operation of the device duri= ng reset. - - @retval EFI_SUCCESS The block device was reset. - @retval EFI_DEVICE_ERROR The block device is not functioning corre= ctly 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().=20 - 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 contex= t. - @param MediaId The media ID that the read request is for. - @param Lba The starting logical block address to rea= d from on the device. - @param BufferSize The size of the Buffer in bytes. - This must be a multiple of the intrinsic = block size of the device. - @param Buffer A pointer to the destination buffer for t= he 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 devi= ce. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting 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 media. - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multipl= e of the intrinsic block size of the device. - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are n= ot valid, - or the buffer is not on proper alignment. - -**/ -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().=20 - 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 contex= t. - @param MediaId The media ID that the write request is fo= r. - @param Lba The starting logical block address to be = written. - @param BufferSize The size of the Buffer in bytes. - This must be a multiple of the intrinsic = block size of the device. - @param Buffer Pointer to the source buffer for the data. - - @retval EFI_SUCCESS The data were written correctly to the de= vice. - @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 media. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting to perform the write operation. - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multipl= e of the intrinsic - block size of the device. - @retval EFI_INVALID_PARAMETER The write request contains LBAs that are = not valid, - or the buffer is not on proper alignment. - -**/ -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 contex= t. - - @retval EFI_SUCCESS All outstanding data were written correct= ly to the device. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting 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 driver. - - This function retrieves the user readable name of a driver in the form o= f a - Unicode string. If the driver specified by This has a user readable name= 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 speci= fied - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specified - in RFC 4646 or ISO 639-2 language code for= mat. - @param DriverName A pointer to the Unicode string to return. - 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 specifie= d by - This and the language specified by Languag= e 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 supp= ort - 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 control= ler - that is being managed by a driver. - - This function retrieves the user readable name of the controller specifi= ed by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specif= ied by - Language, then a pointer to the controller name is returned in Controlle= rName, - and EFI_SUCCESS is returned. If the driver specified by This is not cur= rently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does = not - support the language specified by Language, then EFI_UNSUPPORTED is retu= rned. - - @param This A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - @param ControllerHandle The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to = be - returned. - @param ChildHandle The handle of the child controller to retr= ieve - the name of. This is an optional paramete= r that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus d= rivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of= a - child controller. - @param Language A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specifie= d in - RFC 4646 or ISO 639-2 language code format. - @param ControllerName A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle a= nd - ChildHandle in the language specified by - Language from the point of view of the dri= ver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in - the language specified by Language for the - driver specified by This was returned in - DriverName. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - 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 curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -BlockMmioToBlockIoGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle O= PTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ); - -#endif diff --git a/OvmfPkg/Include/Protocol/BlockMmio.h b/OvmfPkg/Include/Protoco= l/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 =20 - are licensed and made available under the terms and conditions of the BS= D License =20 - which accompanies this distribution. The full text of the license may b= e found at =20 - http://opensource.org/licenses/bsd-license.php = =20 - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 - -**/ - -#ifndef __BLOCK_MMIO_H__ -#define __BLOCK_MMIO_H__ - -#include - -#define BLOCK_MMIO_PROTOCOL_GUID \ - { \ - 0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe,= 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/BlockMmioToB= lockIoDxe/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 BS= D License - which accompanies this distribution. The full text of the license may b= e found at - http://opensource.org/licenses/bsd-license.php - =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. - -**/ - -#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().=20 - It resets the block device hardware. - ExtendedVerification is ignored in this implementation. - - @param This Indicates a pointer to the calling contex= t. - @param ExtendedVerification Indicates that the driver may perform a m= ore exhaustive - verification operation of the device duri= ng reset. - - @retval EFI_SUCCESS The block device was reset. - @retval EFI_DEVICE_ERROR The block device is not functioning corre= ctly 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().=20 - 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 contex= t. - @param ReadData If TRUE then read data. If FALSE then wr= ite data. - @param MediaId The media ID that the read request is for. - @param Lba The starting logical block address to rea= d from on the device. - @param BufferSize The size of the Buffer in bytes. - This must be a multiple of the intrinsic = block size of the device. - @param Buffer A pointer to the destination buffer for t= he 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 devi= ce. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting 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 media. - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multipl= e of the intrinsic block size of the device. - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are n= ot valid, - or the buffer is not on proper alignment. - -**/ -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 devi= ce. - // - 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().=20 - 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 contex= t. - @param MediaId The media ID that the read request is for. - @param Lba The starting logical block address to rea= d from on the device. - @param BufferSize The size of the Buffer in bytes. - This must be a multiple of the intrinsic = block size of the device. - @param Buffer A pointer to the destination buffer for t= he 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 devi= ce. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting 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 media. - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multipl= e of the intrinsic block size of the device. - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are n= ot valid, - or the buffer is not on proper alignment. - -**/ -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%L= x\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().=20 - 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 contex= t. - @param MediaId The media ID that the write request is fo= r. - @param Lba The starting logical block address to be = written. - @param BufferSize The size of the Buffer in bytes. - This must be a multiple of the intrinsic = block size of the device. - @param Buffer Pointer to the source buffer for the data. - - @retval EFI_SUCCESS The data were written correctly to the de= vice. - @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 media. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting to perform the write operation. - @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multipl= e of the intrinsic - block size of the device. - @retval EFI_INVALID_PARAMETER The write request contains LBAs that are = not valid, - or the buffer is not on proper alignment. - -**/ -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=3D0x%= 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 contex= t. - - @retval EFI_SUCCESS All outstanding data were written correct= ly to the device. - @retval EFI_DEVICE_ERROR The device reported an error while attemp= ting 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->M= edia->LastBlock)); - =20 - 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", Privat= e->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; =20 -} - - -/** - Check whether the controller is a supported USB mass storage. - - @param This The USB mass storage driver binding proto= col. - @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 dev= ice, - 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 protoc= ol. - @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 devic= e 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; - =20 - 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 d= river. - @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 d= evice. - @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 Co= ntroller. - @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); - =20 - 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 installs = Driver Binding - Protocol together with Component Name Protocols. - - @param ImageHandle The firmware allocated handle for the EFI imag= e. - @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/BlockM= mioToBlockIoDxe/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 I= O 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 BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include "BlockIo.h" - -// -// EFI Component Name Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBlockMmioToBlo= ckIoComponentName =3D { - BlockMmioToBlockIoGetDriverName, - BlockMmioToBlockIoGetControllerName, - "eng" -}; - -// -// EFI Component Name 2 Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBlockMmioToBlo= ckIoComponentName2 =3D { - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BlockMmioToBlockIoGetDriverName, - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BlockMmioToBlockIoGetControlle= rName, - "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 driver. - - This function retrieves the user readable name of a driver in the form o= f a - Unicode string. If the driver specified by This has a user readable name= 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 speci= fied - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specified - in RFC 4646 or ISO 639-2 language code for= mat. - @param DriverName A pointer to the Unicode string to return. - 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 specifie= d by - This and the language specified by Languag= e 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 supp= ort - 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 control= ler - that is being managed by a driver. - - This function retrieves the user readable name of the controller specifi= ed by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specif= ied by - Language, then a pointer to the controller name is returned in Controlle= rName, - and EFI_SUCCESS is returned. If the driver specified by This is not cur= rently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does = not - support the language specified by Language, then EFI_UNSUPPORTED is retu= rned. - - @param This A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - @param ControllerHandle The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to = be - returned. - @param ChildHandle The handle of the child controller to retr= ieve - the name of. This is an optional paramete= r that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus d= rivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of= a - child controller. - @param Language A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specifie= d in - RFC 4646 or ISO 639-2 language code format. - @param ControllerName A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle a= nd - ChildHandle in the language specified by - Language from the point of view of the dri= ver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in - the language specified by Language for the - driver specified by This was returned in - DriverName. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - 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 curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -BlockMmioToBlockIoGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle O= PTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ) -{ - return EFI_UNSUPPORTED; -} --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel