]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DiskIo.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Protocol / DiskIo.h
1 /** @file
2 Disk IO protocol as defined in the EFI 1.0 specification.
3
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
6 Block IO protocol.
7
8 Copyright (c) 2006, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef __DISK_IO_H__
20 #define __DISK_IO_H__
21
22 #define EFI_DISK_IO_PROTOCOL_GUID \
23 { \
24 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
25 }
26
27 //
28 // Protocol GUID name defined in EFI1.1.
29 //
30 #define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID
31
32 typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;
33
34 //
35 // Protocol defined in EFI1.1.
36 //
37 typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO;
38
39 /**
40 Read BufferSize bytes from Offset into Buffer.
41
42 @param This Protocol instance pointer.
43 @param MediaId Id of the media, changes every time the media is replaced.
44 @param Offset The starting byte offset to read from
45 @param BufferSize Size of Buffer
46 @param Buffer Buffer containing read data
47
48 @retval EFI_SUCCESS The data was read correctly from the device.
49 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
50 @retval EFI_NO_MEDIA There is no media in the device.
51 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
52 @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
53 valid for the device.
54
55 **/
56 typedef
57 EFI_STATUS
58 (EFIAPI *EFI_DISK_READ) (
59 IN EFI_DISK_IO_PROTOCOL *This,
60 IN UINT32 MediaId,
61 IN UINT64 Offset,
62 IN UINTN BufferSize,
63 OUT VOID *Buffer
64 )
65 ;
66
67 /**
68 Read BufferSize bytes from Offset into Buffer.
69
70 @param This Protocol instance pointer.
71 @param MediaId Id of the media, changes every time the media is replaced.
72 @param Offset The starting byte offset to read from
73 @param BufferSize Size of Buffer
74 @param Buffer Buffer containing read data
75
76 @retval EFI_SUCCESS The data was written correctly to the device.
77 @retval EFI_WRITE_PROTECTED The device can not be written to.
78 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
79 @retval EFI_NO_MEDIA There is no media in the device.
80 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
81 @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not
82 valid for the device.
83
84 **/
85 typedef
86 EFI_STATUS
87 (EFIAPI *EFI_DISK_WRITE) (
88 IN EFI_DISK_IO_PROTOCOL *This,
89 IN UINT32 MediaId,
90 IN UINT64 Offset,
91 IN UINTN BufferSize,
92 IN VOID *Buffer
93 )
94 ;
95
96 #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
97
98 //
99 // Revision defined in EFI1.1
100 //
101 #define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION
102
103 struct _EFI_DISK_IO_PROTOCOL {
104 UINT64 Revision;
105 EFI_DISK_READ ReadDisk;
106 EFI_DISK_WRITE WriteDisk;
107 };
108
109 extern EFI_GUID gEfiDiskIoProtocolGuid;
110
111 #endif