2 The header file of HII Config Access protocol implementation of TCG
5 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __TCG_CONFIG_IMPL_H__
17 #define __TCG_CONFIG_IMPL_H__
21 #include <Protocol/HiiConfigAccess.h>
22 #include <Protocol/HiiConfigRouting.h>
23 #include <Protocol/TcgService.h>
25 #include <Library/BaseLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/UefiRuntimeServicesTableLib.h>
31 #include <Library/UefiHiiServicesLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/HiiLib.h>
34 #include <Library/DevicePathLib.h>
35 #include <Library/PcdLib.h>
36 #include <Library/PrintLib.h>
37 #include <Library/TpmCommLib.h>
39 #include <Guid/MdeModuleHii.h>
41 #include "TcgConfigNvData.h"
44 // Tool generated IFR binary data and String package data
46 extern UINT8 TcgConfigBin
[];
47 extern UINT8 TcgConfigDxeStrings
[];
50 /// HII specific Vendor Device Path definition.
53 VENDOR_DEVICE_PATH VendorDevicePath
;
54 EFI_DEVICE_PATH_PROTOCOL End
;
55 } HII_VENDOR_DEVICE_PATH
;
60 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
61 EFI_HII_HANDLE HiiHandle
;
62 EFI_HANDLE DriverHandle
;
64 EFI_TCG_PROTOCOL
*TcgProtocol
;
67 } TCG_CONFIG_PRIVATE_DATA
;
69 extern TCG_CONFIG_PRIVATE_DATA mTcgConfigPrivateDateTemplate
;
71 #define TCG_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'C', 'G', 'D')
72 #define TCG_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TCG_CONFIG_PRIVATE_DATA, ConfigAccess, TCG_CONFIG_PRIVATE_DATA_SIGNATURE)
76 This function publish the TCG configuration Form for TPM device.
78 @param[in, out] PrivateData Points to TCG configuration private data.
80 @retval EFI_SUCCESS HII Form is installed for this network device.
81 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.
82 @retval Others Other errors as indicated.
86 InstallTcgConfigForm (
87 IN OUT TCG_CONFIG_PRIVATE_DATA
*PrivateData
91 This function removes TCG configuration Form.
93 @param[in, out] PrivateData Points to TCG configuration private data.
97 UninstallTcgConfigForm (
98 IN OUT TCG_CONFIG_PRIVATE_DATA
*PrivateData
102 This function allows a caller to extract the current configuration for one
103 or more named elements from the target driver.
105 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
106 @param[in] Request A null-terminated Unicode string in
107 <ConfigRequest> format.
108 @param[out] Progress On return, points to a character in the Request
109 string. Points to the string's null terminator if
110 request was successful. Points to the most recent
111 '&' before the first failing name/value pair (or
112 the beginning of the string if the failure is in
113 the first name/value pair) if the request was not
115 @param[out] Results A null-terminated Unicode string in
116 <ConfigAltResp> format which has all values filled
117 in for the names in the Request string. String to
118 be allocated by the called function.
120 @retval EFI_SUCCESS The Results is filled with the requested values.
121 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
122 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
123 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
130 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
131 IN CONST EFI_STRING Request
,
132 OUT EFI_STRING
*Progress
,
133 OUT EFI_STRING
*Results
137 This function processes the results of changes in configuration.
139 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
140 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>
142 @param[out] Progress A pointer to a string filled in with the offset of
143 the most recent '&' before the first failing
144 name/value pair (or the beginning of the string if
145 the failure is in the first name/value pair) or
146 the terminating NULL if all was successful.
148 @retval EFI_SUCCESS The Results is processed successfully.
149 @retval EFI_INVALID_PARAMETER Configuration is NULL.
150 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
157 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
158 IN CONST EFI_STRING Configuration
,
159 OUT EFI_STRING
*Progress
163 This function processes the results of changes in configuration.
165 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
166 @param[in] Action Specifies the type of action taken by the browser.
167 @param[in] QuestionId A unique value which is sent to the original
168 exporting driver so that it can identify the type
170 @param[in] Type The type of value for the question.
171 @param[in] Value A pointer to the data being sent to the original
173 @param[out] ActionRequest On return, points to the action requested by the
176 @retval EFI_SUCCESS The callback successfully handled the action.
177 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
178 variable and its data.
179 @retval EFI_DEVICE_ERROR The variable could not be saved.
180 @retval EFI_UNSUPPORTED The specified Action is not supported by the
187 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
188 IN EFI_BROWSER_ACTION Action
,
189 IN EFI_QUESTION_ID QuestionId
,
191 IN EFI_IFR_TYPE_VALUE
*Value
,
192 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest