TianoCore EDK2 master
|
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | NvmeBlockIoReset (IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification) |
EFI_STATUS EFIAPI | NvmeBlockIoReadBlocks (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer) |
EFI_STATUS EFIAPI | NvmeBlockIoWriteBlocks (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_STATUS EFIAPI | NvmeBlockIoFlushBlocks (IN EFI_BLOCK_IO_PROTOCOL *This) |
EFI_STATUS EFIAPI | NvmeBlockIoResetEx (IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification) |
EFI_STATUS EFIAPI | NvmeBlockIoReadBlocksEx (IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer) |
EFI_STATUS EFIAPI | NvmeBlockIoWriteBlocksEx (IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_STATUS EFIAPI | NvmeBlockIoFlushBlocksEx (IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token) |
EFI_STATUS EFIAPI | NvmeStorageSecurityReceiveData (IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, OUT VOID *PayloadBuffer, OUT UINTN *PayloadTransferSize) |
EFI_STATUS EFIAPI | NvmeStorageSecuritySendData (IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, IN VOID *PayloadBuffer) |
Header file for EFI_BLOCK_IO_PROTOCOL interface.
Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file NvmExpressBlockIo.h.
EFI_STATUS EFIAPI NvmeBlockIoFlushBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This | ) |
Flush the Block Device.
This | Indicates a pointer to the calling context. |
EFI_SUCCESS | All outstanding data was written to the device |
EFI_DEVICE_ERROR | The device reported an error while writing back the data |
EFI_NO_MEDIA | There is no media in the device. |
Flush the Block Device.
This | Indicates a pointer to the calling context. |
EFI_SUCCESS | All outstanding data was written to the device. |
EFI_DEVICE_ERROR | The device reported an error while writing back the data. |
EFI_NO_MEDIA | There is no media in the device. |
Definition at line 1186 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoFlushBlocksEx | ( | IN EFI_BLOCK_IO2_PROTOCOL * | This, |
IN OUT EFI_BLOCK_IO2_TOKEN * | Token | ||
) |
Flush the Block Device.
If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.
[in] | This | Indicates a pointer to the calling context. |
[in,out] | Token | A pointer to the token associated with the transaction. |
EFI_SUCCESS | The flush request was queued if Event is not NULL. All outstanding data was written correctly to the device if the Event is NULL. |
EFI_DEVICE_ERROR | The device reported an error while writting back the data. |
EFI_WRITE_PROTECTED | The device cannot be written to. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
Definition at line 1525 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoReadBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Read BufferSize bytes from Lba into Buffer.
This | Indicates a pointer to the calling context. |
MediaId | Id of the media, changes every time the media is replaced. |
Lba | The starting Logical Block Address to read from |
BufferSize | Size of Buffer, must be a multiple of device block size. |
Buffer | A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer. |
EFI_SUCCESS | The data was read correctly from the device. |
EFI_DEVICE_ERROR | The device reported an error while performing the read. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId does not matched the current device. |
EFI_BAD_BUFFER_SIZE | The Buffer was not a multiple of the block size of the device. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Read BufferSize bytes from Lba into Buffer.
This | Indicates a pointer to the calling context. |
MediaId | Id of the media, changes every time the media is replaced. |
Lba | The starting Logical Block Address to read from. |
BufferSize | Size of Buffer, must be a multiple of device block size. |
Buffer | A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer. |
EFI_SUCCESS | The data was read correctly from the device. |
EFI_DEVICE_ERROR | The device reported an error while performing the read. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId does not matched the current device. |
EFI_BAD_BUFFER_SIZE | The Buffer was not a multiple of the block size of the device. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Simulated BlockIo read block function.
[in] | This | BlockIo Protocol. |
[in] | MediaId | Id of the media. |
[in] | Lba | Logical Block Address. |
[in] | BufferSize | Size of Buffer. |
[out] | Buffer | Actual buffer to use to read. |
Definition at line 1027 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoReadBlocksEx | ( | IN EFI_BLOCK_IO2_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN OUT EFI_BLOCK_IO2_TOKEN * | Token, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Read BufferSize bytes from Lba into Buffer.
This function reads the requested number of blocks from the device. All the blocks are read, or an error is returned. If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | Id of the media, changes every time the media is replaced. |
[in] | Lba | The starting Logical Block Address to read from. |
[in,out] | Token | A pointer to the token associated with the transaction. |
[in] | BufferSize | Size of Buffer, must be a multiple of device block size. |
[out] | Buffer | A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer. |
EFI_SUCCESS | The read request was queued if Token->Event is not NULL.The data was read correctly from the device if the Token->Event is NULL. |
EFI_DEVICE_ERROR | The device reported an error while performing the read. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_BAD_BUFFER_SIZE | The BufferSize parameter is not a multiple of the intrinsic block size of the device. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not on proper alignment. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
Simulated BlockIo read block ex function.
[in] | This | BlockIo2 Protocol. |
[in] | MediaId | Id of the media. |
[in] | Lba | Logical Block Address. |
[in,out] | Token | Block Io2 token. |
[in] | BufferSize | Size of Buffer. |
[out] | Buffer | Actual buffer to use to read. |
Definition at line 1313 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoReset | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the Block Device.
This | Indicates a pointer to the calling context. |
ExtendedVerification | Driver may perform diagnostics on reset. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The device is not functioning properly and could not be reset. |
Definition at line 972 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoResetEx | ( | IN EFI_BLOCK_IO2_PROTOCOL * | This, |
IN BOOLEAN | ExtendedVerification | ||
) |
Reset the block device hardware.
[in] | This | Indicates a pointer to the calling context. |
[in] | ExtendedVerification | Indicates that the driver may perform a more exhausive verfication operation of the device during reset. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The device is not functioning properly and could not be reset. |
Definition at line 1227 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoWriteBlocks | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Write BufferSize bytes from Lba into Buffer.
This | Indicates a pointer to the calling context. |
MediaId | The media ID that the write request is for. |
Lba | The starting logical block address to be written. The caller is responsible for writing to only legitimate locations. |
BufferSize | Size of Buffer, must be a multiple of device block size. |
Buffer | A pointer to the source buffer for the data. |
EFI_SUCCESS | The data was written correctly to the device. |
EFI_WRITE_PROTECTED | The device can not be written to. |
EFI_DEVICE_ERROR | The device reported an error while performing the write. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHNAGED | The MediaId does not matched the current device. |
EFI_BAD_BUFFER_SIZE | The Buffer was not a multiple of the block size of the device. |
EFI_INVALID_PARAMETER | The write request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Simulated BlockIo write block function.
[in] | This | BlockIo Protocol. |
[in] | MediaId | Id of the media. |
[in] | Lba | Logical Block Address. |
[in] | BufferSize | Size of Buffer. |
[in] | Buffer | Actual buffer to use to write. |
Definition at line 1111 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeBlockIoWriteBlocksEx | ( | IN EFI_BLOCK_IO2_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN EFI_LBA | Lba, | ||
IN OUT EFI_BLOCK_IO2_TOKEN * | Token, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Write BufferSize bytes from Lba into Buffer.
This function writes the requested number of blocks to the device. All blocks are written, or an error is returned.If EFI_DEVICE_ERROR, EFI_NO_MEDIA, EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | The media ID that the write request is for. |
[in] | Lba | The starting logical block address to be written. The caller is responsible for writing to only legitimate locations. |
[in,out] | Token | A pointer to the token associated with the transaction. |
[in] | BufferSize | Size of Buffer, must be a multiple of device block size. |
[in] | Buffer | A pointer to the source buffer for the data. |
EFI_SUCCESS | The write request was queued if Event is not NULL. The data was written correctly to the device if the Event is NULL. |
EFI_WRITE_PROTECTED | The device can not be written to. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHNAGED | The MediaId does not matched the current device. |
EFI_DEVICE_ERROR | The device reported an error while performing the write. |
EFI_BAD_BUFFER_SIZE | The Buffer was not a multiple of the block size of the device. |
EFI_INVALID_PARAMETER | The write request contains LBAs that are not valid, or the buffer is not on proper alignment. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
Simulated BlockIo write block ex function.
[in] | This | BlockIo2 Protocol. |
[in] | MediaId | Id of the media. |
[in] | Lba | Logical Block Address. |
[in,out] | Token | Block Io2 token. |
[in] | BufferSize | Size of Buffer. |
[in] | Buffer | Actual buffer to use to write. |
Definition at line 1426 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeStorageSecurityReceiveData | ( | IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN UINT64 | Timeout, | ||
IN UINT8 | SecurityProtocolId, | ||
IN UINT16 | SecurityProtocolSpecificData, | ||
IN UINTN | PayloadBufferSize, | ||
OUT VOID * | PayloadBuffer, | ||
OUT UINTN * | PayloadTransferSize | ||
) |
Send a security protocol command to a device that receives data and/or the result of one or more commands sent by SendData.
The ReceiveData function sends a security protocol command to the given MediaId. The security protocol command sent is defined by SecurityProtocolId and contains the security protocol specific data SecurityProtocolSpecificData. The function returns the data from the security protocol command in PayloadBuffer.
For devices supporting the SCSI command set, the security protocol command is sent using the SECURITY PROTOCOL IN command defined in SPC-4.
For devices supporting the ATA command set, the security protocol command is sent using one of the TRUSTED RECEIVE commands defined in ATA8-ACS if PayloadBufferSize is non-zero.
If the PayloadBufferSize is zero, the security protocol command is sent using the Trusted Non-Data command defined in ATA8-ACS.
If PayloadBufferSize is too small to store the available data from the security protocol command, the function shall copy PayloadBufferSize bytes into the PayloadBuffer and return EFI_WARN_BUFFER_TOO_SMALL.
If PayloadBuffer or PayloadTransferSize is NULL and PayloadBufferSize is non-zero, the function shall return EFI_INVALID_PARAMETER.
If the given MediaId does not support security protocol commands, the function shall return EFI_UNSUPPORTED. If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.
If the security protocol fails to complete within the Timeout period, the function shall return EFI_TIMEOUT.
If the security protocol command completes without an error, the function shall return EFI_SUCCESS. If the security protocol command completes with an error, the function shall return EFI_DEVICE_ERROR.
This | Indicates a pointer to the calling context. |
MediaId | ID of the medium to receive data from. If there is no block IO protocol supported by the physical device, the value of MediaId is undefined. |
Timeout | The timeout, in 100ns units, to use for the execution of the security protocol command. A Timeout value of 0 means that this function will wait indefinitely for the security protocol command to execute. If Timeout is greater than zero, then this function will return EFI_TIMEOUT if the time required to execute the receive data command is greater than Timeout. |
SecurityProtocolId | The value of the "Security Protocol" parameter of the security protocol command to be sent. |
SecurityProtocolSpecificData | The value of the "Security Protocol Specific" parameter of the security protocol command to be sent. |
PayloadBufferSize | Size in bytes of the payload data buffer. |
PayloadBuffer | A pointer to a destination buffer to store the security protocol command specific payload data for the security protocol command. The caller is responsible for having either implicit or explicit ownership of the buffer. |
PayloadTransferSize | A pointer to a buffer to store the size in bytes of the data written to the payload data buffer. |
EFI_SUCCESS | The security protocol command completed successfully. |
EFI_WARN_BUFFER_TOO_SMALL | The PayloadBufferSize was too small to store the available data from the device. The PayloadBuffer contains the truncated data. |
EFI_UNSUPPORTED | The given MediaId does not support security protocol commands. |
EFI_DEVICE_ERROR | The security protocol command completed with an error. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_INVALID_PARAMETER | The PayloadBuffer or PayloadTransferSize is NULL and PayloadBufferSize is non-zero. |
EFI_TIMEOUT | A timeout occurred while waiting for the security protocol command to execute. |
Definition at line 1739 of file NvmExpressBlockIo.c.
EFI_STATUS EFIAPI NvmeStorageSecuritySendData | ( | IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN UINT64 | Timeout, | ||
IN UINT8 | SecurityProtocolId, | ||
IN UINT16 | SecurityProtocolSpecificData, | ||
IN UINTN | PayloadBufferSize, | ||
IN VOID * | PayloadBuffer | ||
) |
Send a security protocol command to a device.
The SendData function sends a security protocol command containing the payload PayloadBuffer to the given MediaId. The security protocol command sent is defined by SecurityProtocolId and contains the security protocol specific data SecurityProtocolSpecificData. If the underlying protocol command requires a specific padding for the command payload, the SendData function shall add padding bytes to the command payload to satisfy the padding requirements.
For devices supporting the SCSI command set, the security protocol command is sent using the SECURITY PROTOCOL OUT command defined in SPC-4.
For devices supporting the ATA command set, the security protocol command is sent using one of the TRUSTED SEND commands defined in ATA8-ACS if PayloadBufferSize is non-zero. If the PayloadBufferSize is zero, the security protocol command is sent using the Trusted Non-Data command defined in ATA8-ACS.
If PayloadBuffer is NULL and PayloadBufferSize is non-zero, the function shall return EFI_INVALID_PARAMETER.
If the given MediaId does not support security protocol commands, the function shall return EFI_UNSUPPORTED. If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.
If the security protocol fails to complete within the Timeout period, the function shall return EFI_TIMEOUT.
If the security protocol command completes without an error, the function shall return EFI_SUCCESS. If the security protocol command completes with an error, the function shall return EFI_DEVICE_ERROR.
This | Indicates a pointer to the calling context. |
MediaId | ID of the medium to receive data from. If there is no block IO protocol supported by the physical device, the value of MediaId is undefined. |
Timeout | The timeout, in 100ns units, to use for the execution of the security protocol command. A Timeout value of 0 means that this function will wait indefinitely for the security protocol command to execute. If Timeout is greater than zero, then this function will return EFI_TIMEOUT if the time required to execute the receive data command is greater than Timeout. |
SecurityProtocolId | The value of the "Security Protocol" parameter of the security protocol command to be sent. |
SecurityProtocolSpecificData | The value of the "Security Protocol Specific" parameter of the security protocol command to be sent. |
PayloadBufferSize | Size in bytes of the payload data buffer. |
PayloadBuffer | A pointer to a destination buffer to store the security protocol command specific payload data for the security protocol command. |
EFI_SUCCESS | The security protocol command completed successfully. |
EFI_UNSUPPORTED | The given MediaId does not support security protocol commands. |
EFI_DEVICE_ERROR | The security protocol command completed with an error. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_INVALID_PARAMETER | The PayloadBuffer is NULL and PayloadBufferSize is non-zero. |
EFI_TIMEOUT | A timeout occurred while waiting for the security protocol command to execute. |
Send a security protocol command to a device.
The SendData function sends a security protocol command containing the payload PayloadBuffer to the given MediaId. The security protocol command sent is defined by SecurityProtocolId and contains the security protocol specific data SecurityProtocolSpecificData. If the underlying protocol command requires a specific padding for the command payload, the SendData function shall add padding bytes to the command payload to satisfy the padding requirements.
For devices supporting the SCSI command set, the security protocol command is sent using the SECURITY PROTOCOL OUT command defined in SPC-4.
For devices supporting the ATA command set, the security protocol command is sent using one of the TRUSTED SEND commands defined in ATA8-ACS if PayloadBufferSize is non-zero. If the PayloadBufferSize is zero, the security protocol command is sent using the Trusted Non-Data command defined in ATA8-ACS.
If PayloadBuffer is NULL and PayloadBufferSize is non-zero, the function shall return EFI_INVALID_PARAMETER.
If the given MediaId does not support security protocol commands, the function shall return EFI_UNSUPPORTED. If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.
If the security protocol fails to complete within the Timeout period, the function shall return EFI_TIMEOUT.
If the security protocol command completes without an error, the function shall return EFI_SUCCESS. If the security protocol command completes with an error, the function shall return EFI_DEVICE_ERROR.
This | Indicates a pointer to the calling context. |
MediaId | ID of the medium to receive data from. If there is no block IO protocol supported by the physical device, the value of MediaId is undefined. |
Timeout | The timeout, in 100ns units, to use for the execution of the security protocol command. A Timeout value of 0 means that this function will wait indefinitely for the security protocol command to execute. If Timeout is greater than zero, then this function will return EFI_TIMEOUT if the time required to execute the send data command is greater than Timeout. |
SecurityProtocolId | The value of the "Security Protocol" parameter of the security protocol command to be sent. |
SecurityProtocolSpecificData | The value of the "Security Protocol Specific" parameter of the security protocol command to be sent. |
PayloadBufferSize | Size in bytes of the payload data buffer. |
PayloadBuffer | A pointer to a destination buffer to store the security protocol command specific payload data for the security protocol command. |
EFI_SUCCESS | The security protocol command completed successfully. |
EFI_UNSUPPORTED | The given MediaId does not support security protocol commands. |
EFI_DEVICE_ERROR | The security protocol command completed with an error. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
EFI_INVALID_PARAMETER | The PayloadBuffer is NULL and PayloadBufferSize is non-zero. |
EFI_TIMEOUT | A timeout occurred while waiting for the security protocol command to execute. |
Definition at line 1848 of file NvmExpressBlockIo.c.