]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg OpalPasswordDxe: gray out menu instead of suppress it.
authorEric Dong <eric.dong@intel.com>
Wed, 25 May 2016 00:28:46 +0000 (08:28 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 16 Jun 2016 02:41:37 +0000 (10:41 +0800)
For current implementation, if the device is pyrite type, driver
will suppress the "keep user data" option. Base on the feedback
from user, they prefer to keep the menu but gray out it. Now base
on this feedback to update the driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c

index 33f74dd4a3475ae9e3ada018604b09e9d286ddd7..7a4b8720487da4e9df863a16ba8d5490c3d3ca2b 100644 (file)
@@ -329,13 +329,7 @@ HiiSelectDiskAction (
 \r
     case HII_KEY_ID_GOTO_REVERT:\r
       gHiiConfiguration.AvailableFields |= HII_FIELD_PASSWORD;\r
-      if (OpalDisk->SupportedAttributes.PyriteSsc != 1) {\r
-        //\r
-        // According to current Pyrite SSC Spec 1.00, there is no parameter for RevertSP method.\r
-        // So issue RevertSP method without any parameter by suppress KeepUserData option.\r
-        //\r
-        gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA;\r
-      }\r
+      gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA;\r
       if (AvailActions.RevertKeepDataForced) {\r
         gHiiConfiguration.AvailableFields |= HII_FIELD_KEEP_USER_DATA_FORCED;\r
       }\r
@@ -573,14 +567,6 @@ HiiPopulateDiskInfoForm(
         // Default initialize keep user Data to be true\r
         //\r
         gHiiConfiguration.KeepUserData = 1;\r
-        if (OpalDisk->SupportedAttributes.PyriteSsc == 1) {\r
-          //\r
-          // According to current Pyrite SSC Spec 1.00, there is no parameter for RevertSP method.\r
-          // So issue RevertSP method without any parameter by set default value to FALSE.\r
-          //\r
-          gHiiConfiguration.KeepUserData = 0;\r
-        }\r
-\r
       }\r
     }\r
   }\r
@@ -1073,8 +1059,15 @@ HiiPasswordEntered(
   } else if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_DISABLE_USER) {\r
     Status = HiiDisableUser (OpalDisk, Password, PassLength);\r
   } else if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_REVERT) {\r
-    DEBUG ((DEBUG_INFO, "gHiiConfiguration.KeepUserData %u\n", gHiiConfiguration.KeepUserData));\r
-    Status = HiiRevert(OpalDisk, Password, PassLength, gHiiConfiguration.KeepUserData);\r
+    if (OpalDisk->SupportedAttributes.PyriteSsc == 1 && OpalDisk->LockingFeature.MediaEncryption == 0) {\r
+      //\r
+      // For pyrite type device which also not supports media encryption, it not accept "Keep User Data" parameter.\r
+      // So here hardcode a FALSE for this case.\r
+      //\r
+      Status = HiiRevert(OpalDisk, Password, PassLength, FALSE);\r
+    } else {\r
+      Status = HiiRevert(OpalDisk, Password, PassLength, gHiiConfiguration.KeepUserData);\r
+    }\r
   } else {\r
     Status = HiiSetPassword(OpalDisk, Password, PassLength);\r
   }\r