SecurityPkg Tpm2DeviceLibDTpm: Update enum type name to match the one in lib
[mirror_edk2.git] / SecurityPkg / Library / Tcg2PpVendorLibNull / Tcg2PpVendorLibNull.c
CommitLineData
1abfa4ce
JY
1/** @file\r
2 NULL Tcg2 PP Vendor library instance that does not support any vendor specific PPI.\r
3\r
4Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <Library/DebugLib.h>\r
16#include <Library/Tcg2PpVendorLib.h>\r
17\r
18/**\r
19 Check and execute the requested physical presence command.\r
20\r
21 This API should be invoked in BIOS boot phase to process pending request.\r
22 \r
23 Caution: This function may receive untrusted input.\r
24 \r
25 If OperationRequest < 128, then ASSERT().\r
26\r
27 @param[in] PlatformAuth platform auth value. NULL means no platform auth change.\r
28 @param[in] OperationRequest TPM physical presence operation request.\r
29 @param[in, out] ManagementFlags BIOS TPM Management Flags.\r
30 @param[out] ResetRequired If reset is required to vendor settings in effect.\r
31 True, it indicates the reset is required.\r
32 False, it indicates the reset is not required.\r
33\r
34 @return TPM Operation Response to OS Environment.\r
35**/\r
36UINT32\r
37EFIAPI\r
38Tcg2PpVendorLibExecutePendingRequest (\r
39 IN TPM2B_AUTH *PlatformAuth, OPTIONAL\r
40 IN UINT32 OperationRequest,\r
41 IN OUT UINT32 *ManagementFlags,\r
42 OUT BOOLEAN *ResetRequired\r
43 )\r
44{\r
45 ASSERT (OperationRequest >= TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
46 return TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE;\r
47}\r
48\r
49/**\r
50 Check if there is a valid physical presence command request.\r
51\r
52 This API should be invoked in BIOS boot phase to process pending request.\r
53 \r
54 Caution: This function may receive untrusted input.\r
55\r
56 If OperationRequest < 128, then ASSERT().\r
57\r
58 @param[in] OperationRequest TPM physical presence operation request.\r
59 @param[in] ManagementFlags BIOS TPM Management Flags.\r
60 @param[out] RequestConfirmed If the physical presence operation command required user confirm from UI.\r
61 True, it indicates the command doesn't require user confirm.\r
62 False, it indicates the command need user confirm from UI.\r
63\r
64 @retval TRUE Physical Presence operation command is valid.\r
65 @retval FALSE Physical Presence operation command is invalid.\r
66**/\r
67BOOLEAN\r
68EFIAPI\r
69Tcg2PpVendorLibHasValidRequest (\r
70 IN UINT32 OperationRequest,\r
71 IN UINT32 ManagementFlags,\r
72 OUT BOOLEAN *RequestConfirmed\r
73 )\r
74{\r
75 ASSERT (OperationRequest >= TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
76 return FALSE;\r
77}\r
78\r
79/**\r
80 The callback for TPM vendor specific physical presence which is called for\r
81 Submit TPM Operation Request to Pre-OS Environment and\r
82 Submit TPM Operation Request to Pre-OS Environment 2.\r
83\r
84 This API should be invoked in OS runtime phase to interface with ACPI method.\r
85\r
86 Caution: This function may receive untrusted input.\r
87 \r
88 If OperationRequest < 128, then ASSERT().\r
89\r
90 @param[in] OperationRequest TPM physical presence operation request.\r
91 @param[in] ManagementFlags BIOS TPM Management Flags.\r
92 @param[in] RequestParameter Extra parameter from the passed package.\r
93\r
94 @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
95 Submit TPM Operation Request to Pre-OS Environment 2.\r
96**/\r
97UINT32\r
98EFIAPI\r
99Tcg2PpVendorLibSubmitRequestToPreOSFunction (\r
100 IN UINT32 OperationRequest,\r
101 IN UINT32 ManagementFlags,\r
102 IN UINT32 RequestParameter\r
103 )\r
104{\r
105 ASSERT (OperationRequest >= TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
106 return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;\r
107}\r
108\r
109/**\r
110 The callback for TPM vendor specific physical presence which is called for\r
111 Get User Confirmation Status for Operation.\r
112\r
113 This API should be invoked in OS runtime phase to interface with ACPI method.\r
114\r
115 Caution: This function may receive untrusted input.\r
116 \r
117 If OperationRequest < 128, then ASSERT().\r
118\r
119 @param[in] OperationRequest TPM physical presence operation request.\r
120 @param[in] ManagementFlags BIOS TPM Management Flags.\r
121\r
122 @return Return Code for Get User Confirmation Status for Operation.\r
123**/\r
124UINT32\r
125EFIAPI\r
126Tcg2PpVendorLibGetUserConfirmationStatusFunction (\r
127 IN UINT32 OperationRequest,\r
128 IN UINT32 ManagementFlags\r
129 )\r
130{\r
131 ASSERT (OperationRequest >= TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);\r
132 return TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;\r
133}\r