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