2 Disk IO protocol as defined in the UEFI 2.0 specification.
4 The Disk IO protocol is used to convert block oriented devices into byte
5 oriented devices. The Disk IO protocol is intended to layer on top of the
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
16 #define EFI_DISK_IO_PROTOCOL_GUID \
18 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
22 /// Protocol GUID name defined in EFI1.1.
24 #define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID
26 typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL
;
29 /// Protocol defined in EFI1.1.
31 typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO
;
34 Read BufferSize bytes from Offset into Buffer.
36 @param This Protocol instance pointer.
37 @param MediaId Id of the media, changes every time the media is replaced.
38 @param Offset The starting byte offset to read from
39 @param BufferSize Size of Buffer
40 @param Buffer Buffer containing read data
42 @retval EFI_SUCCESS The data was read correctly from the device.
43 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
44 @retval EFI_NO_MEDIA There is no media in the device.
45 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
46 @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
52 (EFIAPI
*EFI_DISK_READ
)(
53 IN EFI_DISK_IO_PROTOCOL
*This
,
61 Writes a specified number of bytes to a device.
63 @param This Indicates a pointer to the calling context.
64 @param MediaId ID of the medium to be written.
65 @param Offset The starting byte offset on the logical block I/O device to write.
66 @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device.
67 @param Buffer A pointer to the buffer containing the data to be written.
69 @retval EFI_SUCCESS The data was written correctly to the device.
70 @retval EFI_WRITE_PROTECTED The device can not be written to.
71 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
72 @retval EFI_NO_MEDIA There is no media in the device.
73 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
74 @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not
80 (EFIAPI
*EFI_DISK_WRITE
)(
81 IN EFI_DISK_IO_PROTOCOL
*This
,
88 #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
91 /// Revision defined in EFI1.1
93 #define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION
96 /// This protocol is used to abstract Block I/O interfaces.
98 struct _EFI_DISK_IO_PROTOCOL
{
100 /// The revision to which the disk I/O interface adheres. All future
101 /// revisions must be backwards compatible. If a future version is not
102 /// backwards compatible, it is not the same GUID.
105 EFI_DISK_READ ReadDisk
;
106 EFI_DISK_WRITE WriteDisk
;
109 extern EFI_GUID gEfiDiskIoProtocolGuid
;