]>
Commit | Line | Data |
---|---|---|
eb290d02 FT |
1 | /** @file\r |
2 | Header file for EFI_BLOCK_IO_PROTOCOL interface.\r | |
3 | \r | |
4 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _EFI_NVME_BLOCKIO_H_\r | |
16 | #define _EFI_NVME_BLOCKIO_H_\r | |
17 | \r | |
18 | /**\r | |
19 | Reset the Block Device.\r | |
20 | \r | |
21 | @param This Indicates a pointer to the calling context.\r | |
22 | @param ExtendedVerification Driver may perform diagnostics on reset.\r | |
23 | \r | |
24 | @retval EFI_SUCCESS The device was reset.\r | |
25 | @retval EFI_DEVICE_ERROR The device is not functioning properly and could\r | |
26 | not be reset.\r | |
27 | \r | |
28 | **/\r | |
29 | EFI_STATUS\r | |
30 | EFIAPI\r | |
31 | NvmeBlockIoReset (\r | |
32 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
33 | IN BOOLEAN ExtendedVerification\r | |
34 | );\r | |
35 | \r | |
36 | /**\r | |
37 | Read BufferSize bytes from Lba into Buffer.\r | |
38 | \r | |
39 | @param This Indicates a pointer to the calling context.\r | |
40 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
41 | @param Lba The starting Logical Block Address to read from\r | |
42 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
43 | @param Buffer A pointer to the destination buffer for the data. The caller is\r | |
44 | responsible for either having implicit or explicit ownership of the buffer.\r | |
45 | \r | |
46 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
47 | @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r | |
48 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
49 | @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.\r | |
50 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
51 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r | |
52 | or the buffer is not on proper alignment.\r | |
53 | \r | |
54 | **/\r | |
55 | EFI_STATUS\r | |
56 | EFIAPI\r | |
57 | NvmeBlockIoReadBlocks (\r | |
58 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
59 | IN UINT32 MediaId,\r | |
60 | IN EFI_LBA Lba,\r | |
61 | IN UINTN BufferSize,\r | |
62 | OUT VOID *Buffer\r | |
63 | );\r | |
64 | \r | |
65 | /**\r | |
66 | Write BufferSize bytes from Lba into Buffer.\r | |
67 | \r | |
68 | @param This Indicates a pointer to the calling context.\r | |
69 | @param MediaId The media ID that the write request is for.\r | |
70 | @param Lba The starting logical block address to be written. The caller is\r | |
71 | responsible for writing to only legitimate locations.\r | |
72 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
73 | @param Buffer A pointer to the source buffer for the data.\r | |
74 | \r | |
75 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
76 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
77 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
78 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
79 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
80 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
81 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r | |
82 | or the buffer is not on proper alignment.\r | |
83 | \r | |
84 | **/\r | |
85 | EFI_STATUS\r | |
86 | EFIAPI\r | |
87 | NvmeBlockIoWriteBlocks (\r | |
88 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
89 | IN UINT32 MediaId,\r | |
90 | IN EFI_LBA Lba,\r | |
91 | IN UINTN BufferSize,\r | |
92 | IN VOID *Buffer\r | |
93 | );\r | |
94 | \r | |
95 | /**\r | |
96 | Flush the Block Device.\r | |
97 | \r | |
98 | @param This Indicates a pointer to the calling context.\r | |
99 | \r | |
100 | @retval EFI_SUCCESS All outstanding data was written to the device\r | |
101 | @retval EFI_DEVICE_ERROR The device reported an error while writing back the data\r | |
102 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
103 | \r | |
104 | **/\r | |
105 | EFI_STATUS\r | |
106 | EFIAPI\r | |
107 | NvmeBlockIoFlushBlocks (\r | |
108 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
109 | );\r | |
110 | \r | |
111 | #endif\r |