TianoCore EDK2 master
|
#include "NvmExpress.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | ReadSectors (IN NVME_DEVICE_PRIVATE_DATA *Device, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks) |
EFI_STATUS | WriteSectors (IN NVME_DEVICE_PRIVATE_DATA *Device, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks) |
EFI_STATUS | NvmeRead (IN NVME_DEVICE_PRIVATE_DATA *Device, OUT VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks) |
EFI_STATUS | NvmeWrite (IN NVME_DEVICE_PRIVATE_DATA *Device, IN VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks) |
EFI_STATUS | NvmeFlush (IN NVME_DEVICE_PRIVATE_DATA *Device) |
VOID EFIAPI | AsyncIoCallback (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS | AsyncReadSectors (IN NVME_DEVICE_PRIVATE_DATA *Device, IN NVME_BLKIO2_REQUEST *Request, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks, IN BOOLEAN IsLast) |
EFI_STATUS | AsyncWriteSectors (IN NVME_DEVICE_PRIVATE_DATA *Device, IN NVME_BLKIO2_REQUEST *Request, IN UINT64 Buffer, IN UINT64 Lba, IN UINT32 Blocks, IN BOOLEAN IsLast) |
EFI_STATUS | NvmeAsyncRead (IN NVME_DEVICE_PRIVATE_DATA *Device, OUT VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks, IN EFI_BLOCK_IO2_TOKEN *Token) |
EFI_STATUS | NvmeAsyncWrite (IN NVME_DEVICE_PRIVATE_DATA *Device, IN VOID *Buffer, IN UINT64 Lba, IN UINTN Blocks, IN EFI_BLOCK_IO2_TOKEN *Token) |
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 | TrustTransferNvmeDevice (IN OUT NVME_CONTROLLER_PRIVATE_DATA *Private, IN OUT VOID *Buffer, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN TransferLength, IN BOOLEAN IsTrustSend, IN UINT64 Timeout, OUT UINTN *TransferLengthOut) |
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) |
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows NVM Express specification.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file NvmExpressBlockIo.c.
Nonblocking I/O callback funtion when the event is signaled.
[in] | Event | The Event this notify function registered to. |
[in] | Context | Pointer to the context data registered to the Event. |
Definition at line 370 of file NvmExpressBlockIo.c.
EFI_STATUS AsyncReadSectors | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN NVME_BLKIO2_REQUEST * | Request, | ||
IN UINT64 | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINT32 | Blocks, | ||
IN BOOLEAN | IsLast | ||
) |
Read some sectors from the device in an asynchronous manner.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Request | The pointer to the NVME_BLKIO2_REQUEST data structure. |
Buffer | The buffer used to store the data read from the device. |
Lba | The start block number. |
Blocks | Total block number to be read. |
IsLast | The last subtask of an asynchronous read request. |
EFI_SUCCESS | Asynchronous read request has been queued. |
Others | Fail to send the asynchronous request. |
Definition at line 440 of file NvmExpressBlockIo.c.
EFI_STATUS AsyncWriteSectors | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN NVME_BLKIO2_REQUEST * | Request, | ||
IN UINT64 | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINT32 | Blocks, | ||
IN BOOLEAN | IsLast | ||
) |
Write some sectors from the device in an asynchronous manner.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Request | The pointer to the NVME_BLKIO2_REQUEST data structure. |
Buffer | The buffer used to store the data written to the device. |
Lba | The start block number. |
Blocks | Total block number to be written. |
IsLast | The last subtask of an asynchronous write request. |
EFI_SUCCESS | Asynchronous write request has been queued. |
Others | Fail to send the asynchronous request. |
Definition at line 579 of file NvmExpressBlockIo.c.
EFI_STATUS NvmeAsyncRead | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
OUT VOID * | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINTN | Blocks, | ||
IN EFI_BLOCK_IO2_TOKEN * | Token | ||
) |
Read some blocks from the device in an asynchronous manner.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer used to store the data read from the device. |
Lba | The start block number. |
Blocks | Total block number to be read. |
Token | A pointer to the token associated with the transaction. |
EFI_SUCCESS | Data are read from the device. |
Others | Fail to read all the data. |
Definition at line 719 of file NvmExpressBlockIo.c.
EFI_STATUS NvmeAsyncWrite | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN VOID * | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINTN | Blocks, | ||
IN EFI_BLOCK_IO2_TOKEN * | Token | ||
) |
Write some blocks from the device in an asynchronous manner.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer used to store the data written to the device. |
Lba | The start block number. |
Blocks | Total block number to be written. |
Token | A pointer to the token associated with the transaction. |
EFI_SUCCESS | Data are written to the device. |
Others | Fail to write all the data. |
Definition at line 847 of file NvmExpressBlockIo.c.
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. |
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. |
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. |
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. |
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. |
Definition at line 1426 of file NvmExpressBlockIo.c.
EFI_STATUS NvmeFlush | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device | ) |
Flushes all modified data to the device.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
EFI_SUCCESS | Datum are written into the buffer. |
Others | Fail to write all the datum. |
Definition at line 326 of file NvmExpressBlockIo.c.
EFI_STATUS NvmeRead | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
OUT VOID * | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINTN | Blocks | ||
) |
Read some blocks from the device.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer used to store the data read from the device. |
Lba | The start block number. |
Blocks | Total block number to be read. |
EFI_SUCCESS | Datum are read from the device. |
Others | Fail to read all the datum. |
Definition at line 157 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 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.
EFI_STATUS NvmeWrite | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN VOID * | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINTN | Blocks | ||
) |
Write some blocks to the device.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer to be written into the device. |
Lba | The start block number. |
Blocks | Total block number to be written. |
EFI_SUCCESS | Datum are written into the buffer. |
Others | Fail to write all the datum. |
Definition at line 243 of file NvmExpressBlockIo.c.
EFI_STATUS ReadSectors | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN UINT64 | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINT32 | Blocks | ||
) |
Read some sectors from the device.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer used to store the data read from the device. |
Lba | The start block number. |
Blocks | Total block number to be read. |
EFI_SUCCESS | Datum are read from the device. |
Others | Fail to read all the datum. |
Definition at line 25 of file NvmExpressBlockIo.c.
EFI_STATUS TrustTransferNvmeDevice | ( | IN OUT NVME_CONTROLLER_PRIVATE_DATA * | Private, |
IN OUT VOID * | Buffer, | ||
IN UINT8 | SecurityProtocolId, | ||
IN UINT16 | SecurityProtocolSpecificData, | ||
IN UINTN | TransferLength, | ||
IN BOOLEAN | IsTrustSend, | ||
IN UINT64 | Timeout, | ||
OUT UINTN * | TransferLengthOut | ||
) |
Trust transfer data from/to NVMe device.
This function performs one NVMe transaction to do a trust transfer from/to NVMe device.
Private | The pointer to the NVME_CONTROLLER_PRIVATE_DATA data structure. |
Buffer | The pointer to the current transaction buffer. |
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. |
TransferLength | The block number or sector count of the transfer. |
IsTrustSend | Indicates whether it is a trust send operation or not. |
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. |
TransferLengthOut | A pointer to a buffer to store the size in bytes of the data written to the buffer. Ignore it when IsTrustSend is TRUE. |
EFI_SUCCESS | The data transfer is complete successfully. |
Definition at line 1597 of file NvmExpressBlockIo.c.
EFI_STATUS WriteSectors | ( | IN NVME_DEVICE_PRIVATE_DATA * | Device, |
IN UINT64 | Buffer, | ||
IN UINT64 | Lba, | ||
IN UINT32 | Blocks | ||
) |
Write some sectors to the device.
Device | The pointer to the NVME_DEVICE_PRIVATE_DATA data structure. |
Buffer | The buffer to be written into the device. |
Lba | The start block number. |
Blocks | Total block number to be written. |
EFI_SUCCESS | Datum are written into the buffer. |
Others | Fail to write all the datum. |
Definition at line 88 of file NvmExpressBlockIo.c.