The BlockSid feature is not depend on lock status,
so move the send BlockSid command out of unlock process.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Session.MediaId = 0;\r
Session.OpalBaseComId = OpalDev->OpalBaseComId;\r
\r
Session.MediaId = 0;\r
Session.OpalBaseComId = OpalDev->OpalBaseComId;\r
\r
- if (mSendBlockSID && BlockSidSupport) {\r
- Result = OpalBlockSid (&Session, TRUE);\r
- if (Result != TcgResultSuccess) {\r
- break;\r
- }\r
- }\r
-\r
Result = OpalSupportUnlock (&Session, OpalDev->Password, OpalDev->PasswordLength, NULL);\r
if (Result == TcgResultSuccess) {\r
Status = EFI_SUCCESS;\r
}\r
}\r
\r
Result = OpalSupportUnlock (&Session, OpalDev->Password, OpalDev->PasswordLength, NULL);\r
if (Result == TcgResultSuccess) {\r
Status = EFI_SUCCESS;\r
}\r
}\r
\r
+ if (mSendBlockSID && BlockSidSupport) {\r
+ Result = OpalBlockSid (&Session, TRUE);\r
+ if (Result != TcgResultSuccess) {\r
+ break;\r
+ }\r
+ }\r
+\r
if (OpalDev->DeviceType == OPAL_DEVICE_TYPE_NVME) {\r
if (SubClassCode == PCI_CLASS_MASS_STORAGE_NVM) {\r
Status = NvmeControllerExit (&mNvmeContext);\r
if (OpalDev->DeviceType == OPAL_DEVICE_TYPE_NVME) {\r
if (SubClassCode == PCI_CLASS_MASS_STORAGE_NVM) {\r
Status = NvmeControllerExit (&mNvmeContext);\r