20 UINT8 HardwareReset : 1;
25#define TRUSTED_COMMAND_TIMEOUT_NS ((UINT64) 5 * ((UINT64)(1000000)) * 1000)
26#define BUFFER_SIZE 512
44 UINT8 SecurityProtocol,
51 UINTN TransferLength512;
57 TransferLength512 = (TransferLength + 511) & ~(
UINTN)511;
59 if (TransferLength512 > BufferSize) {
60 return TcgResultFailureBufferTooSmall;
63 ZeroMem ((UINT8 *)Buffer + TransferLength, TransferLength512 - TransferLength);
65 Status = Sscp->SendData (
68 TRUSTED_COMMAND_TIMEOUT_NS,
75 return Status ==
EFI_SUCCESS ? TcgResultSuccess : TcgResultFailure;
95 UINT8 SecurityProtocol,
99 UINT32 EstimateTimeCost
102 UINTN TransferLength512;
106 UINT32 OutstandingData;
113 TransferLength512 = BufferSize & ~(
UINTN)511;
120 DEBUG ((DEBUG_INFO,
"transferLength %u too small for ComPacket\n", TransferLength512));
121 return TcgResultFailureBufferTooSmall;
133 if (EstimateTimeCost > 10) {
134 Tries = EstimateTimeCost * 500;
139 while ((Tries--) > 0) {
143 Status = Sscp->ReceiveData (
146 TRUSTED_COMMAND_TIMEOUT_NS,
153 if (EFI_ERROR (Status)) {
154 return TcgResultFailure;
157 if ((SecurityProtocol != TCG_OPAL_SECURITY_PROTOCOL_1) && (SecurityProtocol != TCG_OPAL_SECURITY_PROTOCOL_2)) {
158 return TcgResultSuccess;
161 if (SpSpecific == TCG_SP_SPECIFIC_PROTOCOL_LEVEL0_DISCOVERY) {
162 return TcgResultSuccess;
167 OutstandingData =
SwapBytes32 (ComPacket->OutstandingDataBE);
169 if ((Length != 0) && (OutstandingData == 0)) {
170 return TcgResultSuccess;
179 return TcgResultFailure;
202 UINT32 EstimateTimeCost
205 NULL_CHECK (Session);
206 NULL_CHECK (MethodStatus);
212 TCG_OPAL_SECURITY_PROTOCOL_1,
213 Session->OpalBaseComId,
224 TCG_OPAL_SECURITY_PROTOCOL_1,
225 Session->OpalBaseComId,
233 ERROR_CHECK (
TcgCheckComIds (ParseStruct, Session->OpalBaseComId, Session->ComIdExtension));
236 return TcgResultSuccess;
250 BOOLEAN HardwareReset
253 UINT8 Buffer[BUFFER_SIZE];
256 NULL_CHECK (Session);
263 ClearEvents->Reserved = 0;
264 ClearEvents->HardwareReset = HardwareReset;
269 TCG_OPAL_SECURITY_PROTOCOL_2,
298 UINT8 Buffer[BUFFER_SIZE];
301 NULL_CHECK (AdminSpSession);
307 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, AdminSpSession->OpalBaseComId, AdminSpSession->ComIdExtension));
308 ERROR_CHECK (
TcgStartPacket (&CreateStruct, AdminSpSession->TperSessionId, AdminSpSession->HostSessionId, 0x0, 0x0, 0x0));
310 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_UID_ADMIN_SP, OPAL_ADMIN_SP_REVERT_METHOD));
321 ERROR_CHECK (
OpalPerformMethod (AdminSpSession, Size, Buffer, BUFFER_SIZE, &ParseStruct, &MethodStatus, 0));
322 METHOD_STATUS_ERROR_CHECK (MethodStatus, TcgResultFailure);
324 return TcgResultSuccess;
338 UINT32 EstimateTimeCost
349 UINT8 Buffer[BUFFER_SIZE];
352 NULL_CHECK (AdminSpSession);
358 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, AdminSpSession->OpalBaseComId, AdminSpSession->ComIdExtension));
359 ERROR_CHECK (
TcgStartPacket (&CreateStruct, AdminSpSession->TperSessionId, AdminSpSession->HostSessionId, 0x0, 0x0, 0x0));
361 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_UID_ADMIN_SP, OPAL_ADMIN_SP_REVERT_METHOD));
372 ERROR_CHECK (
OpalPerformMethod (AdminSpSession, Size, Buffer, BUFFER_SIZE, &ParseStruct, &MethodStatus, EstimateTimeCost));
373 METHOD_STATUS_ERROR_CHECK (MethodStatus, TcgResultFailure);
375 return TcgResultSuccess;
399 TCG_OPAL_SECURITY_PROTOCOL_1,
400 TCG_SP_SPECIFIC_PROTOCOL_LEVEL0_DISCOVERY,
428 TCG_SECURITY_PROTOCOL_INFO,
429 TCG_SP_SPECIFIC_PROTOCOL_LIST,
460 UINT32 HostChallengeLength,
461 const VOID *HostChallenge,
469 UINT8 Buf[BUFFER_SIZE];
470 UINT16 ComIdExtension;
471 UINT32 HostSessionId;
476 NULL_CHECK (Session);
477 NULL_CHECK (MethodStatus);
479 Session->ComIdExtension = ComIdExtension;
480 Session->HostSessionId = HostSessionId;
487 Session->OpalBaseComId,
497 ERROR_CHECK (
OpalPerformMethod (Session, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
498 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
499 return TcgResultSuccess;
502 if (
TcgParseSyncSession (&ParseStruct, Session->OpalBaseComId, ComIdExtension, HostSessionId, &Session->TperSessionId) != TcgResultSuccess) {
504 return TcgResultFailure;
507 return TcgResultSuccess;
522 UINT8 Buffer[BUFFER_SIZE];
527 NULL_CHECK (Session);
533 Session->OpalBaseComId,
534 Session->ComIdExtension,
535 Session->HostSessionId,
536 Session->TperSessionId
544 TCG_OPAL_SECURITY_PROTOCOL_1,
545 Session->OpalBaseComId,
556 TCG_OPAL_SECURITY_PROTOCOL_1,
557 Session->OpalBaseComId,
565 ERROR_CHECK (
TcgCheckComIds (&ParseStruct, Session->OpalBaseComId, Session->ComIdExtension));
568 return TcgResultSuccess;
585 UINT32 MsidBufferSize,
600 const VOID *RecvMsid;
601 UINT8 Buffer[BUFFER_SIZE];
603 NULL_CHECK (AdminSpSession);
605 NULL_CHECK (MsidLength);
608 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, AdminSpSession->OpalBaseComId, AdminSpSession->ComIdExtension));
609 ERROR_CHECK (
TcgStartPacket (&CreateStruct, AdminSpSession->TperSessionId, AdminSpSession->HostSessionId, 0x0, 0x0, 0x0));
611 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_UID_ADMIN_SP_C_PIN_MSID, TCG_UID_METHOD_GET));
615 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_START_COLUMN_NAME));
616 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_ADMIN_SP_PIN_COL));
619 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_END_COLUMN_NAME));
620 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_ADMIN_SP_PIN_COL));
632 ERROR_CHECK (
OpalPerformMethod (AdminSpSession, Size, Buffer, BUFFER_SIZE, &ParseStruct, &MethodStatus, 0));
633 METHOD_STATUS_ERROR_CHECK (MethodStatus, TcgResultFailure);
645 if (Col != OPAL_ADMIN_SP_PIN_COL) {
646 DEBUG ((DEBUG_INFO,
"ERROR: got col %u, expected %u\n", Col, OPAL_ADMIN_SP_PIN_COL));
647 return TcgResultFailure;
650 if (RecvMsid ==
NULL) {
651 return TcgResultFailure;
654 if (MsidBufferSize < *MsidLength) {
655 DEBUG ((DEBUG_INFO,
"Buffer too small MsidBufferSize: %d MsidLength: %d\n", MsidBufferSize, *MsidLength));
656 return TcgResultFailureBufferTooSmall;
662 CopyMem (Msid, RecvMsid, *MsidLength);
663 return TcgResultSuccess;
677 OUT UINT8 *ActiveDataRemovalMechanism
685 UINT8 RecvActiveDataRemovalMechanism;
686 UINT8 Buffer[BUFFER_SIZE];
688 NULL_CHECK (AdminSpSession);
689 NULL_CHECK (ActiveDataRemovalMechanism);
692 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, AdminSpSession->OpalBaseComId, AdminSpSession->ComIdExtension));
693 ERROR_CHECK (
TcgStartPacket (&CreateStruct, AdminSpSession->TperSessionId, AdminSpSession->HostSessionId, 0x0, 0x0, 0x0));
695 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_UID_ADMIN_SP_DATA_REMOVAL_MECHANISM, TCG_UID_METHOD_GET));
699 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_START_COLUMN_NAME));
700 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL));
703 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_END_COLUMN_NAME));
704 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL));
716 ERROR_CHECK (
OpalPerformMethod (AdminSpSession, Size, Buffer, BUFFER_SIZE, &ParseStruct, &MethodStatus, 0));
717 METHOD_STATUS_ERROR_CHECK (MethodStatus, TcgResultFailure);
723 ERROR_CHECK (
TcgGetNextUINT8 (&ParseStruct, &RecvActiveDataRemovalMechanism));
729 if (Col != OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL) {
730 DEBUG ((DEBUG_INFO,
"ERROR: got col %u, expected %u\n", Col, OPAL_ADMIN_SP_ACTIVE_DATA_REMOVAL_MECHANISM_COL));
731 return TcgResultFailure;
734 if (RecvActiveDataRemovalMechanism >= ResearvedMechanism) {
735 return TcgResultFailure;
741 CopyMem (ActiveDataRemovalMechanism, &RecvActiveDataRemovalMechanism,
sizeof (RecvActiveDataRemovalMechanism));
742 return TcgResultSuccess;
759 BOOLEAN KeepUserData,
763 UINT8 Buf[BUFFER_SIZE];
769 NULL_CHECK (LockingSpSession);
770 NULL_CHECK (MethodStatus);
786 if ((Ret != TcgResultSuccess) || (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS)) {
795 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
796 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
798 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, TCG_UID_THIS_SP, OPAL_LOCKING_SP_REVERTSP_METHOD));
820 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
825 if (*MethodStatus == TCG_METHOD_STATUS_CODE_SUCCESS) {
829 return TcgResultSuccess;
834 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
837 return TcgResultSuccess;
854 BOOLEAN KeepUserData,
856 UINT32 EstimateTimeCost
859 UINT8 Buf[BUFFER_SIZE];
865 NULL_CHECK (LockingSpSession);
866 NULL_CHECK (MethodStatus);
882 if ((Ret != TcgResultSuccess) || (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS)) {
891 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
892 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
894 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, TCG_UID_THIS_SP, OPAL_LOCKING_SP_REVERTSP_METHOD));
916 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, EstimateTimeCost));
921 if (*MethodStatus == TCG_METHOD_STATUS_CODE_SUCCESS) {
925 return TcgResultSuccess;
930 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
933 return TcgResultSuccess;
953 UINT8 Buf[BUFFER_SIZE];
958 NULL_CHECK (AdminSpSession);
959 NULL_CHECK (MethodStatus);
965 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, AdminSpSession->OpalBaseComId, AdminSpSession->ComIdExtension));
966 ERROR_CHECK (
TcgStartPacket (&CreateStruct, AdminSpSession->TperSessionId, AdminSpSession->HostSessionId, 0x0, 0x0, 0x0));
968 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_UID_LOCKING_SP, OPAL_ADMIN_SP_ACTIVATE_METHOD));
979 ERROR_CHECK (
OpalPerformMethod (AdminSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
980 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
982 return TcgResultSuccess;
1002 UINT32 NewPinLength,
1006 UINT8 Buf[BUFFER_SIZE];
1011 NULL_CHECK (Session);
1012 NULL_CHECK (NewPin);
1013 NULL_CHECK (MethodStatus);
1020 Session->OpalBaseComId,
1021 Session->ComIdExtension,
1022 Session->TperSessionId,
1023 Session->HostSessionId,
1030 ERROR_CHECK (
OpalPerformMethod (Session, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1032 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
1034 return TcgResultSuccess;
1057 UINT32 NewPinLength,
1061 UINT8 Buf[BUFFER_SIZE];
1068 NULL_CHECK (LockingSpSession);
1069 NULL_CHECK (NewPin);
1070 NULL_CHECK (MethodStatus);
1077 LockingSpSession->OpalBaseComId,
1078 LockingSpSession->ComIdExtension,
1079 LockingSpSession->TperSessionId,
1080 LockingSpSession->HostSessionId,
1086 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1088 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
1089 DEBUG ((DEBUG_INFO,
"Send Set Authority error\n"));
1090 return TcgResultFailure;
1099 LockingSpSession->OpalBaseComId,
1100 LockingSpSession->ComIdExtension,
1101 LockingSpSession->TperSessionId,
1102 LockingSpSession->HostSessionId,
1109 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1119 LockingSpSession->OpalBaseComId,
1120 LockingSpSession->ComIdExtension,
1121 LockingSpSession->TperSessionId,
1122 LockingSpSession->HostSessionId,
1123 OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_RDLOCKED,
1124 OPAL_LOCKING_SP_USER1_AUTHORITY,
1125 TCG_ACE_EXPRESSION_OR,
1126 OPAL_LOCKING_SP_ADMINS_AUTHORITY
1130 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1132 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
1133 DEBUG ((DEBUG_INFO,
"Update ACE for RDLOCKED failed\n"));
1134 return TcgResultFailure;
1142 LockingSpSession->OpalBaseComId,
1143 LockingSpSession->ComIdExtension,
1144 LockingSpSession->TperSessionId,
1145 LockingSpSession->HostSessionId,
1146 OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_SET_WRLOCKED,
1147 OPAL_LOCKING_SP_USER1_AUTHORITY,
1148 TCG_ACE_EXPRESSION_OR,
1149 OPAL_LOCKING_SP_ADMINS_AUTHORITY
1153 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1155 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
1156 DEBUG ((DEBUG_INFO,
"Update ACE for WRLOCKED failed\n"));
1157 return TcgResultFailure;
1162 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1169 if (Ret == TcgResultSuccess) {
1175 LockingSpSession->OpalBaseComId,
1176 LockingSpSession->ComIdExtension,
1177 LockingSpSession->TperSessionId,
1178 LockingSpSession->HostSessionId,
1179 (ActiveKey == OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY) ? OPAL_LOCKING_SP_ACE_K_AES_256_GLOBALRANGE_GENKEY : OPAL_LOCKING_SP_ACE_K_AES_128_GLOBALRANGE_GENKEY,
1180 OPAL_LOCKING_SP_USER1_AUTHORITY,
1181 TCG_ACE_EXPRESSION_OR,
1182 OPAL_LOCKING_SP_ADMINS_AUTHORITY
1186 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1188 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
1189 DEBUG ((DEBUG_INFO,
"Update ACE for GLOBALRANGE_GENKEY failed\n"));
1193 return TcgResultFailure;
1202 LockingSpSession->OpalBaseComId,
1203 LockingSpSession->ComIdExtension,
1204 LockingSpSession->TperSessionId,
1205 LockingSpSession->HostSessionId,
1206 OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_GET_ALL,
1207 OPAL_LOCKING_SP_USER1_AUTHORITY,
1208 TCG_ACE_EXPRESSION_OR,
1209 OPAL_LOCKING_SP_ADMINS_AUTHORITY
1213 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1215 if (*MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {
1216 DEBUG ((DEBUG_INFO,
"Update ACE for OPAL_LOCKING_SP_ACE_LOCKING_GLOBALRANGE_GET_ALL failed\n"));
1217 return TcgResultFailure;
1220 return TcgResultSuccess;
1238 UINT8 Buf[BUFFER_SIZE];
1243 NULL_CHECK (LockingSpSession);
1244 NULL_CHECK (MethodStatus);
1251 LockingSpSession->OpalBaseComId,
1252 LockingSpSession->ComIdExtension,
1253 LockingSpSession->TperSessionId,
1254 LockingSpSession->HostSessionId,
1255 OPAL_LOCKING_SP_USER1_AUTHORITY,
1260 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1262 return TcgResultSuccess;
1281 UINT8 Buf[BUFFER_SIZE];
1287 NULL_CHECK (LockingSpSession);
1288 NULL_CHECK (MethodStatus);
1295 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1297 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
1305 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
1306 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
1316 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1318 return TcgResultSuccess;
1338 BOOLEAN WriteLocked,
1342 UINT8 Buf[BUFFER_SIZE];
1347 NULL_CHECK (LockingSpSession);
1348 NULL_CHECK (MethodStatus);
1355 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
1356 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
1358 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, OPAL_LOCKING_SP_LOCKING_GLOBALRANGE, TCG_UID_METHOD_SET));
1382 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1383 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
1385 return TcgResultSuccess;
1411 BOOLEAN ReadLockEnabled,
1412 BOOLEAN WriteLockEnabled,
1414 BOOLEAN WriteLocked,
1418 UINT8 Buf[BUFFER_SIZE];
1423 NULL_CHECK (LockingSpSession);
1424 NULL_CHECK (MethodStatus);
1431 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
1432 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
1434 ERROR_CHECK (
TcgStartMethodCall (&CreateStruct, LockingRangeUid, TCG_UID_METHOD_SET));
1443 if (LockingRangeUid != OPAL_LOCKING_SP_LOCKING_GLOBALRANGE) {
1446 ERROR_CHECK (
TcgAddUINT64 (&CreateStruct, RangeStart));
1451 ERROR_CHECK (
TcgAddUINT64 (&CreateStruct, RangeLength));
1457 ERROR_CHECK (
TcgAddBOOLEAN (&CreateStruct, ReadLockEnabled));
1462 ERROR_CHECK (
TcgAddBOOLEAN (&CreateStruct, WriteLockEnabled));
1483 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, MethodStatus, 0));
1485 METHOD_STATUS_ERROR_CHECK (*MethodStatus, TcgResultSuccess);
1487 return TcgResultSuccess;
1509 NULL_CHECK (Session);
1510 NULL_CHECK (CreateStruct);
1514 ERROR_CHECK (
TcgStartComPacket (CreateStruct, Session->OpalBaseComId, Session->ComIdExtension));
1515 ERROR_CHECK (
TcgStartPacket (CreateStruct, Session->TperSessionId, Session->HostSessionId, 0x0, 0x0, 0x0));
1517 ERROR_CHECK (
TcgStartMethodCall (CreateStruct, OPAL_LOCKING_SP_LOCKING_GLOBALRANGE, TCG_UID_METHOD_GET));
1521 ERROR_CHECK (
TcgAddUINT8 (CreateStruct, TCG_CELL_BLOCK_START_COLUMN_NAME));
1525 ERROR_CHECK (
TcgAddUINT8 (CreateStruct, TCG_CELL_BLOCK_END_COLUMN_NAME));
1535 return TcgResultSuccess;
1555 NULL_CHECK (ParseStruct);
1556 NULL_CHECK (ActiveKey);
1569 if (ColumnName != 0x0A) {
1570 DEBUG ((DEBUG_INFO,
"Unexpected column name %u (exp 0x0A)\n", ColumnName));
1571 return TcgResultFailure;
1574 if ((*ActiveKey != OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY) && (*ActiveKey != OPAL_LOCKING_SP_K_AES_128_GLOBALRANGE_KEY)) {
1575 DEBUG ((DEBUG_INFO,
"Unexpected gen key %u (exp %u or %u)\n", *ActiveKey, OPAL_LOCKING_SP_K_AES_256_GLOBALRANGE_KEY, OPAL_LOCKING_SP_K_AES_128_GLOBALRANGE_KEY));
1576 return TcgResultFailure;
1579 return TcgResultSuccess;
1603 UINT8 Buf[BUFFER_SIZE];
1606 NULL_CHECK (LockingSpSession);
1607 NULL_CHECK (TryLimit);
1610 ERROR_CHECK (
TcgStartComPacket (&CreateStruct, LockingSpSession->OpalBaseComId, LockingSpSession->ComIdExtension));
1611 ERROR_CHECK (
TcgStartPacket (&CreateStruct, LockingSpSession->TperSessionId, LockingSpSession->HostSessionId, 0x0, 0x0, 0x0));
1617 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_START_COLUMN_NAME));
1618 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL));
1621 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, TCG_CELL_BLOCK_END_COLUMN_NAME));
1622 ERROR_CHECK (
TcgAddUINT8 (&CreateStruct, OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL));
1631 ERROR_CHECK (
OpalPerformMethod (LockingSpSession, Size, Buf,
sizeof (Buf), &ParseStruct, &MethodStatus, 0));
1632 METHOD_STATUS_ERROR_CHECK (MethodStatus, TcgResultFailure);
1644 if (Col != OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL) {
1645 DEBUG ((DEBUG_INFO,
"ERROR: got col %u, expected %u\n", Col, OPAL_LOCKING_SP_C_PIN_TRYLIMIT_COL));
1646 return TcgResultFailure;
1649 return TcgResultSuccess;
1666 OUT UINT16 *OpalBaseComId
1669 UINT8 Buffer[BUFFER_SIZE];
1677 NULL_CHECK (Session);
1678 NULL_CHECK (SupportedAttributes);
1679 NULL_CHECK (OpalBaseComId);
1681 ZeroMem (Buffer, BUFFER_SIZE);
1694 DEBUG ((DEBUG_INFO,
"OpalRetrieveSupportedProtocolList failed\n"));
1695 return TcgResultFailure;
1700 SupportedAttributes->SpIeee1667 =
TcgIsProtocolSupported (SupportedProtocols, TCG_SECURITY_PROTOCOL_IEEE_1667);
1704 "Supported Protocols: Sp1 %d Sp2: %d SpIeee1667 %d \n",
1705 SupportedAttributes->Sp1,
1706 SupportedAttributes->Sp2,
1707 SupportedAttributes->SpIeee1667
1713 ZeroMem (Buffer, BUFFER_SIZE);
1715 DEBUG ((DEBUG_INFO,
"OpalRetrieveLevel0DiscoveryHeader failed\n"));
1716 return TcgResultFailure;
1726 SupportedAttributes->OpalSsc2 = (Feat !=
NULL);
1728 *OpalBaseComId = TCG_RESERVED_COMID;
1737 SupportedAttributes->InitCpinIndicator = (Feat->OpalSscV2.InitialCPINSIDPIN == 0);
1738 SupportedAttributes->CpinUponRevert = (Feat->OpalSscV2.CPINSIDPINRevertBehavior == 0);
1741 "Opal SSC V2 InitCpinIndicator %d CpinUponRevert %d \n",
1742 SupportedAttributes->InitCpinIndicator,
1743 SupportedAttributes->CpinUponRevert
1745 *OpalBaseComId =
SwapBytes16 (Feat->OpalSscV2.BaseComdIdBE);
1750 SupportedAttributes->OpalSscLite = (Feat !=
NULL);
1753 if (*OpalBaseComId == TCG_RESERVED_COMID) {
1757 *OpalBaseComId =
SwapBytes16 (Feat->OpalSscLite.BaseComdIdBE);
1758 SupportedAttributes->InitCpinIndicator = (Feat->OpalSscV2.InitialCPINSIDPIN == 0);
1759 SupportedAttributes->CpinUponRevert = (Feat->OpalSscV2.CPINSIDPINRevertBehavior == 0);
1762 "Opal SSC Lite InitCpinIndicator %d CpinUponRevert %d \n",
1763 SupportedAttributes->InitCpinIndicator,
1764 SupportedAttributes->CpinUponRevert
1778 SupportedAttributes->PyriteSscV2 =
TRUE;
1779 if (*OpalBaseComId == TCG_RESERVED_COMID) {
1780 *OpalBaseComId =
SwapBytes16 (Feat2->PyriteSscV2.BaseComdIdBE);
1781 SupportedAttributes->InitCpinIndicator = (Feat2->PyriteSscV2.InitialCPINSIDPIN == 0);
1782 SupportedAttributes->CpinUponRevert = (Feat2->PyriteSscV2.CPINSIDPINRevertBehavior == 0);
1785 "Pyrite SSC V2 InitCpinIndicator %d CpinUponRevert %d \n",
1786 SupportedAttributes->InitCpinIndicator,
1787 SupportedAttributes->CpinUponRevert
1791 SupportedAttributes->PyriteSsc = (Feat !=
NULL);
1793 if (*OpalBaseComId == TCG_RESERVED_COMID) {
1794 *OpalBaseComId =
SwapBytes16 (Feat->PyriteSsc.BaseComdIdBE);
1795 SupportedAttributes->InitCpinIndicator = (Feat->PyriteSsc.InitialCPINSIDPIN == 0);
1796 SupportedAttributes->CpinUponRevert = (Feat->PyriteSsc.CPINSIDPINRevertBehavior == 0);
1799 "Pyrite SSC InitCpinIndicator %d CpinUponRevert %d \n",
1800 SupportedAttributes->InitCpinIndicator,
1801 SupportedAttributes->CpinUponRevert
1809 SupportedAttributes->OpalSsc1 = (Feat !=
NULL);
1811 if (*OpalBaseComId == TCG_RESERVED_COMID) {
1812 *OpalBaseComId =
SwapBytes16 (Feat->OpalSscV1.BaseComdIdBE);
1819 SupportedAttributes->MediaEncryption = Feat->Locking.MediaEncryption;
1820 DEBUG ((DEBUG_INFO,
"SupportedAttributes->MediaEncryption 0x%X \n", SupportedAttributes->MediaEncryption));
1826 SupportedAttributes->BlockSid =
TRUE;
1827 DEBUG ((DEBUG_INFO,
"BlockSid Supported!!! Current Status is 0x%X \n", Feat->BlockSid.SIDBlockedState));
1829 DEBUG ((DEBUG_INFO,
"BlockSid Unsupported!!!"));
1835 SupportedAttributes->DataRemoval =
TRUE;
1836 DEBUG ((DEBUG_INFO,
"DataRemoval Feature Supported!\n"));
1837 DEBUG ((DEBUG_INFO,
"Operation Processing = 0x%x\n", Feat->DataRemoval.OperationProcessing));
1838 DEBUG ((DEBUG_INFO,
"RemovalMechanism = 0x%x\n", Feat->DataRemoval.RemovalMechanism));
1839 DEBUG ((DEBUG_INFO,
"BIT0 :: Format = 0x%x, Time = 0x%x\n", Feat->DataRemoval.FormatBit0,
SwapBytes16 (Feat->DataRemoval.TimeBit0)));
1840 DEBUG ((DEBUG_INFO,
"BIT1 :: Format = 0x%x, Time = 0x%x\n", Feat->DataRemoval.FormatBit1,
SwapBytes16 (Feat->DataRemoval.TimeBit1)));
1841 DEBUG ((DEBUG_INFO,
"BIT2 :: Format = 0x%x, Time = 0x%x\n", Feat->DataRemoval.FormatBit2,
SwapBytes16 (Feat->DataRemoval.TimeBit2)));
1842 DEBUG ((DEBUG_INFO,
"BIT3 :: Format = 0x%x, Time = 0x%x\n", Feat->DataRemoval.FormatBit3,
SwapBytes16 (Feat->DataRemoval.TimeBit3)));
1843 DEBUG ((DEBUG_INFO,
"BIT4 :: Format = 0x%x, Time = 0x%x\n", Feat->DataRemoval.FormatBit4,
SwapBytes16 (Feat->DataRemoval.TimeBit4)));
1846 DEBUG ((DEBUG_INFO,
"Base COMID 0x%04X \n", *OpalBaseComId));
1848 return TcgResultSuccess;
1866 UINT8 Buffer[BUFFER_SIZE];
1871 NULL_CHECK (Session);
1872 NULL_CHECK (LockingFeature);
1874 ZeroMem (Buffer, BUFFER_SIZE);
1878 DEBUG ((DEBUG_INFO,
"OpalRetrieveLevel0DiscoveryHeader failed\n"));
1879 return TcgResultFailure;
1890 return TcgResultSuccess;
1906 IN UINT16 FeatureCode,
1911 UINT8 Buffer[BUFFER_SIZE];
1916 NULL_CHECK (Session);
1917 NULL_CHECK (DataSize);
1920 ZeroMem (Buffer, BUFFER_SIZE);
1924 DEBUG ((DEBUG_INFO,
"OpalRetrieveLevel0DiscoveryHeader failed\n"));
1925 return TcgResultFailure;
1933 if (Size > *DataSize) {
1935 return TcgResultFailureBufferTooSmall;
1942 return TcgResultSuccess;
1959 NULL_CHECK (SupportedAttributes);
1961 if (SupportedAttributes->Sp1 == 0) {
1965 if ((SupportedAttributes->OpalSscLite == 0) &&
1966 (SupportedAttributes->OpalSsc1 == 0) &&
1967 (SupportedAttributes->OpalSsc2 == 0) &&
1968 (SupportedAttributes->PyriteSsc == 0) &&
1969 (SupportedAttributes->PyriteSscV2 == 0)
1996 NULL_CHECK (SupportedAttributes);
1997 NULL_CHECK (LockingFeature);
2003 if (LockingFeature->LockingSupported && LockingFeature->LockingEnabled) {
2026 NULL_CHECK (SupportedAttributes);
2027 NULL_CHECK (LockingFeature);
2033 return LockingFeature->Locked;
UINTN EFIAPI MicroSecondDelay(IN UINTN MicroSeconds)
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define DEBUG(Expression)
UINT64 TCG_UID
UID in host native byte order.
TCG_RESULT EFIAPI TcgStartMethodCall(TCG_CREATE_STRUCT *CreateStruct, TCG_UID InvokingId, TCG_UID MethodId)
TCG_RESULT EFIAPI TcgGetNextUINT8(TCG_PARSE_STRUCT *ParseStruct, UINT8 *Value)
TCG_RESULT EFIAPI TcgEndComPacket(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size)
BOOLEAN EFIAPI TcgIsProtocolSupported(const TCG_SUPPORTED_SECURITY_PROTOCOLS *ProtocolList, UINT16 Protocol)
TCG_RESULT EFIAPI TcgStartPacket(TCG_CREATE_STRUCT *CreateStruct, UINT32 Tsn, UINT32 Hsn, UINT32 SeqNumber, UINT16 AckType, UINT32 Ack)
TCG_RESULT EFIAPI TcgCreateEndSession(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, UINT32 TpSessionId)
TCG_RESULT EFIAPI TcgSetAuthorityEnabled(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID AuthorityUid, BOOLEAN Enabled)
TCG_RESULT EFIAPI TcgGetNextEndOfSession(TCG_PARSE_STRUCT *ParseStruct)
TCG_LEVEL0_FEATURE_DESCRIPTOR_HEADER *EFIAPI TcgGetFeature(const TCG_LEVEL0_DISCOVERY_HEADER *DiscoveryHeader, UINT16 FeatureCode, UINTN *FeatureSize)
TCG_RESULT EFIAPI TcgGetNextStartList(TCG_PARSE_STRUCT *ParseStruct)
TCG_RESULT EFIAPI TcgGetNextUINT32(TCG_PARSE_STRUCT *ParseStruct, UINT32 *Value)
TCG_RESULT EFIAPI TcgCreateSetAce(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID AceRow, TCG_UID Authority1, BOOLEAN LogicalOperator, TCG_UID Authority2)
TCG_RESULT EFIAPI TcgAddEndList(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgCreateStartSession(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, TCG_UID SpId, BOOLEAN Write, UINT32 HostChallengeLength, const VOID *HostChallenge, TCG_UID HostSigningAuthority)
TCG_RESULT EFIAPI TcgGetNextEndName(TCG_PARSE_STRUCT *ParseStruct)
TCG_RESULT EFIAPI TcgCheckComIds(const TCG_PARSE_STRUCT *ParseStruct, UINT16 ExpectedComId, UINT16 ExpectedComIdExtension)
TCG_RESULT EFIAPI TcgGetNextTcgUid(TCG_PARSE_STRUCT *ParseStruct, TCG_UID *Uid)
TCG_RESULT EFIAPI TcgParseSyncSession(const TCG_PARSE_STRUCT *ParseStruct, UINT16 ComId, UINT16 ComIdExtension, UINT32 HostSessionId, UINT32 *TperSessionId)
TCG_RESULT EFIAPI TcgGetNextByteSequence(TCG_PARSE_STRUCT *ParseStruct, const VOID **Data, UINT32 *Length)
TCG_RESULT EFIAPI TcgGetNextEndList(TCG_PARSE_STRUCT *ParseStruct)
TCG_RESULT EFIAPI TcgAddUINT32(TCG_CREATE_STRUCT *CreateStruct, UINT32 Value)
TCG_RESULT EFIAPI TcgGetNextStartName(TCG_PARSE_STRUCT *ParseStruct)
TCG_RESULT EFIAPI TcgEndMethodCall(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgEndSubPacket(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgInitTcgCreateStruct(TCG_CREATE_STRUCT *CreateStruct, VOID *Buffer, UINT32 BufferSize)
TCG_RESULT EFIAPI TcgAddStartList(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgEndParameters(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgInitTcgParseStruct(TCG_PARSE_STRUCT *ParseStruct, const VOID *Buffer, UINT32 BufferSize)
TCG_RESULT EFIAPI TcgStartSubPacket(TCG_CREATE_STRUCT *CreateStruct, UINT16 Kind)
TCG_RESULT EFIAPI TcgStartComPacket(TCG_CREATE_STRUCT *CreateStruct, UINT16 ComId, UINT16 ComIdExtension)
TCG_RESULT EFIAPI TcgStartParameters(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgEndPacket(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgAddUINT64(TCG_CREATE_STRUCT *CreateStruct, UINT64 Value)
TCG_RESULT EFIAPI TcgAddEndName(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgGetMethodStatus(const TCG_PARSE_STRUCT *ParseStruct, UINT8 *MethodStatus)
TCG_RESULT EFIAPI TcgCreateSetCPin(TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size, UINT16 ComId, UINT16 ComIdExtension, UINT32 TperSession, UINT32 HostSession, TCG_UID SidRow, const VOID *Password, UINT32 PasswordSize)
TCG_RESULT EFIAPI TcgGetNextEndOfData(TCG_PARSE_STRUCT *ParseStruct)
TCG_RESULT EFIAPI TcgAddStartName(TCG_CREATE_STRUCT *CreateStruct)
TCG_RESULT EFIAPI TcgAddBOOLEAN(TCG_CREATE_STRUCT *CreateStruct, BOOLEAN Value)
TCG_RESULT EFIAPI TcgAddUINT8(TCG_CREATE_STRUCT *CreateStruct, UINT8 Value)
BOOLEAN EFIAPI OpalFeatureSupported(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes)
TCG_RESULT OpalPyrite2GetActiveDataRemovalMechanism(IN OPAL_SESSION *AdminSpSession, OUT UINT8 *ActiveDataRemovalMechanism)
TCG_RESULT EFIAPI OpalSetPassword(OPAL_SESSION *Session, TCG_UID CpinRowUid, const VOID *NewPin, UINT32 NewPinLength, UINT8 *MethodStatus)
TCG_RESULT OpalPyrite2AdminRevert(OPAL_SESSION *LockingSpSession, BOOLEAN KeepUserData, UINT8 *MethodStatus, UINT32 EstimateTimeCost)
TCG_RESULT EFIAPI OpalSetLockingSpAuthorityEnabledAndPin(OPAL_SESSION *LockingSpSession, TCG_UID CpinRowUid, TCG_UID AuthorityUid, const VOID *NewPin, UINT32 NewPinLength, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalPerformMethod(OPAL_SESSION *Session, UINT32 SendSize, VOID *Buffer, UINT32 BufferSize, TCG_PARSE_STRUCT *ParseStruct, UINT8 *MethodStatus, UINT32 EstimateTimeCost)
TCG_RESULT EFIAPI OpalBlockSid(OPAL_SESSION *Session, BOOLEAN HardwareReset)
TCG_RESULT EFIAPI OpalGetLockingInfo(OPAL_SESSION *Session, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)
TCG_RESULT EFIAPI OpalEndSession(OPAL_SESSION *Session)
TCG_RESULT EFIAPI OpalSetLockingRange(OPAL_SESSION *LockingSpSession, TCG_UID LockingRangeUid, UINT64 RangeStart, UINT64 RangeLength, BOOLEAN ReadLockEnabled, BOOLEAN WriteLockEnabled, BOOLEAN ReadLocked, BOOLEAN WriteLocked, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalGetTryLimit(OPAL_SESSION *LockingSpSession, TCG_UID RowUid, UINT32 *TryLimit)
TCG_RESULT EFIAPI OpalStartSession(OPAL_SESSION *Session, TCG_UID SpId, BOOLEAN Write, UINT32 HostChallengeLength, const VOID *HostChallenge, TCG_UID HostSigningAuthority, UINT8 *MethodStatus)
BOOLEAN OpalDeviceLocked(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)
TCG_RESULT OpalTrustedSend(EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp, UINT32 MediaId, UINT8 SecurityProtocol, UINT16 SpSpecific, UINTN TransferLength, VOID *Buffer, UINTN BufferSize)
TCG_RESULT EFIAPI OpalGetMsid(OPAL_SESSION *AdminSpSession, UINT32 MsidBufferSize, UINT8 *Msid, UINT32 *MsidLength)
TCG_RESULT EFIAPI OpalParseRetrieveGlobalLockingRangeActiveKey(TCG_PARSE_STRUCT *ParseStruct, TCG_UID *ActiveKey)
TCG_RESULT OpalTrustedRecv(EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp, UINT32 MediaId, UINT8 SecurityProtocol, UINT16 SpSpecific, VOID *Buffer, UINTN BufferSize, UINT32 EstimateTimeCost)
TCG_RESULT EFIAPI OpalRetrieveLevel0DiscoveryHeader(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress)
TCG_RESULT EFIAPI OpalActivateLockingSp(OPAL_SESSION *AdminSpSession, UINT8 *MethodStatus)
TCG_RESULT OpalGetFeatureDescriptor(IN OPAL_SESSION *Session, IN UINT16 FeatureCode, IN OUT UINTN *DataSize, OUT VOID *Data)
TCG_RESULT EFIAPI OpalCreateRetrieveGlobalLockingRangeActiveKey(const OPAL_SESSION *Session, TCG_CREATE_STRUCT *CreateStruct, UINT32 *Size)
TCG_RESULT EFIAPI OpalGetSupportedAttributesInfo(IN OPAL_SESSION *Session, OUT OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, OUT UINT16 *OpalBaseComId)
TCG_RESULT EFIAPI OpalRetrieveSupportedProtocolList(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress)
TCG_RESULT EFIAPI OpalAdminRevert(OPAL_SESSION *LockingSpSession, BOOLEAN KeepUserData, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalDisableUser(OPAL_SESSION *LockingSpSession, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalGlobalLockingRangeGenKey(OPAL_SESSION *LockingSpSession, UINT8 *MethodStatus)
TCG_RESULT EFIAPI OpalPsidRevert(OPAL_SESSION *AdminSpSession)
TCG_RESULT OpalPyrite2PsidRevert(OPAL_SESSION *AdminSpSession, UINT32 EstimateTimeCost)
TCG_RESULT EFIAPI OpalUpdateGlobalLockingRange(OPAL_SESSION *LockingSpSession, BOOLEAN ReadLocked, BOOLEAN WriteLocked, UINT8 *MethodStatus)
BOOLEAN EFIAPI OpalFeatureEnabled(OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes, TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature)