TianoCore EDK2 master
Loading...
Searching...
No Matches
MediaSanitize.h File Reference

Go to the source code of this file.

Data Structures

struct  _MEDIA_SANITIZE_PROTOCOL
 

Macros

#define MEDIA_SANITIZE_PROTOCOL_GUID
 
#define MEDIA_SANITIZE_PROTOCOL_REVISION   0x00010000
 
#define PURGE_ACTION_NO_ACTION   0x00000000
 
#define PURGE_ACTION_OVERWRITE   0x00000001
 
#define PURGE_ACTION_BLOCK_ERASE   0x00000002
 
#define PURGE_ACTION_CRYPTO_ERASE   0x00000004
 
#define PURGE_ACTION_RESET_REQUIRED   0x00000008
 
#define PURGE_ACTION_NO_DEALLOCATE   0x00000010
 
#define PURGE_ACTION_INVERT_OW_PATTERN   0x00000020
 
#define PURGE_ACTION_ALLOW_UNRESTRICTED_SANITIZE_EXIT   0x00000040
 
#define FORMAT_SES_NO_SECURE_ERASE_REQUESTED   0x0
 
#define FORMAT_SES_USER_DATA_ERASE   0x1
 
#define FORMAT_SES_CRYPTOGRAPHIC_ERASE   0x2
 

Typedefs

typedef struct _MEDIA_SANITIZE_PROTOCOL MEDIA_SANITIZE_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_CLEAR) (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 PassCount, IN VOID *SectorOwBuffer)
 
typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_PURGE) (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 PurgeAction, IN UINT32 OverwritePattern)
 
typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_FORMAT) (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 LbaSize, IN UINT32 SecureEraseAction)
 

Variables

EFI_GUID gMediaSanitizeProtocolGuid
 

Detailed Description

This file defines the Media Sanitize Protocol.

Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file MediaSanitize.h.

Macro Definition Documentation

◆ FORMAT_SES_CRYPTOGRAPHIC_ERASE

#define FORMAT_SES_CRYPTOGRAPHIC_ERASE   0x2

Definition at line 41 of file MediaSanitize.h.

◆ FORMAT_SES_NO_SECURE_ERASE_REQUESTED

#define FORMAT_SES_NO_SECURE_ERASE_REQUESTED   0x0

Secure erase action for media format operation

Definition at line 39 of file MediaSanitize.h.

◆ FORMAT_SES_USER_DATA_ERASE

#define FORMAT_SES_USER_DATA_ERASE   0x1

Definition at line 40 of file MediaSanitize.h.

◆ MEDIA_SANITIZE_PROTOCOL_GUID

#define MEDIA_SANITIZE_PROTOCOL_GUID
Value:
{ \
0x0d799a99, 0x25af, 0x429e, { 0x92, 0x72, 0xd0, 0xb2, 0x7d, 0x6d, 0x5f, 0x14 } \
}

Definition at line 12 of file MediaSanitize.h.

◆ MEDIA_SANITIZE_PROTOCOL_REVISION

#define MEDIA_SANITIZE_PROTOCOL_REVISION   0x00010000

Definition at line 19 of file MediaSanitize.h.

◆ PURGE_ACTION_ALLOW_UNRESTRICTED_SANITIZE_EXIT

#define PURGE_ACTION_ALLOW_UNRESTRICTED_SANITIZE_EXIT   0x00000040

Definition at line 34 of file MediaSanitize.h.

◆ PURGE_ACTION_BLOCK_ERASE

#define PURGE_ACTION_BLOCK_ERASE   0x00000002

Definition at line 29 of file MediaSanitize.h.

◆ PURGE_ACTION_CRYPTO_ERASE

#define PURGE_ACTION_CRYPTO_ERASE   0x00000004

Definition at line 30 of file MediaSanitize.h.

◆ PURGE_ACTION_INVERT_OW_PATTERN

#define PURGE_ACTION_INVERT_OW_PATTERN   0x00000020

Definition at line 33 of file MediaSanitize.h.

◆ PURGE_ACTION_NO_ACTION

#define PURGE_ACTION_NO_ACTION   0x00000000

Sanitize actions for purge operation.

NOTE: First four actions (no action, overwrite, block erase, crypto erase) cannot be overlapped. All other fields may be overlapped as they apply.

Definition at line 27 of file MediaSanitize.h.

◆ PURGE_ACTION_NO_DEALLOCATE

#define PURGE_ACTION_NO_DEALLOCATE   0x00000010

Definition at line 32 of file MediaSanitize.h.

◆ PURGE_ACTION_OVERWRITE

#define PURGE_ACTION_OVERWRITE   0x00000001

Definition at line 28 of file MediaSanitize.h.

◆ PURGE_ACTION_RESET_REQUIRED

#define PURGE_ACTION_RESET_REQUIRED   0x00000008

Definition at line 31 of file MediaSanitize.h.

Typedef Documentation

◆ BLOCK_MEDIA_CLEAR

typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_CLEAR) (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. The size of the overwrite buffer shall be equal to the one sector/LBA (in bytes).

NOTE: This function must be called from TPL aaplication or callback.

Parameters
[in]ThisIndicates a pointer to the calling context.
[in]MediaIdThe media ID that the clear request is for.
[in]PassCountNumber of passes to write over the media.
[in]SectorOwBufferPointer to overwrite pattern buffer.
Return values
EFI_SUCCESSThe media clear request completed successfully on the device.
EFI_WRITE_PROTECTEDThe device can't be cleared due to write protection.
EFI_DEVICE_ERRORThe device reported an error while attempting to perform the clear operation.
EFI_INVALID_PARAMETERThe clear request contains parameters that are not valid.
EFI_NO_MEDIAThere is no media in the device.
EFI_MEDIA_CHANGEDThe MediaId is not for the current media.

Definition at line 68 of file MediaSanitize.h.

◆ BLOCK_MEDIA_FORMAT

typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_FORMAT) (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 aaplication or callback.

Parameters
[in]ThisIndicates a pointer to the calling context.
[in]MediaIdThe media ID that the clear request is for.
[in]LbaSizeSize of LBA (in terms of power of two: 2^n).
[in]SecureEraseActionSecure erase action, if any, to apply to format.
Return values
EFI_SUCCESSThe media format request comopleted successfully on the device.
EFI_WRITE_PROTECTEDThe device can't be formatted due to write protection.
EFI_DEVICE_ERRORThe device reported an error while attempting to perform the format operation.
EFI_INVALID_PARAMETERThe format request contains parameters that are not valid.
EFI_NO_MEDIAThere is no media in the device.
EFI_MEDIA_CHANGEDThe MediaId is not for the current media.

Definition at line 133 of file MediaSanitize.h.

◆ BLOCK_MEDIA_PURGE

typedef EFI_STATUS(EFIAPI * BLOCK_MEDIA_PURGE) (IN MEDIA_SANITIZE_PROTOCOL *This, IN UINT32 MediaId, IN UINT32 PurgeAction, IN UINT32 OverwritePattern)

Purge Media utilizes native Sanitize operations. Transport specific overwrite, block erase, or crypto erase functions shall be invoked based on transport.

NOTE: This function must be called from TPL aaplication or callback.

Parameters
[in]ThisIndicates a pointer to the calling context.
[in]MediaIdThe media ID that the clear request is for.
[in]PurgeActionPurge action: overwrite, crypto or block erase.
[in]OverwritePattern32-bit pattern to overwrite on media.
Return values
EFI_SUCCESSThe media purge request completed successfully on the device.
EFI_WRITE_PROTECTEDThe device can't be purged due to write protection.
EFI_DEVICE_ERRORThe device reported an error while attempting to perform the purge operation.
EFI_INVALID_PARAMETERThe purge request contains parameters that are not valid.
EFI_NO_MEDIAThere is no media in the device.
EFI_MEDIA_CHANGEDThe MediaId is not for the current media.

Definition at line 101 of file MediaSanitize.h.

◆ MEDIA_SANITIZE_PROTOCOL

Definition at line 17 of file MediaSanitize.h.