]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
Program SD Cards into 4-bit mode (support for this is required in the spec). This...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / FrontPage.h
1 /** @file
2 FrontPage routines to handle the callbacks and browser calls
3
4 Copyright (c) 2004 - 2009, 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 _FRONT_PAGE_H_
16 #define _FRONT_PAGE_H_
17
18 #include "DeviceMngr/DeviceManager.h"
19 #include "BootMaint/BootMaint.h"
20 #include "BootMngr/BootManager.h"
21 #include "String.h"
22
23
24 //
25 // These are the VFR compiler generated data representing our VFR data.
26 //
27 extern UINT8 FrontPageVfrBin[];
28
29 extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
30
31 extern UINTN gCallbackKey;
32 extern BOOLEAN gConnectAllHappened;
33
34
35 #define ONE_SECOND 10000000
36
37 ///
38 /// The size of a 3 character ISO639 language code.
39 ///
40 #define ISO_639_2_ENTRY_SIZE 3
41
42 //
43 // This is the VFR compiler generated header file which defines the
44 // string identifiers.
45 //
46 #define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001
47
48 //
49 // These are defined as the same with vfr file
50 //
51 #define FRONT_PAGE_FORM_ID 0x1000
52
53 #define FRONT_PAGE_KEY_CONTINUE 0x1000
54 #define FRONT_PAGE_KEY_LANGUAGE 0x1234
55 #define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064
56 #define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567
57 #define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
58
59 #define LABEL_SELECT_LANGUAGE 0x1000
60 #define LABEL_END 0xffff
61
62 #define FRONT_PAGE_FORMSET_GUID \
63 { \
64 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
65 }
66
67 #define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')
68
69 typedef struct {
70 UINTN Signature;
71
72 //
73 // HII relative handles
74 //
75 EFI_HII_HANDLE HiiHandle;
76 EFI_HANDLE DriverHandle;
77 EFI_STRING_ID *LanguageToken;
78
79 //
80 // Produced protocols
81 //
82 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
83 } FRONT_PAGE_CALLBACK_DATA;
84
85 #define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \
86 CR (a, \
87 FRONT_PAGE_CALLBACK_DATA, \
88 ConfigAccess, \
89 FRONT_PAGE_CALLBACK_DATA_SIGNATURE \
90 )
91
92 /**
93 This function allows a caller to extract the current configuration for one
94 or more named elements from the target driver.
95
96
97 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
98 @param Request - A null-terminated Unicode string in <ConfigRequest> format.
99 @param Progress - On return, points to a character in the Request string.
100 Points to the string's null terminator if request was successful.
101 Points to the most recent '&' before the first failing name/value
102 pair (or the beginning of the string if the failure is in the
103 first name/value pair) if the request was not successful.
104 @param Results - A null-terminated Unicode string in <ConfigAltResp> format which
105 has all values filled in for the names in the Request string.
106 String to be allocated by the called function.
107
108 @retval EFI_SUCCESS The Results is filled with the requested values.
109 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
110 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
111 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
112
113 **/
114 EFI_STATUS
115 EFIAPI
116 FakeExtractConfig (
117 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
118 IN CONST EFI_STRING Request,
119 OUT EFI_STRING *Progress,
120 OUT EFI_STRING *Results
121 );
122
123 /**
124 This function processes the results of changes in configuration.
125
126
127 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
128 @param Configuration - A null-terminated Unicode string in <ConfigResp> format.
129 @param Progress - A pointer to a string filled in with the offset of the most
130 recent '&' before the first failing name/value pair (or the
131 beginning of the string if the failure is in the first
132 name/value pair) or the terminating NULL if all was successful.
133
134 @retval EFI_SUCCESS The Results is processed successfully.
135 @retval EFI_INVALID_PARAMETER Configuration is NULL.
136 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
137
138 **/
139 EFI_STATUS
140 EFIAPI
141 FakeRouteConfig (
142 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
143 IN CONST EFI_STRING Configuration,
144 OUT EFI_STRING *Progress
145 );
146
147 /**
148 This function processes the results of changes in configuration.
149
150
151 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
152 @param Action - Specifies the type of action taken by the browser.
153 @param QuestionId - A unique value which is sent to the original exporting driver
154 so that it can identify the type of data to expect.
155 @param Type - The type of value for the question.
156 @param Value - A pointer to the data being sent to the original exporting driver.
157 @param ActionRequest - On return, points to the action requested by the callback function.
158
159 @retval EFI_SUCCESS The callback successfully handled the action.
160 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
161 @retval EFI_DEVICE_ERROR The variable could not be saved.
162 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
163
164 **/
165 EFI_STATUS
166 EFIAPI
167 FrontPageCallback (
168 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
169 IN EFI_BROWSER_ACTION Action,
170 IN EFI_QUESTION_ID QuestionId,
171 IN UINT8 Type,
172 IN EFI_IFR_TYPE_VALUE *Value,
173 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
174 );
175
176 /**
177 Initialize HII information for the FrontPage
178
179
180 @param InitializeHiiData TRUE if HII elements need to be initialized.
181
182 @retval EFI_SUCCESS The operation is successful.
183 @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.
184
185 **/
186 EFI_STATUS
187 InitializeFrontPage (
188 IN BOOLEAN InitializeHiiData
189 );
190
191 /**
192 Acquire the string associated with the ProducerGuid and return it.
193
194
195 @param ProducerGuid - The Guid to search the HII database for
196 @param Token - The token value of the string to extract
197 @param String - The string that is extracted
198
199 @retval EFI_SUCCESS The function returns EFI_SUCCESS always.
200
201 **/
202 EFI_STATUS
203 GetProducerString (
204 IN EFI_GUID *ProducerGuid,
205 IN EFI_STRING_ID Token,
206 OUT CHAR16 **String
207 );
208
209 /**
210 Compare two EFI_TIME data.
211
212
213 @param FirstTime - A pointer to the first EFI_TIME data.
214 @param SecondTime - A pointer to the second EFI_TIME data.
215
216 @retval TRUE The FirstTime is not later than the SecondTime.
217 @retval FALSE The FirstTime is later than the SecondTime.
218
219 **/
220 BOOLEAN
221 TimeCompare (
222 IN EFI_TIME *FirstTime,
223 IN EFI_TIME *SecondTime
224 );
225
226 /**
227 This function is the main entry of the platform setup entry.
228 The function will present the main menu of the system setup,
229 this is the platform reference part and can be customize.
230
231
232 @param TimeoutDefault - The fault time out value before the system
233 continue to boot.
234 @param ConnectAllHappened - The indicater to check if the connect all have
235 already happened.
236
237 **/
238 VOID
239 PlatformBdsEnterFrontPage (
240 IN UINT16 TimeoutDefault,
241 IN BOOLEAN ConnectAllHappened
242 );
243
244 #endif // _FRONT_PAGE_H_
245