2 BlockIo function declaration for Xen PV block driver.
4 Copyright (C) 2014, Citrix Ltd.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 Read BufferSize bytes from Lba into Buffer.
13 @param This Indicates a pointer to the calling context.
14 @param MediaId Id of the media, changes every time the media is replaced.
15 @param Lba The starting Logical Block Address to read from
16 @param BufferSize Size of Buffer, must be a multiple of device block size.
17 @param Buffer A pointer to the destination buffer for the data. The caller is
18 responsible for either having implicit or explicit ownership of the buffer.
20 @retval EFI_SUCCESS The data was read correctly from the device.
21 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
22 @retval EFI_NO_MEDIA There is no media in the device.
23 @retval EFI_MEDIA_CHANGED The MediaId does not match the current device.
24 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
25 @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
26 or the buffer is not on proper alignment.
31 XenPvBlkDxeBlockIoReadBlocks (
32 IN EFI_BLOCK_IO_PROTOCOL
*This
,
40 Write BufferSize bytes from Lba into Buffer.
42 @param This Indicates a pointer to the calling context.
43 @param MediaId The media ID that the write request is for.
44 @param Lba The starting logical block address to be written. The caller is
45 responsible for writing to only legitimate locations.
46 @param BufferSize Size of Buffer, must be a multiple of device block size.
47 @param Buffer A pointer to the source buffer for the data.
49 @retval EFI_SUCCESS The data was written correctly to the device.
50 @retval EFI_WRITE_PROTECTED The device can not be written to.
51 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
52 @retval EFI_NO_MEDIA There is no media in the device.
53 @retval EFI_MEDIA_CHANGED The MediaId does not match the current device.
54 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
55 @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
56 or the buffer is not on proper alignment.
61 XenPvBlkDxeBlockIoWriteBlocks (
62 IN EFI_BLOCK_IO_PROTOCOL
*This
,
70 Flush the Block Device.
72 @param This Indicates a pointer to the calling context.
74 @retval EFI_SUCCESS All outstanding data was written to the device
75 @retval EFI_DEVICE_ERROR The device reported an error while writing back the data
76 @retval EFI_NO_MEDIA There is no media in the device.
81 XenPvBlkDxeBlockIoFlushBlocks (
82 IN EFI_BLOCK_IO_PROTOCOL
*This
86 Reset the block device hardware.
88 @param[in] This Indicates a pointer to the calling context.
89 @param[in] ExtendedVerification Not used.
91 @retval EFI_SUCCESS The device was reset.
96 XenPvBlkDxeBlockIoReset (
97 IN EFI_BLOCK_IO_PROTOCOL
*This
,
98 IN BOOLEAN ExtendedVerification
101 extern EFI_BLOCK_IO_MEDIA gXenPvBlkDxeBlockIoMedia
;
102 extern EFI_BLOCK_IO_PROTOCOL gXenPvBlkDxeBlockIo
;