TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
#define | NVME_NO_DEALLOCATE_AFTER_SANITZE 0x1 |
Functions | |
EFI_STATUS | NvmExpressFormatNvm (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 NamespaceId, IN UINT32 Ses, IN UINT32 Flbas) |
EFI_STATUS | NvmExpressSanitize (IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 NamespaceId, IN UINT32 SanitizeAction, IN UINT32 NoDeallocAfterSanitize, IN UINT32 OverwritePattern) |
EFI_STATUS EFIAPI | NvmExpressMediaClear (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 PassCount, IN VOID *SectorOwBuffer) |
EFI_STATUS EFIAPI | NvmExpressMediaPurge (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 PurgeAction, IN UINT32 OverwritePattern) |
EFI_STATUS EFIAPI | NvmExpressMediaFormat (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 LbaSize, IN UINT32 SecureEraseAction) |
Header file for MEDIA_SANITIZE_PROTOCOL interface.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file NvmExpressMediaSanitize.h.
#define NVME_NO_DEALLOCATE_AFTER_SANITZE 0x1 |
Definition at line 12 of file NvmExpressMediaSanitize.h.
EFI_STATUS NvmExpressFormatNvm | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | NamespaceId, | ||
IN UINT32 | Ses, | ||
IN UINT32 | Flbas | ||
) |
Send NVM Express FormatNVM Admin Command
The Format NVM command is used to low level format the NVM media. This command is used by the host to change the LBA data size and/or metadata size.
A low level format may destroy all data and metadata associated with all namespaces or only the specific namespace associated with the command (refer to the Format NVM Attributes field in the Identify Controller data structure).
After the Format NVM command successfully completes, the controller shall not return any user data that was previously contained in an affected namespace.
[in] | This | Indicates a pointer to the calling context (Block IO Protocol) |
[in] | NamespaceId | The NVM Express namespace ID for which a device path node is to be allocated and built. Caller must set the NamespaceId to zero if the device path node will contain a valid UUID. |
[in] | Ses | Secure Erase Setting (SES) value
|
[in] | Flbas | New LBA size (in terms of LBA Format size Index (bits 3:0) in NamespaceData). If this param is 0 (NULL), then use existing LBA size. |
EFI_SUCCESS | The device formatted correctly. |
EFI_WRITE_PROTECTED | The device can not be formatted due to write protection. |
EFI_DEVICE_ERROR | The device reported an error while performing the format. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHNAGED | The MediaId does not matched the current device. |
EFI_INVALID_PARAMETER | The format request contains parameters that are not valid. |
Definition at line 52 of file NvmExpressMediaSanitize.c.
EFI_STATUS EFIAPI NvmExpressMediaClear | ( | IN MEDIA_SANITIZE_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN UINT32 | PassCount, | ||
IN VOID * | SectorOwBuffer | ||
) |
Clear Media utilizes transport native WRITE commands to write a fixed pattern of non-sensitive data to the media.
NOTE: The caller shall send buffer of one sector/LBA size with overwrite data. NOTE: This operation is a blocking call. NOTE: This function must be called from TPL_APPLICATION or TPL_CALLBACK.
Functions are defined to erase and purge data at a block level from mass storage devices as well as to manage such devices in the EFI boot services environment.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | The media ID that the write request is for. |
[in] | PassCount | The number of passes to write over media. |
[in] | SectorOwBuffer | A pointer to the overwrite buffer. |
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_INVALID_PARAMETER | The write request contains LBAs that are not valid, or the buffer is not on proper alignment. |
Definition at line 326 of file NvmExpressMediaSanitize.c.
EFI_STATUS EFIAPI NvmExpressMediaFormat | ( | IN MEDIA_SANITIZE_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN UINT32 | LbaSize, | ||
IN UINT32 | SecureEraseAction | ||
) |
Format Media utilizes native format operations to modify sector/LBA size. Secure erase actions are used to define how latent user data is erased.
NOTE: This function must be called from TPL_APPLICATION or TPL_CALLBACK.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | The media ID that the clear request is for. |
[in] | LbaSize | Size of LBA (in terms of power of two: 2^n). |
[in] | SecureEraseAction | Secure erase action, if any, to apply to format.
|
EFI_SUCCESS | The media format request completed successfully on the device. |
EFI_WRITE_PROTECTED | The device can't be formatted due to write protection. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the format operation. |
EFI_INVALID_PARAMETER | The format request contains parameters that are not valid. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
Format Media utilizes native format operations to modify sector/LBA size. Secure erase actions are used to define how latent user data is erased.
NOTE: This function must be called from TPL_APPLICATION or TPL_CALLBACK.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | The media ID that the clear request is for. |
[in] | LbaSize | Size of LBA (in terms of power of two: 2^n). |
[in] | SecureEraseAction | Secure erase action, if any, to apply to format.
|
EFI_SUCCESS | The media format request comopleted successfully on the device. |
EFI_WRITE_PROTECTED | The device can't be formatted due to write protection. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the format operation. |
EFI_INVALID_PARAMETER | The format request contains parameters that are not valid. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHANGED | The MediaId is not for the current media. |
Definition at line 503 of file NvmExpressMediaSanitize.c.
EFI_STATUS EFIAPI NvmExpressMediaPurge | ( | IN MEDIA_SANITIZE_PROTOCOL * | This, |
IN UINT32 | MediaId, | ||
IN UINT32 | PurgeAction, | ||
IN UINT32 | OverwritePattern | ||
) |
Purge Media utilizes transport native Sanitize operations. Sanitize specific purge actions include: overwrite, block erase, or crypto erase.
Functions are defined to erase and purge data at a block level from mass storage devices as well as to manage such devices in the EFI boot services environment. Sanitization refers to a process that renders access to target data on the media infeasible for a given level of effort.
NOTE: This operation is a blocking call. NOTE: This function must be called from TPL_APPLICATION or TPL_CALLBACK.
[in] | This | Indicates a pointer to the calling context. |
[in] | MediaId | The media ID that the write request is for. |
[in] | PurgeAction | The purage action (overwrite, crypto erase, block erase). |
[in] | OverwritePattern | 32-bit pattern to overwrite on media (for overwrite). |
EFI_SUCCESS | The media was purged successfully on the device. |
EFI_WRITE_PROTECTED | The device can not be purged due to write protection. |
EFI_DEVICE_ERROR | The device reported an error while performing the purge. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHNAGED | The MediaId does not match the current device. |
EFI_INVALID_PARAMETER | The purge request contains parameters that are not valid. |
Definition at line 413 of file NvmExpressMediaSanitize.c.
EFI_STATUS NvmExpressSanitize | ( | IN EFI_BLOCK_IO_PROTOCOL * | This, |
IN UINT32 | NamespaceId, | ||
IN UINT32 | SanitizeAction, | ||
IN UINT32 | NoDeallocAfterSanitize, | ||
IN UINT32 | OverwritePattern | ||
) |
Send NVM Express Sanitize Admin Command
The Sanitize command is used to start a sanitize operation or to recover from a previously failed sanitize operation. The sanitize operation types that may be supported are Block Erase, Crypto Erase, and Overwrite.
All sanitize operations are processed in the background (i.e., completion of the Sanitize command does not indicate completion of the sanitize operation).
[in] | This | Indicates a pointer to the calling context (Block IO Protocol) |
[in] | NamespaceId | The NVM Express namespace ID for which a device path node is to be allocated and built. Caller must set the NamespaceId to zero if the device path node will contain a valid UUID. |
[in] | SanitizeAction | Sanitize action |
[in] | NoDeallocAfterSanitize | No deallocate after sanitize option |
[in] | OverwritePattern | Pattern to overwrite old user data |
EFI_SUCCESS | The media was sanitized successfully on the device. |
EFI_WRITE_PROTECTED | The device can not be sanitized due to write protection. |
EFI_DEVICE_ERROR | The device reported an error while performing the sanitize. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_MEDIA_CHNAGED | The MediaId does not match the current device. |
EFI_INVALID_PARAMETER | The sanitize request contains parameters that are not valid. |
Definition at line 196 of file NvmExpressMediaSanitize.c.