]>
Commit | Line | Data |
---|---|---|
c1d93242 JY |
1 | /** @file\r |
2 | The header file of HII Config Access protocol implementation of TREE\r | |
3 | configuration module.\r | |
4 | \r | |
5 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials \r | |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __TREE_CONFIG_IMPL_H__\r | |
17 | #define __TREE_CONFIG_IMPL_H__\r | |
18 | \r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <Protocol/HiiConfigAccess.h>\r | |
22 | #include <Protocol/HiiConfigRouting.h>\r | |
23 | #include <Protocol/TrEEProtocol.h>\r | |
24 | \r | |
25 | #include <Library/BaseLib.h>\r | |
26 | #include <Library/BaseMemoryLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/UefiBootServicesTableLib.h>\r | |
30 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
31 | #include <Library/UefiHiiServicesLib.h>\r | |
32 | #include <Library/UefiLib.h>\r | |
33 | #include <Library/HiiLib.h>\r | |
34 | #include <Library/DevicePathLib.h>\r | |
35 | #include <Library/PcdLib.h>\r | |
36 | #include <Library/PrintLib.h>\r | |
37 | \r | |
38 | #include <Guid/MdeModuleHii.h>\r | |
39 | \r | |
40 | #include "TrEEConfigNvData.h"\r | |
41 | \r | |
42 | //\r | |
43 | // Tool generated IFR binary data and String package data\r | |
44 | //\r | |
45 | extern UINT8 TrEEConfigBin[];\r | |
46 | extern UINT8 TrEEConfigDxeStrings[];\r | |
47 | \r | |
48 | ///\r | |
49 | /// HII specific Vendor Device Path definition.\r | |
50 | ///\r | |
51 | typedef struct {\r | |
52 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
53 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
54 | } HII_VENDOR_DEVICE_PATH;\r | |
55 | \r | |
56 | typedef struct {\r | |
57 | UINTN Signature;\r | |
58 | \r | |
59 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
60 | EFI_HII_HANDLE HiiHandle;\r | |
61 | EFI_HANDLE DriverHandle; \r | |
62 | \r | |
63 | } TREE_CONFIG_PRIVATE_DATA;\r | |
64 | \r | |
65 | extern TREE_CONFIG_PRIVATE_DATA mTrEEConfigPrivateDateTemplate;\r | |
66 | \r | |
67 | #define TREE_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'r', 'E', 'D')\r | |
68 | #define TREE_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TREE_CONFIG_PRIVATE_DATA, ConfigAccess, TREE_CONFIG_PRIVATE_DATA_SIGNATURE)\r | |
69 | \r | |
70 | \r | |
71 | /**\r | |
72 | This function publish the TREE configuration Form for TPM device.\r | |
73 | \r | |
74 | @param[in, out] PrivateData Points to TREE configuration private data.\r | |
75 | \r | |
76 | @retval EFI_SUCCESS HII Form is installed for this network device.\r | |
77 | @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r | |
78 | @retval Others Other errors as indicated.\r | |
79 | \r | |
80 | **/\r | |
81 | EFI_STATUS\r | |
82 | InstallTrEEConfigForm (\r | |
83 | IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData\r | |
84 | );\r | |
85 | \r | |
86 | /**\r | |
87 | This function removes TREE configuration Form.\r | |
88 | \r | |
89 | @param[in, out] PrivateData Points to TREE configuration private data.\r | |
90 | \r | |
91 | **/\r | |
92 | VOID\r | |
93 | UninstallTrEEConfigForm (\r | |
94 | IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData\r | |
95 | );\r | |
96 | \r | |
97 | /**\r | |
98 | This function allows a caller to extract the current configuration for one\r | |
99 | or more named elements from the target driver.\r | |
100 | \r | |
101 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
102 | @param[in] Request A null-terminated Unicode string in\r | |
103 | <ConfigRequest> format.\r | |
104 | @param[out] Progress On return, points to a character in the Request\r | |
105 | string. Points to the string's null terminator if\r | |
106 | request was successful. Points to the most recent\r | |
107 | '&' before the first failing name/value pair (or\r | |
108 | the beginning of the string if the failure is in\r | |
109 | the first name/value pair) if the request was not\r | |
110 | successful.\r | |
111 | @param[out] Results A null-terminated Unicode string in\r | |
112 | <ConfigAltResp> format which has all values filled\r | |
113 | in for the names in the Request string. String to\r | |
114 | be allocated by the called function.\r | |
115 | \r | |
116 | @retval EFI_SUCCESS The Results is filled with the requested values.\r | |
117 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r | |
118 | @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r | |
119 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r | |
120 | driver.\r | |
121 | \r | |
122 | **/\r | |
123 | EFI_STATUS\r | |
124 | EFIAPI\r | |
125 | TrEEExtractConfig (\r | |
126 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
127 | IN CONST EFI_STRING Request,\r | |
128 | OUT EFI_STRING *Progress,\r | |
129 | OUT EFI_STRING *Results\r | |
130 | );\r | |
131 | \r | |
132 | /**\r | |
133 | This function processes the results of changes in configuration.\r | |
134 | \r | |
135 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
136 | @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r | |
137 | format.\r | |
138 | @param[out] Progress A pointer to a string filled in with the offset of\r | |
139 | the most recent '&' before the first failing\r | |
140 | name/value pair (or the beginning of the string if\r | |
141 | the failure is in the first name/value pair) or\r | |
142 | the terminating NULL if all was successful.\r | |
143 | \r | |
144 | @retval EFI_SUCCESS The Results is processed successfully.\r | |
145 | @retval EFI_INVALID_PARAMETER Configuration is NULL.\r | |
146 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r | |
147 | driver.\r | |
148 | \r | |
149 | **/\r | |
150 | EFI_STATUS\r | |
151 | EFIAPI\r | |
152 | TrEERouteConfig (\r | |
153 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
154 | IN CONST EFI_STRING Configuration,\r | |
155 | OUT EFI_STRING *Progress\r | |
156 | );\r | |
157 | \r | |
158 | /**\r | |
159 | This function processes the results of changes in configuration.\r | |
160 | \r | |
161 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
162 | @param[in] Action Specifies the type of action taken by the browser.\r | |
163 | @param[in] QuestionId A unique value which is sent to the original\r | |
164 | exporting driver so that it can identify the type\r | |
165 | of data to expect.\r | |
166 | @param[in] Type The type of value for the question.\r | |
167 | @param[in] Value A pointer to the data being sent to the original\r | |
168 | exporting driver.\r | |
169 | @param[out] ActionRequest On return, points to the action requested by the\r | |
170 | callback function.\r | |
171 | \r | |
172 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
173 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r | |
174 | variable and its data.\r | |
175 | @retval EFI_DEVICE_ERROR The variable could not be saved.\r | |
176 | @retval EFI_UNSUPPORTED The specified Action is not supported by the\r | |
177 | callback.\r | |
178 | \r | |
179 | **/\r | |
180 | EFI_STATUS\r | |
181 | EFIAPI\r | |
182 | TrEECallback (\r | |
183 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
184 | IN EFI_BROWSER_ACTION Action,\r | |
185 | IN EFI_QUESTION_ID QuestionId,\r | |
186 | IN UINT8 Type,\r | |
187 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
188 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
189 | );\r | |
190 | \r | |
191 | #endif\r |