]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLibInternal.h
SecurityPkg: Tpm2DeviceLib: Enable CapCRBIdleBypass support
[mirror_edk2.git] / SecurityPkg / Library / TcgStorageOpalLib / TcgStorageOpalLibInternal.h
1 /** @file
2 Internal functions for Opal Core library.
3
4 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _OPAL_INTERNAL_H_
16 #define _OPAL_INTERNAL_H_
17
18 #include <Library/TcgStorageOpalLib.h>
19
20
21 /**
22
23 The function retrieves the MSID from the device specified
24
25 @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_ANYBODY_AUTHORITY
26 @param[out] ActiveDataRemovalMechanism Active Data Removal Mechanism that the device will use for Revert/RevertSP calls.
27
28 **/
29 TCG_RESULT
30 OpalPyrite2GetActiveDataRemovalMechanism (
31 OPAL_SESSION *AdminSpSession,
32 UINT8 *ActiveDataRemovalMechanism
33 );
34
35 /**
36
37 Get the support attribute info.
38
39 @param[in] Session OPAL_SESSION with OPAL_UID_LOCKING_SP to retrieve info.
40 @param[in] FeatureCode The feature code user request.
41 @param[in, out] DataSize The data size.
42 @param[out] Data The data buffer used to save the feature descriptor.
43
44 **/
45 TCG_RESULT
46 OpalGetFeatureDescriptor (
47 IN OPAL_SESSION *Session,
48 IN UINT16 FeatureCode,
49 IN OUT UINTN *DataSize,
50 OUT VOID *Data
51 );
52
53 /**
54 Get revert timeout value.
55
56 @param[in] Session The session info for one opal device.
57
58 **/
59 UINT32
60 GetRevertTimeOut (
61 IN OPAL_SESSION *Session
62 );
63
64 /**
65
66 Reverts device using Admin SP Revert method.
67
68 @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_PSID_AUTHORITY to perform PSID revert.
69 @param[in] EstimateTimeCost Input the timeout value.
70
71 **/
72 TCG_RESULT
73 OpalPyrite2PsidRevert(
74 OPAL_SESSION *AdminSpSession,
75 UINT32 EstimateTimeCost
76 );
77
78 /**
79
80 The function calls the Admin SP RevertSP method on the Locking SP. If KeepUserData is True, then the optional parameter
81 to keep the user Data is set to True, otherwise the optional parameter is not provided.
82
83 @param[in] LockingSpSession OPAL_SESSION with OPAL_UID_LOCKING_SP as OPAL_LOCKING_SP_ADMIN1_AUTHORITY to revertSP
84 @param[in] KeepUserData Specifies whether or not to keep user Data when performing RevertSP action. True = keeps user Data.
85 @param[in/out] MethodStatus Method status of last action performed. If action succeeded, it should be TCG_METHOD_STATUS_CODE_SUCCESS.
86 @param[in] EstimateTimeCost Input the timeout value.
87
88 **/
89 TCG_RESULT
90 OpalPyrite2AdminRevert(
91 OPAL_SESSION *LockingSpSession,
92 BOOLEAN KeepUserData,
93 UINT8 *MethodStatus,
94 UINT32 EstimateTimeCost
95 );
96
97 #endif // _OPAL_CORE_H_