]>
Commit | Line | Data |
---|---|---|
5c08e117 | 1 | /** @file\r |
2 | FrontPage routines to handle the callbacks and browser calls\r | |
3 | \r | |
0a6f4824 | 4 | Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r |
c0a00b14 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
5c08e117 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _FRONT_PAGE_H_\r | |
10 | #define _FRONT_PAGE_H_\r | |
11 | \r | |
12 | #include "DeviceMngr/DeviceManager.h"\r | |
13 | #include "BootMaint/BootMaint.h"\r | |
14 | #include "BootMngr/BootManager.h"\r | |
15 | #include "String.h"\r | |
16 | \r | |
9f6531d1 | 17 | \r |
18 | //\r | |
19 | // These are the VFR compiler generated data representing our VFR data.\r | |
20 | //\r | |
21 | extern UINT8 FrontPageVfrBin[];\r | |
22 | \r | |
9f6531d1 | 23 | extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;\r |
9f6531d1 | 24 | \r |
25 | extern UINTN gCallbackKey;\r | |
26 | extern BOOLEAN gConnectAllHappened;\r | |
27 | \r | |
2df686c6 | 28 | //\r |
29 | // Boot video resolution and text mode.\r | |
30 | //\r | |
31 | extern UINT32 mBootHorizontalResolution;\r | |
32 | extern UINT32 mBootVerticalResolution;\r | |
33 | extern UINT32 mBootTextModeColumn;\r | |
34 | extern UINT32 mBootTextModeRow;\r | |
35 | //\r | |
36 | // BIOS setup video resolution and text mode.\r | |
37 | //\r | |
38 | extern UINT32 mSetupTextModeColumn;\r | |
39 | extern UINT32 mSetupTextModeRow;\r | |
40 | extern UINT32 mSetupHorizontalResolution;\r | |
41 | extern UINT32 mSetupVerticalResolution;\r | |
42 | \r | |
9f6531d1 | 43 | \r |
5c08e117 | 44 | #define ONE_SECOND 10000000\r |
45 | \r | |
da96258f | 46 | ///\r |
47 | /// The size of a 3 character ISO639 language code.\r | |
48 | ///\r | |
49 | #define ISO_639_2_ENTRY_SIZE 3\r | |
50 | \r | |
5c08e117 | 51 | //\r |
52 | // This is the VFR compiler generated header file which defines the\r | |
53 | // string identifiers.\r | |
54 | //\r | |
55 | #define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001\r | |
56 | \r | |
57 | //\r | |
58 | // These are defined as the same with vfr file\r | |
59 | //\r | |
60 | #define FRONT_PAGE_FORM_ID 0x1000\r | |
61 | \r | |
62 | #define FRONT_PAGE_KEY_CONTINUE 0x1000\r | |
63 | #define FRONT_PAGE_KEY_LANGUAGE 0x1234\r | |
64 | #define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064\r | |
65 | #define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567\r | |
66 | #define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876\r | |
67 | \r | |
68 | #define LABEL_SELECT_LANGUAGE 0x1000\r | |
75bf9d0e | 69 | #define LABEL_END 0xffff\r |
5c08e117 | 70 | \r |
5c08e117 | 71 | #define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')\r |
72 | \r | |
73 | typedef struct {\r | |
74 | UINTN Signature;\r | |
75 | \r | |
76 | //\r | |
77 | // HII relative handles\r | |
78 | //\r | |
79 | EFI_HII_HANDLE HiiHandle;\r | |
80 | EFI_HANDLE DriverHandle;\r | |
81 | EFI_STRING_ID *LanguageToken;\r | |
82 | \r | |
83 | //\r | |
84 | // Produced protocols\r | |
85 | //\r | |
86 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
87 | } FRONT_PAGE_CALLBACK_DATA;\r | |
88 | \r | |
89 | #define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \\r | |
90 | CR (a, \\r | |
91 | FRONT_PAGE_CALLBACK_DATA, \\r | |
92 | ConfigAccess, \\r | |
93 | FRONT_PAGE_CALLBACK_DATA_SIGNATURE \\r | |
94 | )\r | |
95 | \r | |
5c08e117 | 96 | /**\r |
97 | This function allows a caller to extract the current configuration for one\r | |
98 | or more named elements from the target driver.\r | |
99 | \r | |
100 | \r | |
101 | @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
102 | @param Request - A null-terminated Unicode string in <ConfigRequest> format.\r | |
103 | @param Progress - On return, points to a character in the Request string.\r | |
104 | Points to the string's null terminator if request was successful.\r | |
105 | Points to the most recent '&' before the first failing name/value\r | |
106 | pair (or the beginning of the string if the failure is in the\r | |
107 | first name/value pair) if the request was not successful.\r | |
108 | @param Results - A null-terminated Unicode string in <ConfigAltResp> format which\r | |
109 | has all values filled in for the names in the Request string.\r | |
110 | String to be allocated by the called function.\r | |
111 | \r | |
112 | @retval EFI_SUCCESS The Results is filled with the requested values.\r | |
113 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r | |
114 | @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r | |
115 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r | |
116 | \r | |
117 | **/\r | |
118 | EFI_STATUS\r | |
119 | EFIAPI\r | |
120 | FakeExtractConfig (\r | |
121 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
122 | IN CONST EFI_STRING Request,\r | |
123 | OUT EFI_STRING *Progress,\r | |
124 | OUT EFI_STRING *Results\r | |
125 | );\r | |
126 | \r | |
127 | /**\r | |
128 | This function processes the results of changes in configuration.\r | |
129 | \r | |
130 | \r | |
131 | @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
132 | @param Configuration - A null-terminated Unicode string in <ConfigResp> format.\r | |
133 | @param Progress - A pointer to a string filled in with the offset of the most\r | |
134 | recent '&' before the first failing name/value pair (or the\r | |
135 | beginning of the string if the failure is in the first\r | |
136 | name/value pair) or the terminating NULL if all was successful.\r | |
137 | \r | |
138 | @retval EFI_SUCCESS The Results is processed successfully.\r | |
139 | @retval EFI_INVALID_PARAMETER Configuration is NULL.\r | |
140 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r | |
141 | \r | |
142 | **/\r | |
143 | EFI_STATUS\r | |
144 | EFIAPI\r | |
145 | FakeRouteConfig (\r | |
146 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
147 | IN CONST EFI_STRING Configuration,\r | |
148 | OUT EFI_STRING *Progress\r | |
149 | );\r | |
150 | \r | |
151 | /**\r | |
152 | This function processes the results of changes in configuration.\r | |
153 | \r | |
154 | \r | |
155 | @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
156 | @param Action - Specifies the type of action taken by the browser.\r | |
157 | @param QuestionId - A unique value which is sent to the original exporting driver\r | |
158 | so that it can identify the type of data to expect.\r | |
159 | @param Type - The type of value for the question.\r | |
160 | @param Value - A pointer to the data being sent to the original exporting driver.\r | |
161 | @param ActionRequest - On return, points to the action requested by the callback function.\r | |
162 | \r | |
163 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
164 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r | |
165 | @retval EFI_DEVICE_ERROR The variable could not be saved.\r | |
166 | @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.\r | |
167 | \r | |
168 | **/\r | |
169 | EFI_STATUS\r | |
170 | EFIAPI\r | |
171 | FrontPageCallback (\r | |
172 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
173 | IN EFI_BROWSER_ACTION Action,\r | |
174 | IN EFI_QUESTION_ID QuestionId,\r | |
175 | IN UINT8 Type,\r | |
176 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
177 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
178 | );\r | |
179 | \r | |
180 | /**\r | |
181 | Initialize HII information for the FrontPage\r | |
182 | \r | |
183 | \r | |
184 | @param InitializeHiiData TRUE if HII elements need to be initialized.\r | |
185 | \r | |
186 | @retval EFI_SUCCESS The operation is successful.\r | |
187 | @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.\r | |
188 | \r | |
189 | **/\r | |
190 | EFI_STATUS\r | |
191 | InitializeFrontPage (\r | |
192 | IN BOOLEAN InitializeHiiData\r | |
193 | );\r | |
194 | \r | |
5c08e117 | 195 | \r |
5c08e117 | 196 | /**\r |
197 | This function is the main entry of the platform setup entry.\r | |
198 | The function will present the main menu of the system setup,\r | |
199 | this is the platform reference part and can be customize.\r | |
200 | \r | |
201 | \r | |
202 | @param TimeoutDefault - The fault time out value before the system\r | |
203 | continue to boot.\r | |
204 | @param ConnectAllHappened - The indicater to check if the connect all have\r | |
baf46e70 | 205 | already happened.\r |
5c08e117 | 206 | \r |
207 | **/\r | |
208 | VOID\r | |
209 | PlatformBdsEnterFrontPage (\r | |
210 | IN UINT16 TimeoutDefault,\r | |
211 | IN BOOLEAN ConnectAllHappened\r | |
212 | );\r | |
213 | \r | |
72861c22 | 214 | /**\r |
2df686c6 | 215 | This function will change video resolution and text mode\r |
0a6f4824 | 216 | according to defined setup mode or defined boot mode\r |
72861c22 | 217 | \r |
0a6f4824 | 218 | @param IsSetupMode Indicate mode is changed to setup mode or boot mode.\r |
72861c22 | 219 | \r |
220 | @retval EFI_SUCCESS Mode is changed successfully.\r | |
2df686c6 | 221 | @retval Others Mode failed to be changed.\r |
72861c22 | 222 | \r |
223 | **/\r | |
224 | EFI_STATUS\r | |
225 | EFIAPI\r | |
2df686c6 | 226 | BdsSetConsoleMode (\r |
227 | BOOLEAN IsSetupMode\r | |
72861c22 | 228 | );\r |
229 | \r | |
5c08e117 | 230 | #endif // _FRONT_PAGE_H_\r |
231 | \r |