Pyrite support - Secure erase is only available if encryption is supported.

https://bugzilla.tianocore.org/show_bug.cgi?id=3004

Cc: Qi Zhang    <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Jiewen Yao  <jiewen.yao@intel.com>
Cc: Tina Chen   <tina.chen@intel.com>
Cc: Xiao X Chen <xiao.x.chen@intel.com>
Signed-off-by: Linus Liu <linus.liu@intel.com>
Reviewed-by: Jiewen Yao  <jiewen.yao@intel.com>
This commit is contained in:
Linus Liu 2023-09-12 09:41:59 +08:00 committed by mergify[bot]
parent 4a1afea6f7
commit cdfe4310dd
1 changed files with 5 additions and 1 deletions

View File

@ -87,7 +87,11 @@ OpalSupportGetAvailableActions (
// Secure erase is performed by generating a new encryption key
// this is only available if encryption is supported
//
AvalDiskActions->SecureErase = 1;
if (SupportedAttributes->MediaEncryption) {
AvalDiskActions->SecureErase = 1;
} else {
AvalDiskActions->SecureErase = 0;
}
} else {
AvalDiskActions->PsidRevert = 0;
AvalDiskActions->SecureErase = 0;