2 Header file for EFI_BLOCK_IO_PROTOCOL interface.
4 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _EFI_NVME_BLOCKIO_H_
16 #define _EFI_NVME_BLOCKIO_H_
19 Reset the Block Device.
21 @param This Indicates a pointer to the calling context.
22 @param ExtendedVerification Driver may perform diagnostics on reset.
24 @retval EFI_SUCCESS The device was reset.
25 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
32 IN EFI_BLOCK_IO_PROTOCOL
*This
,
33 IN BOOLEAN ExtendedVerification
37 Read BufferSize bytes from Lba into Buffer.
39 @param This Indicates a pointer to the calling context.
40 @param MediaId Id of the media, changes every time the media is replaced.
41 @param Lba The starting Logical Block Address to read from
42 @param BufferSize Size of Buffer, must be a multiple of device block size.
43 @param Buffer A pointer to the destination buffer for the data. The caller is
44 responsible for either having implicit or explicit ownership of the buffer.
46 @retval EFI_SUCCESS The data was read correctly from the device.
47 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
48 @retval EFI_NO_MEDIA There is no media in the device.
49 @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
50 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
51 @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
52 or the buffer is not on proper alignment.
57 NvmeBlockIoReadBlocks (
58 IN EFI_BLOCK_IO_PROTOCOL
*This
,
66 Write BufferSize bytes from Lba into Buffer.
68 @param This Indicates a pointer to the calling context.
69 @param MediaId The media ID that the write request is for.
70 @param Lba The starting logical block address to be written. The caller is
71 responsible for writing to only legitimate locations.
72 @param BufferSize Size of Buffer, must be a multiple of device block size.
73 @param Buffer A pointer to the source buffer for the data.
75 @retval EFI_SUCCESS The data was written correctly to the device.
76 @retval EFI_WRITE_PROTECTED The device can not be written to.
77 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
78 @retval EFI_NO_MEDIA There is no media in the device.
79 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
80 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
81 @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
82 or the buffer is not on proper alignment.
87 NvmeBlockIoWriteBlocks (
88 IN EFI_BLOCK_IO_PROTOCOL
*This
,
96 Flush the Block Device.
98 @param This Indicates a pointer to the calling context.
100 @retval EFI_SUCCESS All outstanding data was written to the device
101 @retval EFI_DEVICE_ERROR The device reported an error while writing back the data
102 @retval EFI_NO_MEDIA There is no media in the device.
107 NvmeBlockIoFlushBlocks (
108 IN EFI_BLOCK_IO_PROTOCOL
*This