]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
d5016043cb73daecf68fb94a18b4edf3d22c88c3
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / BootMaint.h
1 /** @file
2 Header file for boot maintenance module.
3
4 Copyright (c) 2004 - 2012, 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 _BOOT_MAINT_H_
16 #define _BOOT_MAINT_H_
17
18 #include "Bds.h"
19 #include "BBSsupport.h"
20 #include "FormGuid.h"
21 #include "FrontPage.h"
22
23 //
24 // Constants which are variable names used to access variables
25 //
26 #define VAR_CON_OUT_MODE L"ConOutMode"
27
28 //
29 // String Contant
30 //
31 #define STR_FLOPPY L"Floppy Drive #%02x"
32 #define STR_HARDDISK L"HardDisk Drive #%02x"
33 #define STR_CDROM L"ATAPI CDROM Drive #%02x"
34 #define STR_NET L"NET Drive #%02x"
35 #define STR_BEV L"BEV Drive #%02x"
36 #define STR_FLOPPY_HELP L"Select Floppy Drive #%02x"
37 #define STR_HARDDISK_HELP L"Select HardDisk Drive #%02x"
38 #define STR_CDROM_HELP L"Select ATAPI CDROM Drive #%02x"
39 #define STR_NET_HELP L"NET Drive #%02x"
40 #define STR_BEV_HELP L"BEV Drive #%02x"
41
42 extern CHAR16 mFileExplorerStorageName[];
43 extern CHAR16 mBootMaintStorageName[];
44 //
45 // These are the VFR compiler generated data representing our VFR data.
46 //
47 extern UINT8 BmBin[];
48 extern UINT8 FEBin[];
49
50 //
51 // Below are the number of options in Baudrate, Databits,
52 // Parity and Stopbits selection for serial ports.
53 //
54 #define BM_COM_ATTR_BUADRATE 19
55 #define BM_COM_ATTR_DATABITS 4
56 #define BM_COM_ATTR_PARITY 5
57 #define BM_COM_ATTR_STOPBITS 3
58
59 //
60 // Callback function helper
61 //
62 #define BMM_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('C', 'b', 'c', 'k')
63 #define BMM_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, BmmConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)
64
65 #define FE_CALLBACK_DATA_FROM_THIS(a) CR (a, BMM_CALLBACK_DATA, FeConfigAccess, BMM_CALLBACK_DATA_SIGNATURE)
66
67 //
68 // Enumeration type definition
69 //
70 typedef enum _TYPE_OF_TERMINAL {
71 TerminalTypePcAnsi = 0,
72 TerminalTypeVt100,
73 TerminalTypeVt100Plus,
74 TerminalTypeVtUtf8
75 } TYPE_OF_TERMINAL;
76
77 typedef enum _FILE_EXPLORER_STATE {
78 FileExplorerStateInActive = 0,
79 FileExplorerStateBootFromFile,
80 FileExplorerStateAddBootOption,
81 FileExplorerStateAddDriverOptionState,
82 FileExplorerStateUnknown
83 } FILE_EXPLORER_STATE;
84
85 typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
86 FileExplorerDisplayFileSystem,
87 FileExplorerDisplayDirectory,
88 FileExplorerDisplayUnknown
89 } FILE_EXPLORER_DISPLAY_CONTEXT;
90
91 //
92 // All of the signatures that will be used in list structure
93 //
94 #define BM_MENU_OPTION_SIGNATURE SIGNATURE_32 ('m', 'e', 'n', 'u')
95 #define BM_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('l', 'o', 'a', 'd')
96 #define BM_CONSOLE_OPTION_SIGNATURE SIGNATURE_32 ('c', 'n', 's', 'l')
97 #define BM_FILE_OPTION_SIGNATURE SIGNATURE_32 ('f', 'i', 'l', 'e')
98 #define BM_HANDLE_OPTION_SIGNATURE SIGNATURE_32 ('h', 'n', 'd', 'l')
99 #define BM_TERMINAL_OPTION_SIGNATURE SIGNATURE_32 ('t', 'r', 'm', 'l')
100 #define BM_MENU_ENTRY_SIGNATURE SIGNATURE_32 ('e', 'n', 't', 'r')
101
102 #define BM_LOAD_CONTEXT_SELECT 0x0
103 #define BM_CONSOLE_CONTEXT_SELECT 0x1
104 #define BM_FILE_CONTEXT_SELECT 0x2
105 #define BM_HANDLE_CONTEXT_SELECT 0x3
106 #define BM_TERMINAL_CONTEXT_SELECT 0x5
107
108 #define BM_CONSOLE_IN_CONTEXT_SELECT 0x6
109 #define BM_CONSOLE_OUT_CONTEXT_SELECT 0x7
110 #define BM_CONSOLE_ERR_CONTEXT_SELECT 0x8
111 #define BM_LEGACY_DEV_CONTEXT_SELECT 0x9
112
113 //
114 // Buffer size for update data
115 //
116 #define UPDATE_DATA_SIZE 0x100000
117
118 //
119 // Namespace of callback keys used in display and file system navigation
120 //
121 #define MAX_BBS_OFFSET 0xE000
122 #define NET_OPTION_OFFSET 0xD800
123 #define BEV_OPTION_OFFSET 0xD000
124 #define FD_OPTION_OFFSET 0xC000
125 #define HD_OPTION_OFFSET 0xB000
126 #define CD_OPTION_OFFSET 0xA000
127 #define FILE_OPTION_OFFSET 0x8000
128 #define FILE_OPTION_MASK 0x7FFF
129 #define HANDLE_OPTION_OFFSET 0x7000
130 #define CONSOLE_OPTION_OFFSET 0x6000
131 #define TERMINAL_OPTION_OFFSET 0x5000
132 #define CONFIG_OPTION_OFFSET 0x1200
133 #define KEY_VALUE_OFFSET 0x1100
134 #define FORM_ID_OFFSET 0x1000
135
136 //
137 // VarOffset that will be used to create question
138 // all these values are computed from the structure
139 // defined below
140 //
141 #define VAR_OFFSET(Field) ((UINT16) ((UINTN) &(((BMM_FAKE_NV_DATA *) 0)->Field)))
142
143 //
144 // Question Id of Zero is invalid, so add an offset to it
145 //
146 #define QUESTION_ID(Field) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET)
147
148 #define BOOT_TIME_OUT_VAR_OFFSET VAR_OFFSET (BootTimeOut)
149 #define BOOT_NEXT_VAR_OFFSET VAR_OFFSET (BootNext)
150 #define COM1_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM1BaudRate)
151 #define COM1_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM1DataRate)
152 #define COM1_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM1StopBits)
153 #define COM1_PARITY_VAR_OFFSET VAR_OFFSET (COM1Parity)
154 #define COM1_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)
155 #define COM2_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COM2BaudRate)
156 #define COM2_DATA_RATE_VAR_OFFSET VAR_OFFSET (COM2DataRate)
157 #define COM2_STOP_BITS_VAR_OFFSET VAR_OFFSET (COM2StopBits)
158 #define COM2_PARITY_VAR_OFFSET VAR_OFFSET (COM2Parity)
159 #define COM2_TERMINAL_VAR_OFFSET VAR_OFFSET (COM2TerminalType)
160 #define DRV_ADD_HANDLE_DESC_VAR_OFFSET VAR_OFFSET (DriverAddHandleDesc)
161 #define DRV_ADD_ACTIVE_VAR_OFFSET VAR_OFFSET (DriverAddActive)
162 #define DRV_ADD_RECON_VAR_OFFSET VAR_OFFSET (DriverAddForceReconnect)
163 #define CON_IN_COM1_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM1)
164 #define CON_IN_COM2_VAR_OFFSET VAR_OFFSET (ConsoleInputCOM2)
165 #define CON_OUT_COM1_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM1)
166 #define CON_OUT_COM2_VAR_OFFSET VAR_OFFSET (ConsoleOutputCOM2)
167 #define CON_ERR_COM1_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM1)
168 #define CON_ERR_COM2_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM2)
169 #define CON_MODE_VAR_OFFSET VAR_OFFSET (ConsoleOutMode)
170 #define CON_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleCheck)
171 #define OPTION_ORDER_VAR_OFFSET VAR_OFFSET (OptionOrder)
172 #define OPTION_DEL_VAR_OFFSET VAR_OFFSET (OptionDel)
173 #define DRIVER_ADD_OPTION_VAR_OFFSET VAR_OFFSET (DriverAddHandleOptionalData)
174 #define COM_BAUD_RATE_VAR_OFFSET VAR_OFFSET (COMBaudRate)
175 #define COM_DATA_RATE_VAR_OFFSET VAR_OFFSET (COMDataRate)
176 #define COM_STOP_BITS_VAR_OFFSET VAR_OFFSET (COMStopBits)
177 #define COM_PARITY_VAR_OFFSET VAR_OFFSET (COMParity)
178 #define COM_TERMINAL_VAR_OFFSET VAR_OFFSET (COMTerminalType)
179 #define COM_FLOWCONTROL_VAR_OFFSET VAR_OFFSET (COMFlowControl)
180 #define LEGACY_FD_VAR_OFFSET VAR_OFFSET (LegacyFD)
181 #define LEGACY_HD_VAR_OFFSET VAR_OFFSET (LegacyHD)
182 #define LEGACY_CD_VAR_OFFSET VAR_OFFSET (LegacyCD)
183 #define LEGACY_NET_VAR_OFFSET VAR_OFFSET (LegacyNET)
184 #define LEGACY_BEV_VAR_OFFSET VAR_OFFSET (LegacyBEV)
185
186 #define BOOT_TIME_OUT_QUESTION_ID QUESTION_ID (BootTimeOut)
187 #define BOOT_NEXT_QUESTION_ID QUESTION_ID (BootNext)
188 #define COM1_BAUD_RATE_QUESTION_ID QUESTION_ID (COM1BaudRate)
189 #define COM1_DATA_RATE_QUESTION_ID QUESTION_ID (COM1DataRate)
190 #define COM1_STOP_BITS_QUESTION_ID QUESTION_ID (COM1StopBits)
191 #define COM1_PARITY_QUESTION_ID QUESTION_ID (COM1Parity)
192 #define COM1_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)
193 #define COM2_BAUD_RATE_QUESTION_ID QUESTION_ID (COM2BaudRate)
194 #define COM2_DATA_RATE_QUESTION_ID QUESTION_ID (COM2DataRate)
195 #define COM2_STOP_BITS_QUESTION_ID QUESTION_ID (COM2StopBits)
196 #define COM2_PARITY_QUESTION_ID QUESTION_ID (COM2Parity)
197 #define COM2_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)
198 #define DRV_ADD_HANDLE_DESC_QUESTION_ID QUESTION_ID (DriverAddHandleDesc)
199 #define DRV_ADD_ACTIVE_QUESTION_ID QUESTION_ID (DriverAddActive)
200 #define DRV_ADD_RECON_QUESTION_ID QUESTION_ID (DriverAddForceReconnect)
201 #define CON_IN_COM1_QUESTION_ID QUESTION_ID (ConsoleInputCOM1)
202 #define CON_IN_COM2_QUESTION_ID QUESTION_ID (ConsoleInputCOM2)
203 #define CON_OUT_COM1_QUESTION_ID QUESTION_ID (ConsoleOutputCOM1)
204 #define CON_OUT_COM2_QUESTION_ID QUESTION_ID (ConsoleOutputCOM2)
205 #define CON_ERR_COM1_QUESTION_ID QUESTION_ID (ConsoleErrorCOM1)
206 #define CON_ERR_COM2_QUESTION_ID QUESTION_ID (ConsoleErrorCOM2)
207 #define CON_MODE_QUESTION_ID QUESTION_ID (ConsoleOutMode)
208 #define CON_DEVICE_QUESTION_ID QUESTION_ID (ConsoleCheck)
209 #define OPTION_ORDER_QUESTION_ID QUESTION_ID (OptionOrder)
210 #define OPTION_DEL_QUESTION_ID QUESTION_ID (OptionDel)
211 #define DRIVER_ADD_OPTION_QUESTION_ID QUESTION_ID (DriverAddHandleOptionalData)
212 #define COM_BAUD_RATE_QUESTION_ID QUESTION_ID (COMBaudRate)
213 #define COM_DATA_RATE_QUESTION_ID QUESTION_ID (COMDataRate)
214 #define COM_STOP_BITS_QUESTION_ID QUESTION_ID (COMStopBits)
215 #define COM_PARITY_QUESTION_ID QUESTION_ID (COMParity)
216 #define COM_TERMINAL_QUESTION_ID QUESTION_ID (COMTerminalType)
217 #define COM_FLOWCONTROL_QUESTION_ID QUESTION_ID (COMFlowControl)
218 #define LEGACY_FD_QUESTION_ID QUESTION_ID (LegacyFD)
219 #define LEGACY_HD_QUESTION_ID QUESTION_ID (LegacyHD)
220 #define LEGACY_CD_QUESTION_ID QUESTION_ID (LegacyCD)
221 #define LEGACY_NET_QUESTION_ID QUESTION_ID (LegacyNET)
222 #define LEGACY_BEV_QUESTION_ID QUESTION_ID (LegacyBEV)
223
224 #define STRING_DEPOSITORY_NUMBER 8
225
226 ///
227 /// Serial Ports attributes, first one is the value for
228 /// return from callback function, stringtoken is used to
229 /// display the value properly
230 ///
231 typedef struct {
232 UINTN Value;
233 UINT16 StringToken;
234 } COM_ATTR;
235
236 typedef struct {
237 UINT64 BaudRate;
238 UINT8 DataBits;
239 UINT8 Parity;
240 UINT8 StopBits;
241
242 UINT8 BaudRateIndex;
243 UINT8 DataBitsIndex;
244 UINT8 ParityIndex;
245 UINT8 StopBitsIndex;
246
247 UINT8 FlowControl;
248
249 UINT8 IsConIn;
250 UINT8 IsConOut;
251 UINT8 IsStdErr;
252 UINT8 TerminalType;
253
254 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
255 } BM_TERMINAL_CONTEXT;
256
257 typedef struct {
258 BOOLEAN IsBootNext;
259 BOOLEAN LoadOptionModified;
260 BOOLEAN Deleted;
261
262 BOOLEAN IsLegacy;
263 BOOLEAN IsActive;
264 BOOLEAN ForceReconnect;
265 UINTN OptionalDataSize;
266
267 UINTN LoadOptionSize;
268 UINT8 *LoadOption;
269
270 UINT32 Attributes;
271 UINT16 FilePathListLength;
272 UINT16 *Description;
273 EFI_DEVICE_PATH_PROTOCOL *FilePathList;
274 UINT8 *OptionalData;
275
276 UINT16 BbsIndex;
277 } BM_LOAD_CONTEXT;
278
279 typedef struct {
280 BBS_TABLE *BbsEntry;
281 UINT16 BbsIndex;
282 UINT16 BbsCount;
283 CHAR16 *Description;
284 } BM_LEGACY_DEVICE_CONTEXT;
285
286 typedef struct {
287
288 BOOLEAN IsActive;
289
290 BOOLEAN IsTerminal;
291
292 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
293 } BM_CONSOLE_CONTEXT;
294
295 typedef struct {
296 UINTN Column;
297 UINTN Row;
298 } CONSOLE_OUT_MODE;
299
300 typedef struct {
301 EFI_HANDLE Handle;
302 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
303 EFI_FILE_HANDLE FHandle;
304 UINT16 *FileName;
305 EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
306
307 BOOLEAN IsRoot;
308 BOOLEAN IsDir;
309 BOOLEAN IsRemovableMedia;
310 BOOLEAN IsLoadFile;
311 BOOLEAN IsBootLegacy;
312 } BM_FILE_CONTEXT;
313
314 typedef struct {
315 EFI_HANDLE Handle;
316 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
317 } BM_HANDLE_CONTEXT;
318
319 typedef struct {
320 UINTN Signature;
321 LIST_ENTRY Head;
322 UINTN MenuNumber;
323 } BM_MENU_OPTION;
324
325 typedef struct {
326 UINTN Signature;
327 LIST_ENTRY Link;
328 UINTN OptionNumber;
329 UINT16 *DisplayString;
330 UINT16 *HelpString;
331 EFI_STRING_ID DisplayStringToken;
332 EFI_STRING_ID HelpStringToken;
333 UINTN ContextSelection;
334 VOID *VariableContext;
335 } BM_MENU_ENTRY;
336
337 typedef struct {
338 //
339 // Shared callback data.
340 //
341 UINTN Signature;
342
343 BM_MENU_ENTRY *MenuEntry;
344 BM_HANDLE_CONTEXT *HandleContext;
345 BM_FILE_CONTEXT *FileContext;
346 BM_LOAD_CONTEXT *LoadContext;
347 BM_TERMINAL_CONTEXT *TerminalContext;
348 UINTN CurrentTerminal;
349 BBS_TYPE BbsType;
350
351 //
352 // BMM main formset callback data.
353 //
354 EFI_HII_HANDLE BmmHiiHandle;
355 EFI_HANDLE BmmDriverHandle;
356 EFI_HII_CONFIG_ACCESS_PROTOCOL BmmConfigAccess;
357 EFI_FORM_ID BmmCurrentPageId;
358 EFI_FORM_ID BmmPreviousPageId;
359 BOOLEAN BmmAskSaveOrNot;
360 BMM_FAKE_NV_DATA BmmFakeNvData;
361 BMM_FAKE_NV_DATA BmmOldFakeNVData;
362
363 //
364 // File explorer formset callback data.
365 //
366 EFI_HII_HANDLE FeHiiHandle;
367 EFI_HANDLE FeDriverHandle;
368 EFI_HII_CONFIG_ACCESS_PROTOCOL FeConfigAccess;
369 FILE_EXPLORER_STATE FeCurrentState;
370 FILE_EXPLORER_DISPLAY_CONTEXT FeDisplayContext;
371 FILE_EXPLORER_NV_DATA FeFakeNvData;
372 } BMM_CALLBACK_DATA;
373
374 typedef struct _STRING_LIST_NODE STRING_LIST_NODE;
375
376 struct _STRING_LIST_NODE {
377 EFI_STRING_ID StringToken;
378 STRING_LIST_NODE *Next;
379 };
380
381 typedef struct _STRING_DEPOSITORY {
382 UINTN TotalNodeNumber;
383 STRING_LIST_NODE *CurrentNode;
384 STRING_LIST_NODE *ListHead;
385 } STRING_DEPOSITORY;
386
387 //
388 // #pragma pack()
389 //
390 // For initializing File System menu
391 //
392
393 /**
394 This function build the FsOptionMenu list which records all
395 available file system in the system. They includes all instances
396 of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM
397 and all type of legacy boot device.
398
399 @param CallbackData BMM context data
400
401 @retval EFI_SUCCESS Success find the file system
402 @retval EFI_OUT_OF_RESOURCES Can not create menu entry
403
404 **/
405 EFI_STATUS
406 BOpt_FindFileSystem (
407 IN BMM_CALLBACK_DATA *CallbackData
408 );
409
410 /**
411 Find files under current directory
412 All files and sub-directories in current directory
413 will be stored in DirectoryMenu for future use.
414
415 @param CallbackData The BMM context data.
416 @param MenuEntry The Menu Entry.
417
418 @retval EFI_SUCCESS Get files from current dir successfully.
419 @return Other value if can't get files from current dir.
420
421 **/
422 EFI_STATUS
423 BOpt_FindFiles (
424 IN BMM_CALLBACK_DATA *CallbackData,
425 IN BM_MENU_ENTRY *MenuEntry
426 );
427
428 /**
429
430 Find drivers that will be added as Driver#### variables from handles
431 in current system environment
432 All valid handles in the system except those consume SimpleFs, LoadFile
433 are stored in DriverMenu for future use.
434
435 @retval EFI_SUCCESS The function complets successfully.
436 @return Other value if failed to build the DriverMenu.
437
438 **/
439 EFI_STATUS
440 BOpt_FindDrivers (
441 VOID
442 );
443
444 /**
445
446 Build the BootOptionMenu according to BootOrder Variable.
447 This Routine will access the Boot#### to get EFI_LOAD_OPTION.
448
449 @param CallbackData The BMM context data.
450
451 @return The number of the Var Boot####.
452
453 **/
454 EFI_STATUS
455 BOpt_GetBootOptions (
456 IN BMM_CALLBACK_DATA *CallbackData
457 );
458
459 /**
460
461 Build up all DriverOptionMenu
462
463 @param CallbackData The BMM context data.
464
465 @return EFI_SUCESS The functin completes successfully.
466 @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.
467
468
469 **/
470 EFI_STATUS
471 BOpt_GetDriverOptions (
472 IN BMM_CALLBACK_DATA *CallbackData
473 );
474
475
476 /**
477 Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().
478
479 @retval EFI_SUCCESS The function complete successfully.
480 @retval EFI_OUT_OF_RESOURCES No enough memory to complete this function.
481
482 **/
483 EFI_STATUS
484 BOpt_GetLegacyOptions (
485 VOID
486 );
487
488 /**
489 Free out resouce allocated from Legacy Boot Options.
490
491 **/
492 VOID
493 BOpt_FreeLegacyOptions (
494 VOID
495 );
496
497 /**
498 Free resources allocated in Allocate Rountine.
499
500 @param FreeMenu Menu to be freed
501
502 **/
503 VOID
504 BOpt_FreeMenu (
505 BM_MENU_OPTION *FreeMenu
506 );
507
508
509 /**
510
511 Append file name to existing file name.
512
513 @param Str1 The existing file name
514 @param Str2 The file name to be appended
515
516 @return Allocate a new string to hold the appended result.
517 Caller is responsible to free the returned string.
518
519 **/
520 CHAR16*
521 BOpt_AppendFileName (
522 IN CHAR16 *Str1,
523 IN CHAR16 *Str2
524 );
525
526 /**
527
528 Check whether current FileName point to a valid
529 Efi Image File.
530
531 @param FileName File need to be checked.
532
533 @retval TRUE Is Efi Image
534 @retval FALSE Not a valid Efi Image
535
536 **/
537 BOOLEAN
538 BOpt_IsEfiImageName (
539 IN UINT16 *FileName
540 );
541
542 /**
543
544 Check whether current FileName point to a valid Efi Application
545
546 @param Dir Pointer to current Directory
547 @param FileName Pointer to current File name.
548
549 @retval TRUE Is a valid Efi Application
550 @retval FALSE not a valid Efi Application
551
552 **/
553 BOOLEAN
554 BOpt_IsEfiApp (
555 IN EFI_FILE_HANDLE Dir,
556 IN UINT16 *FileName
557 );
558
559 /**
560
561 Get the Option Number that has not been allocated for use.
562
563 @param Type The type of Option.
564
565 @return The available Option Number.
566
567 **/
568 UINT16
569 BOpt_GetOptionNumber (
570 CHAR16 *Type
571 );
572
573 /**
574
575 Get the Option Number for Boot#### that does not used.
576
577 @return The available Option Number.
578
579 **/
580 UINT16
581 BOpt_GetBootOptionNumber (
582 VOID
583 );
584
585 /**
586
587 Get the Option Number for Driver#### that does not used.
588
589 @return The unused Option Number.
590
591 **/
592 UINT16
593 BOpt_GetDriverOptionNumber (
594 VOID
595 );
596
597 /**
598 Create a menu entry give a Menu type.
599
600 @param MenuType The Menu type to be created.
601
602
603 @retval NULL If failed to create the menu.
604 @return The menu.
605
606 **/
607 BM_MENU_ENTRY *
608 BOpt_CreateMenuEntry (
609 UINTN MenuType
610 );
611
612 /**
613 Free up all resource allocated for a BM_MENU_ENTRY.
614
615 @param MenuEntry A pointer to BM_MENU_ENTRY.
616
617 **/
618 VOID
619 BOpt_DestroyMenuEntry (
620 BM_MENU_ENTRY *MenuEntry
621 );
622
623 /**
624 Get the Menu Entry from the list in Menu Entry List.
625
626 If MenuNumber is great or equal to the number of Menu
627 Entry in the list, then ASSERT.
628
629 @param MenuOption The Menu Entry List to read the menu entry.
630 @param MenuNumber The index of Menu Entry.
631
632 @return The Menu Entry.
633
634 **/
635 BM_MENU_ENTRY *
636 BOpt_GetMenuEntry (
637 BM_MENU_OPTION *MenuOption,
638 UINTN MenuNumber
639 );
640
641 //
642 // Locate all serial io devices for console
643 //
644 /**
645 Build a list containing all serial devices.
646
647 @retval EFI_SUCCESS The function complete successfully.
648 @retval EFI_UNSUPPORTED No serial ports present.
649
650 **/
651 EFI_STATUS
652 LocateSerialIo (
653 VOID
654 );
655
656 //
657 // Initializing Console menu
658 //
659 /**
660 Build up ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
661
662 @retval EFI_SUCCESS The function always complete successfully.
663
664 **/
665 EFI_STATUS
666 GetAllConsoles(
667 VOID
668 );
669
670 //
671 // Get current mode information
672 //
673 /**
674 Get mode number according to column and row
675
676 @param CallbackData The BMM context data.
677 **/
678 VOID
679 GetConsoleOutMode (
680 IN BMM_CALLBACK_DATA *CallbackData
681 );
682
683 //
684 // Cleaning up console menu
685 //
686 /**
687 Free ConsoleOutMenu, ConsoleInpMenu and ConsoleErrMenu
688
689 @retval EFI_SUCCESS The function always complete successfully.
690 **/
691 EFI_STATUS
692 FreeAllConsoles (
693 VOID
694 );
695
696 /**
697 Update the device path that describing a terminal device
698 based on the new BaudRate, Data Bits, parity and Stop Bits
699 set.
700
701 @param DevicePath The devicepath protocol instance wanted to be updated.
702
703 **/
704 VOID
705 ChangeVariableDevicePath (
706 IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath
707 );
708
709 /**
710 Update the multi-instance device path of Terminal Device based on
711 the global TerminalMenu. If ChangeTernimal is TRUE, the terminal
712 device path in the Terminal Device in TerminalMenu is also updated.
713
714 @param DevicePath The multi-instance device path.
715 @param ChangeTerminal TRUE, then device path in the Terminal Device
716 in TerminalMenu is also updated; FALSE, no update.
717
718 @return EFI_SUCCESS The function completes successfully.
719
720 **/
721 EFI_STATUS
722 ChangeTerminalDevicePath (
723 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
724 IN BOOLEAN ChangeTerminal
725 );
726
727 //
728 // Variable operation by menu selection
729 //
730 /**
731 This function create a currently loaded Boot Option from
732 the BMM. It then appends this Boot Option to the end of
733 the "BootOrder" list. It also append this Boot Opotion to the end
734 of BootOptionMenu.
735
736 @param CallbackData The BMM context data.
737 @param NvRamMap The file explorer formset internal state.
738
739 @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
740 @retval EFI_SUCCESS If function completes successfully.
741
742 **/
743 EFI_STATUS
744 Var_UpdateBootOption (
745 IN BMM_CALLBACK_DATA *CallbackData,
746 IN FILE_EXPLORER_NV_DATA *NvRamMap
747 );
748
749 /**
750 Delete Boot Option that represent a Deleted state in BootOptionMenu.
751 After deleting this boot option, call Var_ChangeBootOrder to
752 make sure BootOrder is in valid state.
753
754 @retval EFI_SUCCESS If all boot load option EFI Variables corresponding to
755 BM_LOAD_CONTEXT marked for deletion is deleted
756 @return Others If failed to update the "BootOrder" variable after deletion.
757
758 **/
759 EFI_STATUS
760 Var_DelBootOption (
761 VOID
762 );
763
764 /**
765 After any operation on Boot####, there will be a discrepancy in BootOrder.
766 Since some are missing but in BootOrder, while some are present but are
767 not reflected by BootOrder. Then a function rebuild BootOrder from
768 scratch by content from BootOptionMenu is needed.
769
770 @retval EFI_SUCCESS The boot order is updated successfully.
771 @return other than EFI_SUCCESS if failed to change the "BootOrder" EFI Variable.
772
773 **/
774 EFI_STATUS
775 Var_ChangeBootOrder (
776 VOID
777 );
778
779 /**
780 This function create a currently loaded Drive Option from
781 the BMM. It then appends this Driver Option to the end of
782 the "DriverOrder" list. It append this Driver Opotion to the end
783 of DriverOptionMenu.
784
785 @param CallbackData The BMM context data.
786 @param HiiHandle The HII handle associated with the BMM formset.
787 @param DescriptionData The description of this driver option.
788 @param OptionalData The optional load option.
789 @param ForceReconnect If to force reconnect.
790
791 @retval EFI_OUT_OF_RESOURCES If not enought memory to complete the operation.
792 @retval EFI_SUCCESS If function completes successfully.
793
794 **/
795 EFI_STATUS
796 Var_UpdateDriverOption (
797 IN BMM_CALLBACK_DATA *CallbackData,
798 IN EFI_HII_HANDLE HiiHandle,
799 IN UINT16 *DescriptionData,
800 IN UINT16 *OptionalData,
801 IN UINT8 ForceReconnect
802 );
803
804 /**
805 Delete Load Option that represent a Deleted state in BootOptionMenu.
806 After deleting this Driver option, call Var_ChangeDriverOrder to
807 make sure DriverOrder is in valid state.
808
809 @retval EFI_SUCCESS Load Option is successfully updated.
810 @return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI
811 Variable.
812
813 **/
814 EFI_STATUS
815 Var_DelDriverOption (
816 VOID
817 );
818
819 /**
820 After any operation on Driver####, there will be a discrepancy in
821 DriverOrder. Since some are missing but in DriverOrder, while some
822 are present but are not reflected by DriverOrder. Then a function
823 rebuild DriverOrder from scratch by content from DriverOptionMenu is
824 needed.
825
826 @retval EFI_SUCCESS The driver order is updated successfully.
827 @return other than EFI_SUCCESS if failed to set the "DriverOrder" EFI Variable.
828
829 **/
830 EFI_STATUS
831 Var_ChangeDriverOrder (
832 VOID
833 );
834
835 /**
836 This function delete and build multi-instance device path ConIn
837 console device.
838
839 @retval EFI_SUCCESS The function complete successfully.
840 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
841 **/
842 EFI_STATUS
843 Var_UpdateConsoleInpOption (
844 VOID
845 );
846
847 /**
848 This function delete and build multi-instance device path ConOut console device.
849
850 @retval EFI_SUCCESS The function complete successfully.
851 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
852 **/
853 EFI_STATUS
854 Var_UpdateConsoleOutOption (
855 VOID
856 );
857
858 /**
859 This function delete and build multi-instance device path ErrOut console device.
860
861 @retval EFI_SUCCESS The function complete successfully.
862 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
863 **/
864 EFI_STATUS
865 Var_UpdateErrorOutOption (
866 VOID
867 );
868
869 /**
870 Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new BaudRate, Data Bits,
871 parity and stop Bits set.
872
873 **/
874 VOID
875 Var_UpdateAllConsoleOption (
876 VOID
877 );
878
879 /**
880 This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM,
881 this EFI Variable is deleted.
882 It also update the BMM context data specified the "BootNext" value.
883
884 @param CallbackData The BMM context data.
885
886 @retval EFI_SUCCESS The function complete successfully.
887 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
888
889 **/
890 EFI_STATUS
891 Var_UpdateBootNext (
892 IN BMM_CALLBACK_DATA *CallbackData
893 );
894
895 /**
896 This function update the "BootOrder" EFI Variable based on BMM Formset's NV map. It then refresh
897 BootOptionMenu with the new "BootOrder" list.
898
899 @param CallbackData The BMM context data.
900
901 @retval EFI_SUCCESS The function complete successfully.
902 @retval EFI_OUT_OF_RESOURCES Not enough memory to complete the function.
903 @return not The EFI variable can not be saved. See gRT->SetVariable for detail return information.
904
905 **/
906 EFI_STATUS
907 Var_UpdateBootOrder (
908 IN BMM_CALLBACK_DATA *CallbackData
909 );
910
911 /**
912 This function update the "DriverOrder" EFI Variable based on
913 BMM Formset's NV map. It then refresh DriverOptionMenu
914 with the new "DriverOrder" list.
915
916 @param CallbackData The BMM context data.
917
918 @retval EFI_SUCCESS The function complete successfully.
919 @retval EFI_OUT_OF_RESOURCES Not enough memory to complete the function.
920 @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.
921
922 **/
923 EFI_STATUS
924 Var_UpdateDriverOrder (
925 IN BMM_CALLBACK_DATA *CallbackData
926 );
927
928 /**
929 Update the legacy BBS boot option. VAR_LEGACY_DEV_ORDER and gEfiLegacyDevOrderVariableGuid EFI Variable
930 is udpated with the new Legacy Boot order. The EFI Variable of "Boot####" and gEfiGlobalVariableGuid
931 is also updated.
932
933 @param CallbackData The context data for BMM.
934
935 @return EFI_SUCCESS The function completed successfully.
936 @retval EFI_NOT_FOUND If VAR_LEGACY_DEV_ORDER and gEfiLegacyDevOrderVariableGuid EFI Variable can not be found.
937
938 **/
939 EFI_STATUS
940 Var_UpdateBBSOption (
941 IN BMM_CALLBACK_DATA *CallbackData
942 );
943
944 /**
945 Update the Text Mode of Console.
946
947 @param CallbackData The context data for BMM.
948
949 @retval EFI_SUCCSS If the Text Mode of Console is updated.
950 @return Other value if the Text Mode of Console is not updated.
951
952 **/
953 EFI_STATUS
954 Var_UpdateConMode (
955 IN BMM_CALLBACK_DATA *CallbackData
956 );
957
958 //
959 // Following are page create and refresh functions
960 //
961 /**
962 Refresh the global UpdateData structure.
963
964 **/
965 VOID
966 RefreshUpdateData (
967 VOID
968 );
969
970 /**
971 Clean up the dynamic opcode at label and form specified by
972 both LabelId.
973
974 @param LabelId It is both the Form ID and Label ID for
975 opcode deletion.
976 @param CallbackData The BMM context data.
977
978 **/
979 VOID
980 CleanUpPage (
981 IN UINT16 LabelId,
982 IN BMM_CALLBACK_DATA *CallbackData
983 );
984
985 /**
986 Create a lit of boot option from global BootOptionMenu. It
987 allow user to delete the boot option.
988
989 @param CallbackData The BMM context data.
990
991 **/
992 VOID
993 UpdateBootDelPage (
994 IN BMM_CALLBACK_DATA *CallbackData
995 );
996
997 /**
998 Create a lit of driver option from global DriverMenu.
999
1000 @param CallbackData The BMM context data.
1001 **/
1002 VOID
1003 UpdateDrvAddHandlePage (
1004 IN BMM_CALLBACK_DATA *CallbackData
1005 );
1006
1007 /**
1008 Create a lit of driver option from global DriverOptionMenu. It
1009 allow user to delete the driver option.
1010
1011 @param CallbackData The BMM context data.
1012 **/
1013 VOID
1014 UpdateDrvDelPage (
1015 IN BMM_CALLBACK_DATA *CallbackData
1016 );
1017
1018 /**
1019 Prepare the page to allow user to add description for a Driver Option.
1020
1021 @param CallbackData The BMM context data.
1022 **/
1023 VOID
1024 UpdateDriverAddHandleDescPage (
1025 IN BMM_CALLBACK_DATA *CallbackData
1026 );
1027
1028 /**
1029 Dispatch the correct update page function to call based on the UpdatePageId.
1030
1031 @param UpdatePageId The form ID.
1032 @param CallbackData The BMM context data.
1033 **/
1034 VOID
1035 UpdatePageBody (
1036 IN UINT16 UpdatePageId,
1037 IN BMM_CALLBACK_DATA *CallbackData
1038 );
1039
1040 /**
1041 Create the dynamic page to allow user to set the "BootNext" vaule.
1042
1043 @param CallbackData The BMM context data.
1044 **/
1045 VOID
1046 UpdateBootNextPage (
1047 IN BMM_CALLBACK_DATA *CallbackData
1048 );
1049
1050 /**
1051 Create the dynamic page to allow user to set the "TimeOut" vaule.
1052
1053 @param CallbackData The BMM context data.
1054 **/
1055 VOID
1056 UpdateTimeOutPage (
1057 IN BMM_CALLBACK_DATA *CallbackData
1058 );
1059
1060 /**
1061 Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,
1062 Parity, Stop Bits, Terminal Type.
1063
1064 @param CallbackData The BMM context data.
1065 **/
1066 VOID
1067 UpdateTerminalPage (
1068 IN BMM_CALLBACK_DATA *CallbackData
1069 );
1070
1071 /**
1072 Refresh the text mode page
1073
1074 @param CallbackData The BMM context data.
1075 **/
1076 VOID
1077 UpdateConModePage (
1078 IN BMM_CALLBACK_DATA *CallbackData
1079 );
1080
1081 /**
1082 Create a list of Goto Opcode for all terminal devices logged
1083 by TerminaMenu. This list will be inserted to form FORM_CON_COM_SETUP_ID.
1084
1085 @param CallbackData The BMM context data.
1086 **/
1087 VOID
1088 UpdateConCOMPage (
1089 IN BMM_CALLBACK_DATA *CallbackData
1090 );
1091
1092 /**
1093 Create a dynamic page so that Legacy Device boot order
1094 can be set for specified device type.
1095
1096 @param UpdatePageId The form ID. It also spefies the legacy device type.
1097 @param CallbackData The BMM context data.
1098 **/
1099 VOID
1100 UpdateSetLegacyDeviceOrderPage (
1101 IN UINT16 UpdatePageId,
1102 IN BMM_CALLBACK_DATA *CallbackData
1103 );
1104
1105
1106 /**
1107 Function opens and returns a file handle to the root directory of a volume.
1108
1109 @param DeviceHandle A handle for a device
1110 @return A valid file handle or NULL is returned
1111 **/
1112 EFI_FILE_HANDLE
1113 EfiLibOpenRoot (
1114 IN EFI_HANDLE DeviceHandle
1115 );
1116
1117 /**
1118 Function gets the file system information from an open file descriptor,
1119 and stores it in a buffer allocated from pool.
1120
1121 @param FHand The file handle.
1122
1123 @return A pointer to a buffer with file information.
1124 NULL is returned if failed to get Vaolume Label Info.
1125 **/
1126 EFI_FILE_SYSTEM_VOLUME_LABEL *
1127 EfiLibFileSystemVolumeLabelInfo (
1128 IN EFI_FILE_HANDLE FHand
1129 );
1130
1131 /**
1132
1133 Function gets the file information from an open file descriptor, and stores it
1134 in a buffer allocated from pool.
1135
1136 @param FHand File Handle.
1137
1138 @return A pointer to a buffer with file information or NULL is returned
1139
1140 **/
1141 EFI_FILE_INFO *
1142 EfiLibFileInfo (
1143 IN EFI_FILE_HANDLE FHand
1144 );
1145
1146 /**
1147 Adjusts the size of a previously allocated buffer.
1148
1149 @param OldPool A pointer to the buffer whose size is being adjusted.
1150 @param OldSize The size of the current buffer.
1151 @param NewSize The size of the new buffer.
1152
1153 @return The newly allocated buffer. if NULL, allocation failed.
1154
1155 **/
1156 VOID*
1157 EfiReallocatePool (
1158 IN VOID *OldPool,
1159 IN UINTN OldSize,
1160 IN UINTN NewSize
1161 );
1162
1163 /**
1164 Function deletes the variable specified by VarName and VarGuid.
1165
1166
1167 @param VarName A Null-terminated Unicode string that is
1168 the name of the vendor's variable.
1169
1170 @param VarGuid A unique identifier for the vendor.
1171
1172 @retval EFI_SUCCESS The variable was found and removed
1173 @retval EFI_UNSUPPORTED The variable store was inaccessible
1174 @retval EFI_OUT_OF_RESOURCES The temporary buffer was not available
1175 @retval EFI_NOT_FOUND The variable was not found
1176
1177 **/
1178 EFI_STATUS
1179 EfiLibDeleteVariable (
1180 IN CHAR16 *VarName,
1181 IN EFI_GUID *VarGuid
1182 );
1183
1184 /**
1185 Duplicate a string.
1186
1187 @param Src The source.
1188
1189 @return A new string which is duplicated copy of the source.
1190 @retval NULL If there is not enough memory.
1191
1192 **/
1193 CHAR16 *
1194 EfiStrDuplicate (
1195 IN CHAR16 *Src
1196 );
1197
1198 /**
1199 Function is used to determine the number of device path instances
1200 that exist in a device path.
1201
1202
1203 @param DevicePath A pointer to a device path data structure.
1204
1205 @return This function counts and returns the number of device path instances
1206 in DevicePath.
1207
1208 **/
1209 UINTN
1210 EfiDevicePathInstanceCount (
1211 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
1212 );
1213
1214 /**
1215 Create string tokens for a menu from its help strings and display strings
1216
1217
1218 @param CallbackData The BMM context data.
1219 @param HiiHandle Hii Handle of the package to be updated.
1220 @param MenuOption The Menu whose string tokens need to be created
1221
1222 @retval EFI_SUCCESS string tokens created successfully
1223 @retval others contain some errors
1224
1225 **/
1226 EFI_STATUS
1227 CreateMenuStringToken (
1228 IN BMM_CALLBACK_DATA *CallbackData,
1229 IN EFI_HII_HANDLE HiiHandle,
1230 IN BM_MENU_OPTION *MenuOption
1231 );
1232
1233 /**
1234 Get a string from the Data Hub record based on
1235 a device path.
1236
1237 @param DevPath The device Path.
1238
1239 @return A string located from the Data Hub records based on
1240 the device path.
1241 @retval NULL If failed to get the String from Data Hub.
1242
1243 **/
1244 UINT16 *
1245 EfiLibStrFromDatahub (
1246 IN EFI_DEVICE_PATH_PROTOCOL *DevPath
1247 );
1248
1249 /**
1250 Get the index number (#### in Boot####) for the boot option pointed to a BBS legacy device type
1251 specified by DeviceType.
1252
1253 @param DeviceType The legacy device type. It can be floppy, network, harddisk, cdrom,
1254 etc.
1255 @param OptionIndex Returns the index number (#### in Boot####).
1256 @param OptionSize Return the size of the Boot### variable.
1257
1258 **/
1259 VOID *
1260 GetLegacyBootOptionVar (
1261 IN UINTN DeviceType,
1262 OUT UINTN *OptionIndex,
1263 OUT UINTN *OptionSize
1264 );
1265
1266 /**
1267 Initialize the Boot Maintenance Utitliy.
1268
1269 @retval EFI_SUCCESS utility ended successfully.
1270 @retval others contain some errors.
1271
1272 **/
1273 EFI_STATUS
1274 InitializeBM (
1275 VOID
1276 );
1277
1278 /**
1279 Start boot maintenance manager
1280
1281 @retval EFI_SUCCESS If BMM is invoked successfully.
1282 @return Other value if BMM return unsuccessfully.
1283
1284 **/
1285 EFI_STATUS
1286 BdsStartBootMaint (
1287 VOID
1288 );
1289
1290 /**
1291 Intialize all the string depositories.
1292
1293 **/
1294 VOID
1295 InitializeStringDepository (
1296 VOID
1297 );
1298
1299 /**
1300 Fetch a usable string node from the string depository and return the string token.
1301
1302
1303 @param CallbackData The BMM context data.
1304 @param StringDepository Pointer of the string depository.
1305
1306 @retval EFI_STRING_ID String token.
1307
1308 **/
1309 EFI_STRING_ID
1310 GetStringTokenFromDepository (
1311 IN BMM_CALLBACK_DATA *CallbackData,
1312 IN STRING_DEPOSITORY *StringDepository
1313 );
1314
1315 /**
1316 Reclaim string depositories by moving the current node pointer to list head..
1317 **/
1318 VOID
1319 ReclaimStringDepository (
1320 VOID
1321 );
1322
1323 /**
1324 Release resource for all the string depositories.
1325
1326 **/
1327 VOID
1328 CleanUpStringDepository (
1329 VOID
1330 );
1331
1332 /**
1333 Function handling request to apply changes for BMM pages.
1334
1335 @param Private Pointer to callback data buffer.
1336 @param CurrentFakeNVMap Pointer to buffer holding data of various values used by BMM
1337 @param FormId ID of the form which has sent the request to apply change.
1338
1339 @retval EFI_SUCCESS Change successfully applied.
1340 @retval Other Error occurs while trying to apply changes.
1341
1342 **/
1343 EFI_STATUS
1344 ApplyChangeHandler (
1345 IN BMM_CALLBACK_DATA *Private,
1346 IN BMM_FAKE_NV_DATA *CurrentFakeNVMap,
1347 IN EFI_FORM_ID FormId
1348 );
1349
1350 /**
1351 Discard all changes done to the BMM pages such as Boot Order change,
1352 Driver order change.
1353
1354 @param Private The BMM context data.
1355 @param CurrentFakeNVMap The current Fack NV Map.
1356
1357 **/
1358 VOID
1359 DiscardChangeHandler (
1360 IN BMM_CALLBACK_DATA *Private,
1361 IN BMM_FAKE_NV_DATA *CurrentFakeNVMap
1362 );
1363
1364 /**
1365 Dispatch the display to the next page based on NewPageId.
1366
1367 @param Private The BMM context data.
1368 @param NewPageId The original page ID.
1369
1370 **/
1371 VOID
1372 UpdatePageId (
1373 BMM_CALLBACK_DATA *Private,
1374 UINT16 NewPageId
1375 );
1376
1377 /**
1378 Boot a file selected by user at File Expoloer of BMM.
1379
1380 @param FileContext The file context data, which contains the device path
1381 of the file to be boot from.
1382
1383 @retval EFI_SUCCESS The function completed successfull.
1384 @return Other value if the boot from the file fails.
1385
1386 **/
1387 EFI_STATUS
1388 BootThisFile (
1389 IN BM_FILE_CONTEXT *FileContext
1390 );
1391
1392 /**
1393 Update the file explower page with the refershed file system.
1394
1395
1396 @param CallbackData BMM context data
1397 @param KeyValue Key value to identify the type of data to expect.
1398
1399 @retval TRUE Inform the caller to create a callback packet to exit file explorer.
1400 @retval FALSE Indicate that there is no need to exit file explorer.
1401
1402 **/
1403 BOOLEAN
1404 UpdateFileExplorer (
1405 IN BMM_CALLBACK_DATA *CallbackData,
1406 IN UINT16 KeyValue
1407 );
1408
1409 /**
1410 This function processes the results of changes in configuration.
1411 When user select a interactive opcode, this callback will be triggered.
1412 Based on the Question(QuestionId) that triggers the callback, the corresponding
1413 actions is performed. It handles:
1414
1415 1) the addition of boot option.
1416 2) the addition of driver option.
1417 3) exit from file browser
1418 4) update of file content if a dir is selected.
1419 5) boot the file if a file is selected in "boot from file"
1420
1421
1422 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
1423 @param Action Specifies the type of action taken by the browser.
1424 @param QuestionId A unique value which is sent to the original exporting driver
1425 so that it can identify the type of data to expect.
1426 @param Type The type of value for the question.
1427 @param Value A pointer to the data being sent to the original exporting driver.
1428 @param ActionRequest On return, points to the action requested by the callback function.
1429
1430 @retval EFI_SUCCESS The callback successfully handled the action.
1431 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
1432 @retval EFI_DEVICE_ERROR The variable could not be saved.
1433 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
1434
1435 **/
1436 EFI_STATUS
1437 EFIAPI
1438 FileExplorerCallback (
1439 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
1440 IN EFI_BROWSER_ACTION Action,
1441 IN EFI_QUESTION_ID QuestionId,
1442 IN UINT8 Type,
1443 IN EFI_IFR_TYPE_VALUE *Value,
1444 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
1445 );
1446
1447 /**
1448 Dispatch BMM formset and FileExplorer formset.
1449
1450
1451 @param CallbackData The BMM context data.
1452
1453 @retval EFI_SUCCESS If function complete successfully.
1454 @return Other value if the Setup Browser process BMM's pages and
1455 return unsuccessfully.
1456
1457 **/
1458 EFI_STATUS
1459 FormSetDispatcher (
1460 IN BMM_CALLBACK_DATA *CallbackData
1461 );
1462
1463 /**
1464 Function returns the value of the specified variable.
1465
1466 @param Name A Null-terminated Unicode string that is
1467 the name of the vendor's variable.
1468 @param VendorGuid A unique identifier for the vendor.
1469
1470 @return The payload of the variable.
1471 @retval NULL If the variable can't be read.
1472
1473 **/
1474 VOID *
1475 EfiLibGetVariable (
1476 IN CHAR16 *Name,
1477 IN EFI_GUID *VendorGuid
1478 );
1479
1480 //
1481 // Global variable in this program (defined in data.c)
1482 //
1483 extern BM_MENU_OPTION BootOptionMenu;
1484 extern BM_MENU_OPTION DriverOptionMenu;
1485 extern BM_MENU_OPTION FsOptionMenu;
1486 extern BM_MENU_OPTION ConsoleInpMenu;
1487 extern BM_MENU_OPTION ConsoleOutMenu;
1488 extern BM_MENU_OPTION ConsoleErrMenu;
1489 extern BM_MENU_OPTION DirectoryMenu;
1490 extern BM_MENU_OPTION DriverMenu;
1491 extern BM_MENU_OPTION TerminalMenu;
1492 extern BM_MENU_OPTION LegacyFDMenu;
1493 extern BM_MENU_OPTION LegacyHDMenu;
1494 extern BM_MENU_OPTION LegacyCDMenu;
1495 extern BM_MENU_OPTION LegacyNETMenu;
1496 extern BM_MENU_OPTION LegacyBEVMenu;
1497 extern UINT16 TerminalType[];
1498 extern COM_ATTR BaudRateList[19];
1499 extern COM_ATTR DataBitsList[4];
1500 extern COM_ATTR ParityList[5];
1501 extern COM_ATTR StopBitsList[3];
1502 extern EFI_GUID TerminalTypeGuid[4];
1503 extern STRING_DEPOSITORY *FileOptionStrDepository;
1504 extern STRING_DEPOSITORY *ConsoleOptionStrDepository;
1505 extern STRING_DEPOSITORY *BootOptionStrDepository;
1506 extern STRING_DEPOSITORY *BootOptionHelpStrDepository;
1507 extern STRING_DEPOSITORY *DriverOptionStrDepository;
1508 extern STRING_DEPOSITORY *DriverOptionHelpStrDepository;
1509 extern STRING_DEPOSITORY *TerminalStrDepository;
1510 extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
1511 extern UINT16 mFlowControlType[2];
1512 extern UINT32 mFlowControlValue[2];
1513 //
1514 // Shared IFR form update data
1515 //
1516 extern VOID *mStartOpCodeHandle;
1517 extern VOID *mEndOpCodeHandle;
1518 extern EFI_IFR_GUID_LABEL *mStartLabel;
1519 extern EFI_IFR_GUID_LABEL *mEndLabel;
1520
1521 #endif