1 /** @file 2 Internal functions for Opal Core library. 3 4 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> 5 SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 **/ 8 9 #ifndef _OPAL_INTERNAL_H_ 10 #define _OPAL_INTERNAL_H_ 11 12 #include <Library/TcgStorageOpalLib.h> 13 14 15 /** 16 17 The function retrieves the MSID from the device specified 18 19 @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_ANYBODY_AUTHORITY 20 @param[out] ActiveDataRemovalMechanism Active Data Removal Mechanism that the device will use for Revert/RevertSP calls. 21 22 **/ 23 TCG_RESULT 24 OpalPyrite2GetActiveDataRemovalMechanism ( 25 OPAL_SESSION *AdminSpSession, 26 UINT8 *ActiveDataRemovalMechanism 27 ); 28 29 /** 30 31 Get the support attribute info. 32 33 @param[in] Session OPAL_SESSION with OPAL_UID_LOCKING_SP to retrieve info. 34 @param[in] FeatureCode The feature code user request. 35 @param[in, out] DataSize The data size. 36 @param[out] Data The data buffer used to save the feature descriptor. 37 38 **/ 39 TCG_RESULT 40 OpalGetFeatureDescriptor ( 41 IN OPAL_SESSION *Session, 42 IN UINT16 FeatureCode, 43 IN OUT UINTN *DataSize, 44 OUT VOID *Data 45 ); 46 47 /** 48 Get revert timeout value. 49 50 @param[in] Session The session info for one opal device. 51 52 **/ 53 UINT32 54 GetRevertTimeOut ( 55 IN OPAL_SESSION *Session 56 ); 57 58 /** 59 60 Reverts device using Admin SP Revert method. 61 62 @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_PSID_AUTHORITY to perform PSID revert. 63 @param[in] EstimateTimeCost Input the timeout value. 64 65 **/ 66 TCG_RESULT 67 OpalPyrite2PsidRevert( 68 OPAL_SESSION *AdminSpSession, 69 UINT32 EstimateTimeCost 70 ); 71 72 /** 73 74 The function calls the Admin SP RevertSP method on the Locking SP. If KeepUserData is True, then the optional parameter 75 to keep the user Data is set to True, otherwise the optional parameter is not provided. 76 77 @param[in] LockingSpSession OPAL_SESSION with OPAL_UID_LOCKING_SP as OPAL_LOCKING_SP_ADMIN1_AUTHORITY to revertSP 78 @param[in] KeepUserData Specifies whether or not to keep user Data when performing RevertSP action. True = keeps user Data. 79 @param[in/out] MethodStatus Method status of last action performed. If action succeeded, it should be TCG_METHOD_STATUS_CODE_SUCCESS. 80 @param[in] EstimateTimeCost Input the timeout value. 81 82 **/ 83 TCG_RESULT 84 OpalPyrite2AdminRevert( 85 OPAL_SESSION *LockingSpSession, 86 BOOLEAN KeepUserData, 87 UINT8 *MethodStatus, 88 UINT32 EstimateTimeCost 89 ); 90 91 #endif // _OPAL_CORE_H_ 92