]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DiskIo.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / DiskIo.h
CommitLineData
d1f95000 1/** @file\r
8a7d75b0 2 Disk IO protocol as defined in the UEFI 2.0 specification.\r
d1f95000 3\r
4 The Disk IO protocol is used to convert block oriented devices into byte\r
5 oriented devices. The Disk IO protocol is intended to layer on top of the\r
6 Block IO protocol.\r
7\r
4ca9b6c4 8 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 9 All rights reserved. This program and the accompanying materials \r
10 are licensed and made available under the terms and conditions of the BSD License \r
11 which accompanies this distribution. The full text of the license may be found at \r
12 http://opensource.org/licenses/bsd-license.php \r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
16\r
d1f95000 17**/\r
18\r
19#ifndef __DISK_IO_H__\r
20#define __DISK_IO_H__\r
21\r
22#define EFI_DISK_IO_PROTOCOL_GUID \\r
23 { \\r
24 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
25 }\r
26\r
a6508c05 27//\r
28// Protocol GUID name defined in EFI1.1.\r
29// \r
30#define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID\r
31\r
d1f95000 32typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r
33\r
a6508c05 34//\r
35// Protocol defined in EFI1.1.\r
36// \r
37typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO;\r
38\r
d1f95000 39/**\r
40 Read BufferSize bytes from Offset into Buffer.\r
41\r
42 @param This Protocol instance pointer.\r
43 @param MediaId Id of the media, changes every time the media is replaced.\r
44 @param Offset The starting byte offset to read from\r
45 @param BufferSize Size of Buffer\r
46 @param Buffer Buffer containing read data\r
47\r
48 @retval EFI_SUCCESS The data was read correctly from the device.\r
49 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r
50 @retval EFI_NO_MEDIA There is no media in the device.\r
51 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r
52 @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
53 valid for the device.\r
54\r
55**/\r
56typedef\r
57EFI_STATUS\r
8b13229b 58(EFIAPI *EFI_DISK_READ)(\r
d1f95000 59 IN EFI_DISK_IO_PROTOCOL *This,\r
60 IN UINT32 MediaId,\r
61 IN UINT64 Offset,\r
62 IN UINTN BufferSize,\r
63 OUT VOID *Buffer\r
64 )\r
65;\r
66\r
67/**\r
68 Read BufferSize bytes from Offset into Buffer.\r
69\r
70 @param This Protocol instance pointer.\r
71 @param MediaId Id of the media, changes every time the media is replaced.\r
72 @param Offset The starting byte offset to read from\r
73 @param BufferSize Size of Buffer\r
74 @param Buffer Buffer containing read data\r
75\r
76 @retval EFI_SUCCESS The data was written correctly to the device.\r
77 @retval EFI_WRITE_PROTECTED The device can not be written to.\r
78 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r
79 @retval EFI_NO_MEDIA There is no media in the device.\r
80 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r
81 @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
82 valid for the device.\r
83\r
84**/\r
85typedef\r
86EFI_STATUS\r
8b13229b 87(EFIAPI *EFI_DISK_WRITE)(\r
d1f95000 88 IN EFI_DISK_IO_PROTOCOL *This,\r
89 IN UINT32 MediaId,\r
90 IN UINT64 Offset,\r
91 IN UINTN BufferSize,\r
92 IN VOID *Buffer\r
93 )\r
94;\r
95\r
96#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r
97\r
a6508c05 98//\r
99// Revision defined in EFI1.1\r
100// \r
101#define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION\r
102\r
4ca9b6c4
LG
103/**\r
104 @par Protocol Description:\r
105 This protocol is used to abstract Block I/O interfaces.\r
106\r
107 @param Revision \r
108 The revision to which the disk I/O interface adheres. All future\r
109 revisions must be backwards compatible. If a future version is not\r
110 backwards compatible, it is not the same GUID.\r
111\r
112 @param ReadDisk \r
113 Reads data from the disk.\r
114 \r
115 @param WriteDisk \r
116 Writes data to the disk.\r
117\r
118**/\r
d1f95000 119struct _EFI_DISK_IO_PROTOCOL {\r
120 UINT64 Revision;\r
121 EFI_DISK_READ ReadDisk;\r
122 EFI_DISK_WRITE WriteDisk;\r
123};\r
124\r
125extern EFI_GUID gEfiDiskIoProtocolGuid;\r
126\r
127#endif\r