summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2015-08-20 07:05:53 +0000
committerdandanbi <dandanbi@Edk2>2015-08-20 07:05:53 +0000
commita22a50fa138dfa451edbfc85856221c383fe1d37 (patch)
treea83cb93ce977ffafe7c9b7cf80e1cdf913f01945 /MdeModulePkg
parenteb213f2f392dd36b5667f7cb76a98c4af0804c9c (diff)
downloadedk2-platforms-a22a50fa138dfa451edbfc85856221c383fe1d37.tar.xz
MdeModulePkg:Full support F10 hot key in UiApp.
In current UiApp/Boot Maintenance manager,some pages don't support F10, they use Commit Changes and Exit menu to save changes.Now support F10 in these pages. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18249 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/Bmstring.unibin41794 -> 42642 bytes
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c433
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h123
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c147
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/Data.c13
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/FE.vfr24
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c187
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h32
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c176
-rw-r--r--MdeModulePkg/Application/UiApp/BootMaint/Variable.c26
10 files changed, 804 insertions, 357 deletions
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index a208127ac6..f91d599289 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
Binary files differ
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
index 0a6eb6c99b..0a187f5696 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
@@ -296,9 +296,12 @@ BootMaintRouteConfig (
EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
BMM_FAKE_NV_DATA *NewBmmData;
BMM_FAKE_NV_DATA *OldBmmData;
+ BM_CONSOLE_CONTEXT *NewConsoleContext;
+ BM_TERMINAL_CONTEXT *NewTerminalContext;
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
- UINT16 Index;
+ UINT16 Index;
+ BOOLEAN TerminalAttChange;
BMM_CALLBACK_DATA *Private;
if (Progress == NULL) {
@@ -368,6 +371,7 @@ BootMaintRouteConfig (
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
NewLoadContext->Deleted = NewBmmData->BootOptionDel[Index];
NewBmmData->BootOptionDel[Index] = FALSE;
+ NewBmmData->BootOptionDelMark[Index] = FALSE;
}
Var_DelBootOption ();
@@ -375,7 +379,20 @@ BootMaintRouteConfig (
if (CompareMem (NewBmmData->BootOptionOrder, OldBmmData->BootOptionOrder, sizeof (NewBmmData->BootOptionOrder)) != 0) {
Status = Var_UpdateBootOrder (Private);
- }
+ }
+
+ if (CompareMem (&NewBmmData->BootTimeOut, &OldBmmData->BootTimeOut, sizeof (NewBmmData->BootTimeOut)) != 0){
+ Status = gRT->SetVariable(
+ L"Timeout",
+ &gEfiGlobalVariableGuid,
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
+ sizeof(UINT16),
+ &(NewBmmData->BootTimeOut)
+ );
+ ASSERT_EFI_ERROR(Status);
+
+ Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
+ }
//
// Check data which located in Driver Options Menu and save the settings if need
@@ -388,13 +405,112 @@ BootMaintRouteConfig (
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
NewLoadContext->Deleted = NewBmmData->DriverOptionDel[Index];
NewBmmData->DriverOptionDel[Index] = FALSE;
+ NewBmmData->DriverOptionDelMark[Index] = FALSE;
}
Var_DelDriverOption ();
}
if (CompareMem (NewBmmData->DriverOptionOrder, OldBmmData->DriverOptionOrder, sizeof (NewBmmData->DriverOptionOrder)) != 0) {
Status = Var_UpdateDriverOrder (Private);
- }
+ }
+
+ if (CompareMem (&NewBmmData->ConsoleOutMode, &OldBmmData->ConsoleOutMode, sizeof (NewBmmData->ConsoleOutMode)) != 0){
+ Var_UpdateConMode(Private);
+ }
+
+ TerminalAttChange = FALSE;
+ for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
+
+ //
+ // only need update modified items
+ //
+ if (CompareMem (&NewBmmData->COMBaudRate[Index], &OldBmmData->COMBaudRate[Index], sizeof (NewBmmData->COMBaudRate[Index])) == 0 &&
+ CompareMem (&NewBmmData->COMDataRate[Index], &OldBmmData->COMDataRate[Index], sizeof (NewBmmData->COMDataRate[Index])) == 0 &&
+ CompareMem (&NewBmmData->COMStopBits[Index], &OldBmmData->COMStopBits[Index], sizeof (NewBmmData->COMStopBits[Index])) == 0 &&
+ CompareMem (&NewBmmData->COMParity[Index], &OldBmmData->COMParity[Index], sizeof (NewBmmData->COMParity[Index])) == 0 &&
+ CompareMem (&NewBmmData->COMTerminalType[Index], &OldBmmData->COMTerminalType[Index], sizeof (NewBmmData->COMTerminalType[Index])) == 0 &&
+ CompareMem (&NewBmmData->COMFlowControl[Index], &OldBmmData->COMFlowControl[Index], sizeof (NewBmmData->COMFlowControl[Index])) == 0) {
+ continue;
+ }
+
+ NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
+ ASSERT (NewMenuEntry != NULL);
+ NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ NewTerminalContext->BaudRateIndex = NewBmmData->COMBaudRate[Index];
+ ASSERT (NewBmmData->COMBaudRate[Index] < (sizeof (BaudRateList) / sizeof (BaudRateList[0])));
+ NewTerminalContext->BaudRate = BaudRateList[NewBmmData->COMBaudRate[Index]].Value;
+ NewTerminalContext->DataBitsIndex = NewBmmData->COMDataRate[Index];
+ ASSERT (NewBmmData->COMDataRate[Index] < (sizeof (DataBitsList) / sizeof (DataBitsList[0])));
+ NewTerminalContext->DataBits = (UINT8) DataBitsList[NewBmmData->COMDataRate[Index]].Value;
+ NewTerminalContext->StopBitsIndex = NewBmmData->COMStopBits[Index];
+ ASSERT (NewBmmData->COMStopBits[Index] < (sizeof (StopBitsList) / sizeof (StopBitsList[0])));
+ NewTerminalContext->StopBits = (UINT8) StopBitsList[NewBmmData->COMStopBits[Index]].Value;
+ NewTerminalContext->ParityIndex = NewBmmData->COMParity[Index];
+ ASSERT (NewBmmData->COMParity[Index] < (sizeof (ParityList) / sizeof (ParityList[0])));
+ NewTerminalContext->Parity = (UINT8) ParityList[NewBmmData->COMParity[Index]].Value;
+ NewTerminalContext->TerminalType = NewBmmData->COMTerminalType[Index];
+ NewTerminalContext->FlowControl = NewBmmData->COMFlowControl[Index];
+ ChangeTerminalDevicePath (
+ NewTerminalContext->DevicePath,
+ FALSE
+ );
+ TerminalAttChange = TRUE;
+ }
+ if (TerminalAttChange) {
+ Var_UpdateConsoleInpOption ();
+ Var_UpdateConsoleOutOption ();
+ Var_UpdateErrorOutOption ();
+ }
+ //
+ // Check data which located in Console Options Menu and save the settings if need
+ //
+ if (CompareMem (NewBmmData->ConsoleInCheck, OldBmmData->ConsoleInCheck, sizeof (NewBmmData->ConsoleInCheck)) != 0){
+ for (Index = 0; Index < ConsoleInpMenu.MenuNumber; Index++){
+ NewMenuEntry = BOpt_GetMenuEntry(&ConsoleInpMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *)NewMenuEntry->VariableContext;
+ ASSERT (Index < MAX_MENU_NUMBER);
+ NewConsoleContext->IsActive = NewBmmData->ConsoleInCheck[Index];
+ }
+ for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
+ NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ ASSERT (Index + ConsoleInpMenu.MenuNumber < MAX_MENU_NUMBER);
+ NewTerminalContext->IsConIn = NewBmmData->ConsoleInCheck[Index + ConsoleInpMenu.MenuNumber];
+ }
+ Var_UpdateConsoleInpOption();
+ }
+
+ if (CompareMem (NewBmmData->ConsoleOutCheck, OldBmmData->ConsoleOutCheck, sizeof (NewBmmData->ConsoleOutCheck)) != 0){
+ for (Index = 0; Index < ConsoleOutMenu.MenuNumber; Index++){
+ NewMenuEntry = BOpt_GetMenuEntry(&ConsoleOutMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *)NewMenuEntry->VariableContext;
+ ASSERT (Index < MAX_MENU_NUMBER);
+ NewConsoleContext->IsActive = NewBmmData->ConsoleOutCheck[Index];
+ }
+ for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
+ NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ ASSERT (Index + ConsoleOutMenu.MenuNumber < MAX_MENU_NUMBER);
+ NewTerminalContext->IsConOut = NewBmmData->ConsoleOutCheck[Index + ConsoleOutMenu.MenuNumber];
+ }
+ Var_UpdateConsoleOutOption();
+ }
+
+ if (CompareMem (NewBmmData->ConsoleErrCheck, OldBmmData->ConsoleErrCheck, sizeof (NewBmmData->ConsoleErrCheck)) != 0){
+ for (Index = 0; Index < ConsoleErrMenu.MenuNumber; Index++){
+ NewMenuEntry = BOpt_GetMenuEntry(&ConsoleErrMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *)NewMenuEntry->VariableContext;
+ ASSERT (Index < MAX_MENU_NUMBER);
+ NewConsoleContext->IsActive = NewBmmData->ConsoleErrCheck[Index];
+ }
+ for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
+ NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ ASSERT (Index + ConsoleErrMenu.MenuNumber < MAX_MENU_NUMBER);
+ NewTerminalContext->IsStdErr = NewBmmData->ConsoleErrCheck[Index + ConsoleErrMenu.MenuNumber];
+ }
+ Var_UpdateErrorOutOption();
+ }
//
// After user do the save action, need to update OldBmmData.
@@ -436,7 +552,6 @@ BootMaintCallback (
BMM_CALLBACK_DATA *Private;
BM_MENU_ENTRY *NewMenuEntry;
BMM_FAKE_NV_DATA *CurrentFakeNVMap;
- EFI_STATUS Status;
UINTN OldValue;
UINTN NewValue;
UINTN Number;
@@ -583,32 +698,44 @@ BootMaintCallback (
return EFI_INVALID_PARAMETER;
}
- switch (QuestionId) {
- case KEY_VALUE_SAVE_AND_EXIT:
- case KEY_VALUE_NO_SAVE_AND_EXIT:
- if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
- Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
- DiscardChangeHandler (Private, CurrentFakeNVMap);
+ if ((QuestionId >= BOOT_OPTION_DEL_QUESTION_ID) && (QuestionId < BOOT_OPTION_DEL_QUESTION_ID + MAX_MENU_NUMBER)) {
+ if (Value->b){
+ //
+ // Means user try to delete this boot option but not press F10 or "Commit Changes and Exit" menu.
+ //
+ CurrentFakeNVMap->BootOptionDelMark[QuestionId - BOOT_OPTION_DEL_QUESTION_ID] = TRUE;
+ } else {
+ //
+ // Means user remove the old check status.
+ //
+ CurrentFakeNVMap->BootOptionDelMark[QuestionId - BOOT_OPTION_DEL_QUESTION_ID] = FALSE;
}
+ } else if ((QuestionId >= DRIVER_OPTION_DEL_QUESTION_ID) && (QuestionId < DRIVER_OPTION_DEL_QUESTION_ID + MAX_MENU_NUMBER)) {
+ if (Value->b){
+ CurrentFakeNVMap->DriverOptionDelMark[QuestionId - DRIVER_OPTION_DEL_QUESTION_ID] = TRUE;
+ } else {
+ CurrentFakeNVMap->DriverOptionDelMark[QuestionId - DRIVER_OPTION_DEL_QUESTION_ID] = FALSE;
+ }
+ } else {
+ switch (QuestionId) {
+ case KEY_VALUE_SAVE_AND_EXIT:
+ case KEY_VALUE_NO_SAVE_AND_EXIT:
+ if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
+ DiscardChangeHandler (Private, CurrentFakeNVMap);
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
+ }
- //
- // Tell browser not to ask for confirmation of changes,
- // since we have already applied or discarded.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
-
- break;
+ break;
- case FORM_RESET:
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
- return EFI_UNSUPPORTED;
+ case FORM_RESET:
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ return EFI_UNSUPPORTED;
- default:
- break;
+ default:
+ break;
+ }
}
}
@@ -621,198 +748,6 @@ BootMaintCallback (
}
/**
- Function handling request to apply changes for BMM pages.
-
- @param Private Pointer to callback data buffer.
- @param CurrentFakeNVMap Pointer to buffer holding data of various values used by BMM
- @param FormId ID of the form which has sent the request to apply change.
-
- @retval EFI_SUCCESS Change successfully applied.
- @retval Other Error occurs while trying to apply changes.
-
-**/
-EFI_STATUS
-ApplyChangeHandler (
- IN BMM_CALLBACK_DATA *Private,
- IN BMM_FAKE_NV_DATA *CurrentFakeNVMap,
- IN EFI_FORM_ID FormId
- )
-{
- BM_CONSOLE_CONTEXT *NewConsoleContext;
- BM_TERMINAL_CONTEXT *NewTerminalContext;
- BM_LOAD_CONTEXT *NewLoadContext;
- BM_MENU_ENTRY *NewMenuEntry;
- EFI_STATUS Status;
- UINT16 Index;
-
- Status = EFI_SUCCESS;
-
- switch (FormId) {
- case FORM_BOOT_DEL_ID:
- for (Index = 0;
- ((Index < BootOptionMenu.MenuNumber) && (Index < (sizeof (CurrentFakeNVMap->BootOptionDel) / sizeof (CurrentFakeNVMap->BootOptionDel[0]))));
- Index ++) {
- NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
- NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
- NewLoadContext->Deleted = CurrentFakeNVMap->BootOptionDel[Index];
- CurrentFakeNVMap->BootOptionDel[Index] = FALSE;
- }
-
- Var_DelBootOption ();
- break;
-
- case FORM_DRV_DEL_ID:
- for (Index = 0;
- ((Index < DriverOptionMenu.MenuNumber) && (Index < (sizeof (CurrentFakeNVMap->DriverOptionDel) / sizeof (CurrentFakeNVMap->DriverOptionDel[0]))));
- Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&DriverOptionMenu, Index);
- NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
- NewLoadContext->Deleted = CurrentFakeNVMap->DriverOptionDel[Index];
- CurrentFakeNVMap->DriverOptionDel[Index] = FALSE;
- }
-
- Var_DelDriverOption ();
- break;
-
- case FORM_BOOT_CHG_ID:
- Status = Var_UpdateBootOrder (Private);
- break;
-
- case FORM_DRV_CHG_ID:
- Status = Var_UpdateDriverOrder (Private);
- break;
-
- case FORM_TIME_OUT_ID:
- Status = gRT->SetVariable (
- L"Timeout",
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
- sizeof (UINT16),
- &(CurrentFakeNVMap->BootTimeOut)
- );
- ASSERT_EFI_ERROR(Status);
-
- Private->BmmOldFakeNVData.BootTimeOut = CurrentFakeNVMap->BootTimeOut;
- break;
-
- case FORM_BOOT_NEXT_ID:
- Status = Var_UpdateBootNext (Private);
- break;
-
- case FORM_CON_MODE_ID:
- Status = Var_UpdateConMode (Private);
- break;
-
- case FORM_CON_COM_SETUP_ID:
- NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Private->CurrentTerminal);
-
- ASSERT (NewMenuEntry != NULL);
-
- NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
-
- NewTerminalContext->BaudRateIndex = CurrentFakeNVMap->COMBaudRate;
- ASSERT (CurrentFakeNVMap->COMBaudRate < (sizeof (BaudRateList) / sizeof (BaudRateList[0])));
- NewTerminalContext->BaudRate = BaudRateList[CurrentFakeNVMap->COMBaudRate].Value;
- NewTerminalContext->DataBitsIndex = CurrentFakeNVMap->COMDataRate;
- ASSERT (CurrentFakeNVMap->COMDataRate < (sizeof (DataBitsList) / sizeof (DataBitsList[0])));
- NewTerminalContext->DataBits = (UINT8) DataBitsList[CurrentFakeNVMap->COMDataRate].Value;
- NewTerminalContext->StopBitsIndex = CurrentFakeNVMap->COMStopBits;
- ASSERT (CurrentFakeNVMap->COMStopBits < (sizeof (StopBitsList) / sizeof (StopBitsList[0])));
- NewTerminalContext->StopBits = (UINT8) StopBitsList[CurrentFakeNVMap->COMStopBits].Value;
- NewTerminalContext->ParityIndex = CurrentFakeNVMap->COMParity;
- ASSERT (CurrentFakeNVMap->COMParity < (sizeof (ParityList) / sizeof (ParityList[0])));
- NewTerminalContext->Parity = (UINT8) ParityList[CurrentFakeNVMap->COMParity].Value;
- NewTerminalContext->TerminalType = CurrentFakeNVMap->COMTerminalType;
-
- ChangeTerminalDevicePath (
- NewTerminalContext->DevicePath,
- FALSE
- );
-
- Var_UpdateConsoleInpOption ();
- Var_UpdateConsoleOutOption ();
- Var_UpdateErrorOutOption ();
- break;
-
- case FORM_CON_IN_ID:
- for (Index = 0; Index < ConsoleInpMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&ConsoleInpMenu, Index);
- NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index < MAX_MENU_NUMBER);
- NewConsoleContext->IsActive = CurrentFakeNVMap->ConsoleCheck[Index];
- }
-
- for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
- NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index + ConsoleInpMenu.MenuNumber < MAX_MENU_NUMBER);
- NewTerminalContext->IsConIn = CurrentFakeNVMap->ConsoleCheck[Index + ConsoleInpMenu.MenuNumber];
- }
-
- Var_UpdateConsoleInpOption ();
- break;
-
- case FORM_CON_OUT_ID:
- for (Index = 0; Index < ConsoleOutMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&ConsoleOutMenu, Index);
- NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index < MAX_MENU_NUMBER);
- NewConsoleContext->IsActive = CurrentFakeNVMap->ConsoleCheck[Index];
- }
-
- for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
- NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index + ConsoleOutMenu.MenuNumber < MAX_MENU_NUMBER);
- NewTerminalContext->IsConOut = CurrentFakeNVMap->ConsoleCheck[Index + ConsoleOutMenu.MenuNumber];
- }
-
- Var_UpdateConsoleOutOption ();
- break;
-
- case FORM_CON_ERR_ID:
- for (Index = 0; Index < ConsoleErrMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&ConsoleErrMenu, Index);
- NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index < MAX_MENU_NUMBER);
- NewConsoleContext->IsActive = CurrentFakeNVMap->ConsoleCheck[Index];
- }
-
- for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
- NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
- ASSERT (Index + ConsoleErrMenu.MenuNumber < MAX_MENU_NUMBER);
- NewTerminalContext->IsStdErr = CurrentFakeNVMap->ConsoleCheck[Index + ConsoleErrMenu.MenuNumber];
- }
-
- Var_UpdateErrorOutOption ();
- break;
-
- case FORM_DRV_ADD_HANDLE_DESC_ID:
- Status = Var_UpdateDriverOption (
- Private,
- Private->BmmHiiHandle,
- CurrentFakeNVMap->DriverAddHandleDesc,
- CurrentFakeNVMap->DriverAddHandleOptionalData,
- CurrentFakeNVMap->DriverAddForceReconnect
- );
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- BOpt_GetDriverOptions (Private);
- CreateMenuStringToken (Private, Private->BmmHiiHandle, &DriverOptionMenu);
- break;
-
- default:
- break;
- }
-
-Error:
- return Status;
-}
-
-/**
Discard all changes done to the BMM pages such as Boot Order change,
Driver order change.
@@ -995,27 +930,65 @@ InitializeDrivers(
FreePool (HiiHandles);
}
-
/**
- Create dynamic code for BMM.
+ Create dynamic code for BMM and initialize all of BMM configuration data in BmmFakeNvData and
+ BmmOldFakeNVData member in BMM context data.
- @param BmmCallbackInfo The BMM context data.
+ @param CallbackData The BMM context data.
**/
VOID
-InitializeBmmConfig(
- IN BMM_CALLBACK_DATA *BmmCallbackInfo
+InitializeBmmConfig (
+ IN BMM_CALLBACK_DATA *CallbackData
)
{
- UpdateBootDelPage (BmmCallbackInfo);
- UpdateDrvDelPage (BmmCallbackInfo);
+ BM_MENU_ENTRY *NewMenuEntry;
+ BM_LOAD_CONTEXT *NewLoadContext;
+ UINT16 Index;
- if (TerminalMenu.MenuNumber > 0) {
- BmmCallbackInfo->CurrentTerminal = 0;
- UpdateTerminalPage (BmmCallbackInfo);
+ ASSERT (CallbackData != NULL);
+
+ InitializeDrivers (CallbackData);
+
+ //
+ // Initialize data which located in BMM main page
+ //
+ CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
+ for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
+ NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
+
+ if (NewLoadContext->IsBootNext) {
+ CallbackData->BmmFakeNvData.BootNext = Index;
+ break;
+ }
}
- InitializeDrivers (BmmCallbackInfo);
+ CallbackData->BmmFakeNvData.BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
+
+ //
+ // Initialize data which located in Boot Options Menu
+ //
+ GetBootOrder (CallbackData);
+
+ //
+ // Initialize data which located in Driver Options Menu
+ //
+ GetDriverOrder (CallbackData);
+
+ //
+ // Initialize data which located in Console Options Menu
+ //
+ GetConsoleOutMode (CallbackData);
+ GetConsoleInCheck (CallbackData);
+ GetConsoleOutCheck (CallbackData);
+ GetConsoleErrCheck (CallbackData);
+ GetTerminalAttribute (CallbackData);
+
+ //
+ // Backup Initialize BMM configuartion data to BmmOldFakeNVData
+ //
+ CopyMem (&CallbackData->BmmOldFakeNVData, &CallbackData->BmmFakeNvData, sizeof (BMM_FAKE_NV_DATA));
}
/**
@@ -1273,7 +1246,7 @@ InitBootMaintenance(
BmmCallbackInfo->BmmPreviousPageId = FORM_MAIN_ID;
BmmCallbackInfo->BmmCurrentPageId = FORM_MAIN_ID;
BmmCallbackInfo->FeConfigAccess.ExtractConfig = FakeExtractConfig;
- BmmCallbackInfo->FeConfigAccess.RouteConfig = FakeRouteConfig;
+ BmmCallbackInfo->FeConfigAccess.RouteConfig = FileExplorerRouteConfig;
BmmCallbackInfo->FeConfigAccess.Callback = FileExplorerCallback;
BmmCallbackInfo->FeCurrentState = FileExplorerStateInActive;
BmmCallbackInfo->FeDisplayContext = FileExplorerDisplayUnknown;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
index e1ac307639..23d2d2b6d1 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
@@ -179,6 +179,9 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define CON_ERR_COM2_VAR_OFFSET VAR_OFFSET (ConsoleErrorCOM2)
#define CON_MODE_VAR_OFFSET VAR_OFFSET (ConsoleOutMode)
#define CON_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleCheck)
+#define CON_IN_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleInCheck)
+#define CON_OUT_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleOutCheck)
+#define CON_ERR_DEVICE_VAR_OFFSET VAR_OFFSET (ConsoleErrCheck)
#define BOOT_OPTION_ORDER_VAR_OFFSET VAR_OFFSET (BootOptionOrder)
#define DRIVER_OPTION_ORDER_VAR_OFFSET VAR_OFFSET (DriverOptionOrder)
#define BOOT_OPTION_DEL_VAR_OFFSET VAR_OFFSET (BootOptionDel)
@@ -189,6 +192,7 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define COM_STOP_BITS_VAR_OFFSET VAR_OFFSET (COMStopBits)
#define COM_PARITY_VAR_OFFSET VAR_OFFSET (COMParity)
#define COM_TERMINAL_VAR_OFFSET VAR_OFFSET (COMTerminalType)
+#define COM_FLOWCONTROL_VAR_OFFSET VAR_OFFSET (COMFlowControl)
#define BOOT_TIME_OUT_QUESTION_ID QUESTION_ID (BootTimeOut)
#define BOOT_NEXT_QUESTION_ID QUESTION_ID (BootNext)
@@ -213,6 +217,9 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define CON_ERR_COM2_QUESTION_ID QUESTION_ID (ConsoleErrorCOM2)
#define CON_MODE_QUESTION_ID QUESTION_ID (ConsoleOutMode)
#define CON_DEVICE_QUESTION_ID QUESTION_ID (ConsoleCheck)
+#define CON_IN_DEVICE_QUESTION_ID QUESTION_ID (ConsoleInCheck)
+#define CON_OUT_DEVICE_QUESTION_ID QUESTION_ID (ConsoleOutCheck)
+#define CON_ERR_DEVICE_QUESTION_ID QUESTION_ID (ConsoleErrCheck)
#define BOOT_OPTION_ORDER_QUESTION_ID QUESTION_ID (BootOptionOrder)
#define DRIVER_OPTION_ORDER_QUESTION_ID QUESTION_ID (DriverOptionOrder)
#define BOOT_OPTION_DEL_QUESTION_ID QUESTION_ID (BootOptionDel)
@@ -223,6 +230,7 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define COM_STOP_BITS_QUESTION_ID QUESTION_ID (COMStopBits)
#define COM_PARITY_QUESTION_ID QUESTION_ID (COMParity)
#define COM_TERMINAL_QUESTION_ID QUESTION_ID (COMTerminalType)
+#define COM_FLOWCONTROL_QUESTION_ID QUESTION_ID (COMFlowControl)
#define STRING_DEPOSITORY_NUMBER 8
@@ -247,6 +255,8 @@ typedef struct {
UINT8 ParityIndex;
UINT8 StopBitsIndex;
+ UINT8 FlowControl;
+
UINT8 IsConIn;
UINT8 IsConOut;
UINT8 IsStdErr;
@@ -1310,24 +1320,6 @@ CleanUpStringDepository (
);
/**
- Function handling request to apply changes for BMM pages.
-
- @param Private Pointer to callback data buffer.
- @param CurrentFakeNVMap Pointer to buffer holding data of various values used by BMM
- @param FormId ID of the form which has sent the request to apply change.
-
- @retval EFI_SUCCESS Change successfully applied.
- @retval Other Error occurs while trying to apply changes.
-
-**/
-EFI_STATUS
-ApplyChangeHandler (
- IN BMM_CALLBACK_DATA *Private,
- IN BMM_FAKE_NV_DATA *CurrentFakeNVMap,
- IN EFI_FORM_ID FormId
- );
-
-/**
Discard all changes done to the BMM pages such as Boot Order change,
Driver order change.
@@ -1387,6 +1379,47 @@ UpdateFileExplorer (
);
/**
+ This function applies changes in a driver's configuration.
+ Input is a Configuration, which has the routing data for this
+ driver followed by name / value configuration pairs. The driver
+ must apply those pairs to its configurable storage. If the
+ driver's configuration is stored in a linear block of data
+ and the driver's name / value pairs are in <BlockConfig>
+ format, it may use the ConfigToBlock helper function (above) to
+ simplify the job. Currently not implemented.
+
+ @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+ @param[in] Configuration A null-terminated Unicode string in
+ <ConfigString> format.
+ @param[out] Progress A pointer to a string filled in with the
+ offset of the most recent '&' before the
+ first failing name / value pair (or the
+ beginn ing of the string if the failure
+ is in the first name / value pair) or
+ the terminating NULL if all was
+ successful.
+
+ @retval EFI_SUCCESS The results have been distributed or are
+ awaiting distribution.
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+ @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
+ Results parameter would result
+ in this type of error.
+ @retval EFI_NOT_FOUND Target for the specified routing data
+ was not found.
+**/
+EFI_STATUS
+EFIAPI
+FileExplorerRouteConfig (
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+ );
+
+/**
This function processes the results of changes in configuration.
When user select a interactive opcode, this callback will be triggered.
Based on the Question(QuestionId) that triggers the callback, the corresponding
@@ -1442,6 +1475,58 @@ InitBootMaintenance(
VOID
);
+/**
+
+ Initialize console input device check box to ConsoleInCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleInCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ );
+
+/**
+
+ Initialize console output device check box to ConsoleOutCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleOutCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ );
+
+/**
+
+ Initialize standard error output device check box to ConsoleErrCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleErrCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ );
+
+/**
+
+ Initialize terminal attributes (baudrate, data rate, stop bits, parity and terminal type)
+ to BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetTerminalAttribute (
+ IN BMM_CALLBACK_DATA *CallbackData
+ );
+
//
// Global variable in this program (defined in data.c)
//
@@ -1468,6 +1553,8 @@ extern STRING_DEPOSITORY *DriverOptionStrDepository;
extern STRING_DEPOSITORY *DriverOptionHelpStrDepository;
extern STRING_DEPOSITORY *TerminalStrDepository;
extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
+extern UINT16 mFlowControlType[2];
+extern UINT32 mFlowControlValue[2];
//
// Shared IFR form update data
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
index f164db2051..f4b0e66d8c 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
@@ -998,3 +998,150 @@ GetConsoleOutMode (
}
}
}
+
+/**
+
+ Initialize console input device check box to ConsoleInCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleInCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ )
+{
+ UINT16 Index;
+ BM_MENU_ENTRY *NewMenuEntry;
+ UINT8 *ConInCheck;
+ BM_CONSOLE_CONTEXT *NewConsoleContext;
+
+ ASSERT (CallbackData != NULL);
+
+ ConInCheck = &CallbackData->BmmFakeNvData.ConsoleInCheck[0];
+ for (Index = 0; ((Index < ConsoleInpMenu.MenuNumber) && \
+ (Index < MAX_MENU_NUMBER)) ; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&ConsoleInpMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
+ ConInCheck[Index] = NewConsoleContext->IsActive;
+ }
+}
+
+/**
+
+ Initialize console output device check box to ConsoleOutCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleOutCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ )
+{
+ UINT16 Index;
+ BM_MENU_ENTRY *NewMenuEntry;
+ UINT8 *ConOutCheck;
+ BM_CONSOLE_CONTEXT *NewConsoleContext;
+
+ ASSERT (CallbackData != NULL);
+ ConOutCheck = &CallbackData->BmmFakeNvData.ConsoleOutCheck[0];
+ for (Index = 0; ((Index < ConsoleOutMenu.MenuNumber) && \
+ (Index < MAX_MENU_NUMBER)) ; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&ConsoleOutMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
+ ConOutCheck[Index] = NewConsoleContext->IsActive;
+ }
+}
+
+/**
+
+ Initialize standard error output device check box to ConsoleErrCheck[MAX_MENU_NUMBER]
+ in BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetConsoleErrCheck (
+ IN BMM_CALLBACK_DATA *CallbackData
+ )
+{
+ UINT16 Index;
+ BM_MENU_ENTRY *NewMenuEntry;
+ UINT8 *ConErrCheck;
+ BM_CONSOLE_CONTEXT *NewConsoleContext;
+
+ ASSERT (CallbackData != NULL);
+ ConErrCheck = &CallbackData->BmmFakeNvData.ConsoleErrCheck[0];
+ for (Index = 0; ((Index < ConsoleErrMenu.MenuNumber) && \
+ (Index < MAX_MENU_NUMBER)) ; Index++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&ConsoleErrMenu, Index);
+ NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
+ ConErrCheck[Index] = NewConsoleContext->IsActive;
+ }
+}
+
+/**
+
+ Initialize terminal attributes (baudrate, data rate, stop bits, parity and terminal type)
+ to BMM_FAKE_NV_DATA structure.
+
+ @param CallbackData The BMM context data.
+
+**/
+VOID
+GetTerminalAttribute (
+ IN BMM_CALLBACK_DATA *CallbackData
+ )
+{
+ BMM_FAKE_NV_DATA *CurrentFakeNVMap;
+ BM_MENU_ENTRY *NewMenuEntry;
+ BM_TERMINAL_CONTEXT *NewTerminalContext;
+ UINT16 TerminalIndex;
+ UINT8 AttributeIndex;
+
+ ASSERT (CallbackData != NULL);
+
+ CurrentFakeNVMap = &CallbackData->BmmFakeNvData;
+ for (TerminalIndex = 0; ((TerminalIndex < TerminalMenu.MenuNumber) && \
+ (TerminalIndex < MAX_MENU_NUMBER)); TerminalIndex++) {
+ NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, TerminalIndex);
+ NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ for (AttributeIndex = 0; AttributeIndex < sizeof (BaudRateList) / sizeof (BaudRateList [0]); AttributeIndex++) {
+ if (NewTerminalContext->BaudRate == (UINT64) (BaudRateList[AttributeIndex].Value)) {
+ NewTerminalContext->BaudRateIndex = AttributeIndex;
+ break;
+ }
+ }
+ for (AttributeIndex = 0; AttributeIndex < sizeof (DataBitsList) / sizeof (DataBitsList[0]); AttributeIndex++) {
+ if (NewTerminalContext->DataBits == (UINT64) (DataBitsList[AttributeIndex].Value)) {
+ NewTerminalContext->DataBitsIndex = AttributeIndex;
+ break;
+ }
+ }
+
+ for (AttributeIndex = 0; AttributeIndex < sizeof (ParityList) / sizeof (ParityList[0]); AttributeIndex++) {
+ if (NewTerminalContext->Parity == (UINT64) (ParityList[AttributeIndex].Value)) {
+ NewTerminalContext->ParityIndex = AttributeIndex;
+ break;
+ }
+ }
+
+ for (AttributeIndex = 0; AttributeIndex < sizeof (StopBitsList) / sizeof (StopBitsList[0]); AttributeIndex++) {
+ if (NewTerminalContext->StopBits == (UINT64) (StopBitsList[AttributeIndex].Value)) {
+ NewTerminalContext->StopBitsIndex = AttributeIndex;
+ break;
+ }
+ }
+ CurrentFakeNVMap->COMBaudRate[TerminalIndex] = NewTerminalContext->BaudRateIndex;
+ CurrentFakeNVMap->COMDataRate[TerminalIndex] = NewTerminalContext->DataBitsIndex;
+ CurrentFakeNVMap->COMStopBits[TerminalIndex] = NewTerminalContext->StopBitsIndex;
+ CurrentFakeNVMap->COMParity[TerminalIndex] = NewTerminalContext->ParityIndex;
+ CurrentFakeNVMap->COMTerminalType[TerminalIndex] = NewTerminalContext->TerminalType;
+ CurrentFakeNVMap->COMFlowControl[TerminalIndex] = NewTerminalContext->FlowControl;
+ }
+}
+
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Data.c b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
index caf6c609ed..4f05ac5fcc 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Data.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
@@ -39,6 +39,19 @@ UINT16 TerminalType[] = {
};
///
+/// Flow Control type string token storage
+///
+UINT16 mFlowControlType[2] = {
+ STRING_TOKEN(STR_NONE_FLOW_CONTROL),
+ STRING_TOKEN(STR_HARDWARE_FLOW_CONTROL)
+};
+
+UINT32 mFlowControlValue[2] = {
+ 0,
+ UART_FLOW_CONTROL_HARDWARE
+};
+
+///
/// File system selection menu
///
BM_MENU_OPTION FsOptionMenu = {
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/FE.vfr b/MdeModulePkg/Application/UiApp/BootMaint/FE.vfr
index 0a9bb3e0f4..1401d21721 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/FE.vfr
+++ b/MdeModulePkg/Application/UiApp/BootMaint/FE.vfr
@@ -41,18 +41,22 @@ formset
subtitle text = STRING_TOKEN(STR_NULL_STRING);
- string varid = FeData.DescriptionData,
+ string varid = FeData.BootDescriptionData,
+ questionid = KEY_VALUE_BOOT_DESCRIPTION,
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
help = STRING_TOKEN(STR_NULL_STRING),
+ flags = INTERACTIVE,
minsize = 6,
maxsize = 75,
endstring;
- string varid = FeData.OptionalData,
- prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
- help = STRING_TOKEN(STR_NULL_STRING),
- minsize = 0,
- maxsize = 120,
+ string varid = FeData.BootOptionalData,
+ questionid = KEY_VALUE_BOOT_OPTION,
+ prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
+ help = STRING_TOKEN(STR_NULL_STRING),
+ flags = INTERACTIVE,
+ minsize = 0,
+ maxsize = 120,
endstring;
subtitle text = STRING_TOKEN(STR_NULL_STRING);
@@ -81,16 +85,20 @@ formset
subtitle text = STRING_TOKEN(STR_NULL_STRING);
- string varid = FeData.DescriptionData,
+ string varid = FeData.DriverDescriptionData,
+ questionid = KEY_VALUE_DRIVER_DESCRIPTION,
prompt = STRING_TOKEN(STR_LOAD_OPTION_DESC),
help = STRING_TOKEN(STR_NULL_STRING),
+ flags = INTERACTIVE,
minsize = 6,
maxsize = 75,
endstring;
- string varid = FeData.OptionalData,
+ string varid = FeData.DriverOptionalData,
+ questionid = KEY_VALUE_DRIVER_OPTION,
prompt = STRING_TOKEN(STR_OPTIONAL_DATA),
help = STRING_TOKEN(STR_NULL_STRING),
+ flags = INTERACTIVE,
minsize = 0,
maxsize = 120,
endstring;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c b/MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c
index e2e6b0335b..e4a68ef274 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/FileExplorer.c
@@ -168,8 +168,16 @@ UpdateFileExplorer (
case FileExplorerStateAddDriverOptionState:
if (FileExplorerStateAddBootOption == CallbackData->FeCurrentState) {
FormId = FORM_BOOT_ADD_DESCRIPTION_ID;
+ if (!CallbackData->FeFakeNvData.BootOptionChanged) {
+ ZeroMem (CallbackData->FeFakeNvData.BootDescriptionData, sizeof (CallbackData->FeFakeNvData.BootDescriptionData));
+ ZeroMem (CallbackData->FeFakeNvData.BootOptionalData, sizeof (CallbackData->FeFakeNvData.BootOptionalData));
+ }
} else {
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
+ if (!CallbackData->FeFakeNvData.DriverOptionChanged) {
+ ZeroMem (CallbackData->FeFakeNvData.DriverDescriptionData, sizeof (CallbackData->FeFakeNvData.DriverDescriptionData));
+ ZeroMem (CallbackData->FeFakeNvData.DriverOptionalData, sizeof (CallbackData->FeFakeNvData.DriverOptionalData));
+ }
}
CallbackData->MenuEntry = NewMenuEntry;
@@ -208,6 +216,129 @@ UpdateFileExplorer (
}
/**
+ This function applies changes in a driver's configuration.
+ Input is a Configuration, which has the routing data for this
+ driver followed by name / value configuration pairs. The driver
+ must apply those pairs to its configurable storage. If the
+ driver's configuration is stored in a linear block of data
+ and the driver's name / value pairs are in <BlockConfig>
+ format, it may use the ConfigToBlock helper function (above) to
+ simplify the job. Currently not implemented.
+
+ @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+ @param[in] Configuration A null-terminated Unicode string in
+ <ConfigString> format.
+ @param[out] Progress A pointer to a string filled in with the
+ offset of the most recent '&' before the
+ first failing name / value pair (or the
+ beginn ing of the string if the failure
+ is in the first name / value pair) or
+ the terminating NULL if all was
+ successful.
+
+ @retval EFI_SUCCESS The results have been distributed or are
+ awaiting distribution.
+ @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
+ parts of the results that must be
+ stored awaiting possible future
+ protocols.
+ @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
+ Results parameter would result
+ in this type of error.
+ @retval EFI_NOT_FOUND Target for the specified routing data
+ was not found.
+**/
+EFI_STATUS
+EFIAPI
+FileExplorerRouteConfig (
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+ )
+{
+ EFI_STATUS Status;
+ UINTN BufferSize;
+ EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
+ FILE_EXPLORER_NV_DATA *FeData;
+ BMM_CALLBACK_DATA *Private;
+
+ if (Progress == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ *Progress = Configuration;
+
+ if (Configuration == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Check routing data in <ConfigHdr>.
+ // Note: there is no name for Name/Value storage, only GUID will be checked
+ //
+ if (!HiiIsConfigHdrMatch (Configuration, &mFileExplorerGuid, mFileExplorerStorageName)) {
+ return EFI_NOT_FOUND;
+ }
+
+ Status = gBS->LocateProtocol (
+ &gEfiHiiConfigRoutingProtocolGuid,
+ NULL,
+ (VOID**) &ConfigRouting
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ Private = FE_CALLBACK_DATA_FROM_THIS (This);
+ //
+ // Get Buffer Storage data from EFI variable
+ //
+ BufferSize = sizeof (FILE_EXPLORER_NV_DATA );
+ FeData = &Private->FeFakeNvData;
+
+ //
+ // Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
+ //
+ Status = ConfigRouting->ConfigToBlock (
+ ConfigRouting,
+ Configuration,
+ (UINT8 *) FeData,
+ &BufferSize,
+ Progress
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ if (FeData->BootDescriptionData[0] != 0x00 || FeData->BootOptionalData[0] != 0x00) {
+ Status = Var_UpdateBootOption (Private, FeData);
+ Private->FeFakeNvData.BootOptionChanged = FALSE;
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ BOpt_GetBootOptions (Private);
+ CreateMenuStringToken (Private, Private->FeHiiHandle, &BootOptionMenu);
+ }
+
+ if (FeData->DriverDescriptionData[0] != 0x00 || FeData->DriverOptionalData[0] != 0x00) {
+ Status = Var_UpdateDriverOption (
+ Private,
+ Private->FeHiiHandle,
+ FeData->DriverDescriptionData,
+ FeData->DriverOptionalData,
+ FeData->ForceReconnect
+ );
+ Private->FeFakeNvData.DriverOptionChanged = FALSE;
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ BOpt_GetDriverOptions (Private);
+ CreateMenuStringToken (Private, Private->FeHiiHandle, &DriverOptionMenu);
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
This function processes the results of changes in configuration.
When user select a interactive opcode, this callback will be triggered.
Based on the Question(QuestionId) that triggers the callback, the corresponding
@@ -269,43 +400,30 @@ FileExplorerCallback (
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
-
- if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
- //
- // Apply changes and exit formset
- //
- if (FileExplorerStateAddBootOption == Private->FeCurrentState) {
- Status = Var_UpdateBootOption (Private, NvRamMap);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- BOpt_GetBootOptions (Private);
- CreateMenuStringToken (Private, Private->FeHiiHandle, &BootOptionMenu);
- } else if (FileExplorerStateAddDriverOptionState == Private->FeCurrentState) {
- Status = Var_UpdateDriverOption (
- Private,
- Private->FeHiiHandle,
- NvRamMap->DescriptionData,
- NvRamMap->OptionalData,
- NvRamMap->ForceReconnect
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- BOpt_GetDriverOptions (Private);
- CreateMenuStringToken (Private, Private->FeHiiHandle, &DriverOptionMenu);
- }
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER) {
+ if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT){
+ NvRamMap->BootOptionChanged = FALSE;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ } else if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER){
+ NvRamMap->DriverOptionChanged = FALSE;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_BOOT) {
//
// Discard changes and exit formset
//
- NvRamMap->OptionalData[0] = 0x0000;
- NvRamMap->DescriptionData[0] = 0x0000;
+ NvRamMap->BootOptionalData[0] = 0x0000;
+ NvRamMap->BootDescriptionData[0] = 0x0000;
+ NvRamMap->BootOptionChanged = FALSE;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ } else if ( QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER){
+ NvRamMap->BootOptionalData[0] = 0x0000;
+ NvRamMap->BootDescriptionData[0] = 0x0000;
+ NvRamMap->DriverOptionChanged = FALSE;
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ } else if (QuestionId == KEY_VALUE_BOOT_DESCRIPTION || QuestionId == KEY_VALUE_BOOT_OPTION){
+ NvRamMap->BootOptionChanged = TRUE;
+ } else if (QuestionId == KEY_VALUE_DRIVER_DESCRIPTION || QuestionId == KEY_VALUE_DRIVER_OPTION){
+ NvRamMap->DriverOptionChanged = TRUE;
} else if (QuestionId < FILE_OPTION_OFFSET) {
//
// Exit File Explorer formset
@@ -322,5 +440,10 @@ FileExplorerCallback (
}
}
+ //
+ // Pass changed uncommitted data back to Form Browser
+ //
+ HiiSetBrowserData (&mFileExplorerGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap, NULL);
+
return Status;
}
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h b/MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h
index ab3d9c9aa6..257c1fdde7 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h
+++ b/MdeModulePkg/Application/UiApp/BootMaint/FormGuid.h
@@ -70,6 +70,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define KEY_VALUE_NO_SAVE_AND_EXIT 0x110C
#define KEY_VALUE_BOOT_FROM_FILE 0x110D
#define FORM_RESET 0x110E
+#define KEY_VALUE_BOOT_DESCRIPTION 0x110F
+#define KEY_VALUE_BOOT_OPTION 0x1110
+#define KEY_VALUE_DRIVER_DESCRIPTION 0x1111
+#define KEY_VALUE_DRIVER_OPTION 0x1112
#define MAXIMUM_NORMAL_KEY_VALUE 0x11FF
@@ -142,6 +146,13 @@ typedef struct {
// At most 100 input/output/errorout device for console storage
//
UINT8 ConsoleCheck[MAX_MENU_NUMBER];
+
+ //
+ // At most 100 input/output/errorout device for console storage
+ //
+ UINT8 ConsoleInCheck[MAX_MENU_NUMBER];
+ UINT8 ConsoleOutCheck[MAX_MENU_NUMBER];
+ UINT8 ConsoleErrCheck[MAX_MENU_NUMBER];
//
// Boot or Driver Option Order storage
@@ -155,15 +166,18 @@ typedef struct {
//
BOOLEAN BootOptionDel[MAX_MENU_NUMBER];
BOOLEAN DriverOptionDel[MAX_MENU_NUMBER];
+ BOOLEAN BootOptionDelMark[MAX_MENU_NUMBER];
+ BOOLEAN DriverOptionDelMark[MAX_MENU_NUMBER];
//
// This is the Terminal Attributes value storage
//
- UINT8 COMBaudRate;
- UINT8 COMDataRate;
- UINT8 COMStopBits;
- UINT8 COMParity;
- UINT8 COMTerminalType;
+ UINT8 COMBaudRate[MAX_MENU_NUMBER];
+ UINT8 COMDataRate[MAX_MENU_NUMBER];
+ UINT8 COMStopBits[MAX_MENU_NUMBER];
+ UINT8 COMParity[MAX_MENU_NUMBER];
+ UINT8 COMTerminalType[MAX_MENU_NUMBER];
+ UINT8 COMFlowControl[MAX_MENU_NUMBER];
//
// We use DisableMap array to record the enable/disable state of each boot device
@@ -195,8 +209,12 @@ typedef struct {
/// This is the data structure used by File Explorer formset
///
typedef struct {
- UINT16 DescriptionData[MAX_MENU_NUMBER];
- UINT16 OptionalData[127];
+ UINT16 BootDescriptionData[MAX_MENU_NUMBER];
+ UINT16 BootOptionalData[127];
+ UINT16 DriverDescriptionData[MAX_MENU_NUMBER];
+ UINT16 DriverOptionalData[127];
+ BOOLEAN BootOptionChanged;
+ BOOLEAN DriverOptionChanged;
UINT8 Active;
UINT8 ForceReconnect;
} FILE_EXPLORER_NV_DATA;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
index 9f1d20d8ed..ae32278f1b 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
@@ -214,6 +214,8 @@ UpdateConCOMPage (
BM_MENU_ENTRY *NewMenuEntry;
UINT16 Index;
+ CallbackData->BmmAskSaveOrNot = TRUE;
+
UpdatePageStart (CallbackData);
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
@@ -249,7 +251,7 @@ UpdateBootDelPage (
BM_LOAD_CONTEXT *NewLoadContext;
UINT16 Index;
- //CallbackData->BmmAskSaveOrNot = TRUE;
+ CallbackData->BmmAskSaveOrNot = TRUE;
UpdatePageStart (CallbackData);
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);
@@ -262,6 +264,18 @@ UpdateBootDelPage (
continue;
}
+ NewLoadContext->Deleted = FALSE;
+
+ if (CallbackData->BmmFakeNvData.BootOptionDel[Index] && !CallbackData->BmmFakeNvData.BootOptionDelMark[Index]) {
+ //
+ // CallbackData->BmmFakeNvData.BootOptionDel[Index] == TRUE means browser knows this boot option is selected
+ // CallbackData->BmmFakeNvData.BootOptionDelMark[Index] = FALSE means BDS knows the selected boot option has
+ // deleted, browser maintains old useless info. So clear this info here, and later update this info to browser
+ // through HiiSetBrowserData function.
+ //
+ CallbackData->BmmFakeNvData.BootOptionDel[Index] = FALSE;
+ }
+
//
// Check to see if the current boot option devicepath is the ShellDevice
// path. If it is keep only UEFI Shell in the delete boot option list
@@ -278,7 +292,7 @@ UpdateBootDelPage (
(UINT16) (BOOT_OPTION_DEL_VAR_OFFSET + Index),
NewMenuEntry->DisplayStringToken,
NewMenuEntry->HelpStringToken,
- 0,
+ EFI_IFR_FLAG_CALLBACK,
0,
NULL
);
@@ -351,8 +365,16 @@ UpdateDrvDelPage (
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
NewLoadContext->Deleted = FALSE;
- CallbackData->BmmFakeNvData.DriverOptionDel[Index] = FALSE;
+ if (CallbackData->BmmFakeNvData.DriverOptionDel[Index] && !CallbackData->BmmFakeNvData.DriverOptionDelMark[Index]) {
+ //
+ // CallbackData->BmmFakeNvData.BootOptionDel[Index] == TRUE means browser knows this boot option is selected
+ // CallbackData->BmmFakeNvData.BootOptionDelMark[Index] = FALSE means BDS knows the selected boot option has
+ // deleted, browser maintains old useless info. So clear this info here, and later update this info to browser
+ // through HiiSetBrowserData function.
+ //
+ CallbackData->BmmFakeNvData.DriverOptionDel[Index] = FALSE;
+ }
HiiCreateCheckBoxOpCode (
mStartOpCodeHandle,
(EFI_QUESTION_ID) (DRIVER_OPTION_DEL_QUESTION_ID + Index),
@@ -360,7 +382,7 @@ UpdateDrvDelPage (
(UINT16) (DRIVER_OPTION_DEL_VAR_OFFSET + Index),
NewMenuEntry->DisplayStringToken,
NewMenuEntry->HelpStringToken,
- 0,
+ EFI_IFR_FLAG_CALLBACK,
0,
NULL
);
@@ -462,28 +484,63 @@ UpdateConsolePage (
UINT16 Index;
UINT16 Index2;
UINT8 CheckFlags;
-
+ UINT8 *ConsoleCheck;
+ UINT8 *OldConsoleCheck;
+ UINTN ConsoleCheckSize;
+ EFI_QUESTION_ID QuestionIdBase;
+ UINT16 VariableOffsetBase;
+
CallbackData->BmmAskSaveOrNot = TRUE;
UpdatePageStart (CallbackData);
+ ConsoleCheck = NULL;
+ QuestionIdBase = 0;
+ VariableOffsetBase = 0;
+
+ switch (UpdatePageId) {
+ case FORM_CON_IN_ID:
+ ConsoleCheck = &CallbackData->BmmFakeNvData.ConsoleInCheck[0];
+ OldConsoleCheck = &CallbackData->BmmOldFakeNVData.ConsoleInCheck[0];
+ ConsoleCheckSize = sizeof (CallbackData->BmmFakeNvData.ConsoleInCheck);
+ QuestionIdBase = CON_IN_DEVICE_QUESTION_ID;
+ VariableOffsetBase = CON_IN_DEVICE_VAR_OFFSET;
+ break;
+
+ case FORM_CON_OUT_ID:
+ ConsoleCheck = &CallbackData->BmmFakeNvData.ConsoleOutCheck[0];
+ OldConsoleCheck = &CallbackData->BmmOldFakeNVData.ConsoleOutCheck[0];
+ ConsoleCheckSize = sizeof (CallbackData->BmmFakeNvData.ConsoleOutCheck);
+ QuestionIdBase = CON_OUT_DEVICE_QUESTION_ID;
+ VariableOffsetBase = CON_OUT_DEVICE_VAR_OFFSET;
+ break;
+
+ case FORM_CON_ERR_ID:
+ ConsoleCheck = &CallbackData->BmmFakeNvData.ConsoleErrCheck[0];
+ OldConsoleCheck = &CallbackData->BmmOldFakeNVData.ConsoleErrCheck[0];
+ ConsoleCheckSize = sizeof (CallbackData->BmmFakeNvData.ConsoleErrCheck);
+ QuestionIdBase = CON_ERR_DEVICE_QUESTION_ID;
+ VariableOffsetBase = CON_ERR_DEVICE_VAR_OFFSET;
+ break;
+ }
+ ASSERT (ConsoleCheck != NULL);
+
for (Index = 0; ((Index < ConsoleMenu->MenuNumber) && \
- (Index < (sizeof (CallbackData->BmmFakeNvData.ConsoleCheck) / sizeof (UINT8)))) ; Index++) {
- NewMenuEntry = BOpt_GetMenuEntry (ConsoleMenu, Index);
+ (Index < MAX_MENU_NUMBER)) ; Index++) {
+ CheckFlags = 0;
+ NewMenuEntry = BOpt_GetMenuEntry (ConsoleMenu, Index);
NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext;
- CheckFlags = 0;
if (NewConsoleContext->IsActive) {
CheckFlags |= EFI_IFR_CHECKBOX_DEFAULT;
- CallbackData->BmmFakeNvData.ConsoleCheck[Index] = TRUE;
+ ConsoleCheck[Index] = TRUE;
} else {
- CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
+ ConsoleCheck[Index] = FALSE;
}
-
HiiCreateCheckBoxOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
+ (EFI_QUESTION_ID) (QuestionIdBase + Index),
VARSTORE_ID_BOOT_MAINT,
- (UINT16) (CON_DEVICE_VAR_OFFSET + Index),
+ (UINT16) (VariableOffsetBase + Index),
NewMenuEntry->DisplayStringToken,
NewMenuEntry->HelpStringToken,
0,
@@ -493,7 +550,7 @@ UpdateConsolePage (
}
for (Index2 = 0; ((Index2 < TerminalMenu.MenuNumber) && \
- (Index2 < (sizeof (CallbackData->BmmFakeNvData.ConsoleCheck) / sizeof (UINT8)))); Index2++) {
+ (Index2 < MAX_MENU_NUMBER)); Index2++) {
CheckFlags = 0;
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index2);
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
@@ -504,16 +561,15 @@ UpdateConsolePage (
((NewTerminalContext->IsStdErr != 0) && (UpdatePageId == FORM_CON_ERR_ID))
) {
CheckFlags |= EFI_IFR_CHECKBOX_DEFAULT;
- CallbackData->BmmFakeNvData.ConsoleCheck[Index] = TRUE;
+ ConsoleCheck[Index] = TRUE;
} else {
- CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
+ ConsoleCheck[Index] = FALSE;
}
-
HiiCreateCheckBoxOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
+ (EFI_QUESTION_ID) (QuestionIdBase + Index),
VARSTORE_ID_BOOT_MAINT,
- (UINT16) (CON_DEVICE_VAR_OFFSET + Index),
+ (UINT16) (VariableOffsetBase + Index),
NewMenuEntry->DisplayStringToken,
NewMenuEntry->HelpStringToken,
0,
@@ -524,6 +580,8 @@ UpdateConsolePage (
Index++;
}
+ CopyMem (OldConsoleCheck, ConsoleCheck, ConsoleCheckSize);
+
UpdatePageEnd (CallbackData);
}
@@ -883,7 +941,7 @@ UpdateConModePage (
UpdatePageEnd (CallbackData);
}
-/**
+ /**
Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,
Parity, Stop Bits, Terminal Type.
@@ -898,35 +956,31 @@ UpdateTerminalPage (
UINT8 Index;
UINT8 CheckFlags;
BM_MENU_ENTRY *NewMenuEntry;
- BM_TERMINAL_CONTEXT *NewTerminalContext;
VOID *OptionsOpCodeHandle;
+ UINTN CurrentTerminal;
CallbackData->BmmAskSaveOrNot = TRUE;
UpdatePageStart (CallbackData);
+ CurrentTerminal = CallbackData->CurrentTerminal;
NewMenuEntry = BOpt_GetMenuEntry (
&TerminalMenu,
- CallbackData->CurrentTerminal
+ CurrentTerminal
);
if (NewMenuEntry == NULL) {
return ;
}
- NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
-
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {
CheckFlags = 0;
- if (NewTerminalContext->BaudRate == (UINT64) (BaudRateList[Index].Value)) {
+ if (BaudRateList[Index].Value == 115200) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
- NewTerminalContext->BaudRateIndex = Index;
- CallbackData->BmmFakeNvData.COMBaudRate = NewTerminalContext->BaudRateIndex;
}
-
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
BaudRateList[Index].StringToken,
@@ -938,9 +992,9 @@ UpdateTerminalPage (
HiiCreateOneOfOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) COM_BAUD_RATE_QUESTION_ID,
+ (EFI_QUESTION_ID) (COM_BAUD_RATE_QUESTION_ID + CurrentTerminal),
VARSTORE_ID_BOOT_MAINT,
- COM_BAUD_RATE_VAR_OFFSET,
+ (UINT16) (COM_BAUD_RATE_VAR_OFFSET + CurrentTerminal),
STRING_TOKEN (STR_COM_BAUD_RATE),
STRING_TOKEN (STR_COM_BAUD_RATE),
0,
@@ -956,9 +1010,7 @@ UpdateTerminalPage (
for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
CheckFlags = 0;
- if (NewTerminalContext->DataBits == DataBitsList[Index].Value) {
- NewTerminalContext->DataBitsIndex = Index;
- CallbackData->BmmFakeNvData.COMDataRate = NewTerminalContext->DataBitsIndex;
+ if (DataBitsList[Index].Value == 8) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
}
@@ -973,9 +1025,9 @@ UpdateTerminalPage (
HiiCreateOneOfOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) COM_DATA_RATE_QUESTION_ID,
+ (EFI_QUESTION_ID) (COM_DATA_RATE_QUESTION_ID + CurrentTerminal),
VARSTORE_ID_BOOT_MAINT,
- COM_DATA_RATE_VAR_OFFSET,
+ (UINT16) (COM_DATA_RATE_VAR_OFFSET + CurrentTerminal),
STRING_TOKEN (STR_COM_DATA_BITS),
STRING_TOKEN (STR_COM_DATA_BITS),
0,
@@ -990,10 +1042,8 @@ UpdateTerminalPage (
for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
CheckFlags = 0;
- if (NewTerminalContext->Parity == ParityList[Index].Value) {
+ if (ParityList[Index].Value == NoParity) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
- NewTerminalContext->ParityIndex = (UINT8) Index;
- CallbackData->BmmFakeNvData.COMParity = NewTerminalContext->ParityIndex;
}
HiiCreateOneOfOptionOpCode (
@@ -1007,9 +1057,9 @@ UpdateTerminalPage (
HiiCreateOneOfOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) COM_PARITY_QUESTION_ID,
+ (EFI_QUESTION_ID) (COM_PARITY_QUESTION_ID + CurrentTerminal),
VARSTORE_ID_BOOT_MAINT,
- COM_PARITY_VAR_OFFSET,
+ (UINT16) (COM_PARITY_VAR_OFFSET + CurrentTerminal),
STRING_TOKEN (STR_COM_PARITY),
STRING_TOKEN (STR_COM_PARITY),
0,
@@ -1024,10 +1074,8 @@ UpdateTerminalPage (
for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
CheckFlags = 0;
- if (NewTerminalContext->StopBits == StopBitsList[Index].Value) {
+ if (StopBitsList[Index].Value == OneStopBit) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
- NewTerminalContext->StopBitsIndex = (UINT8) Index;
- CallbackData->BmmFakeNvData.COMStopBits = NewTerminalContext->StopBitsIndex;
}
HiiCreateOneOfOptionOpCode (
@@ -1041,9 +1089,9 @@ UpdateTerminalPage (
HiiCreateOneOfOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) COM_STOP_BITS_QUESTION_ID,
+ (EFI_QUESTION_ID) (COM_STOP_BITS_QUESTION_ID + CurrentTerminal),
VARSTORE_ID_BOOT_MAINT,
- COM_STOP_BITS_VAR_OFFSET,
+ (UINT16) (COM_STOP_BITS_VAR_OFFSET + CurrentTerminal),
STRING_TOKEN (STR_COM_STOP_BITS),
STRING_TOKEN (STR_COM_STOP_BITS),
0,
@@ -1058,9 +1106,8 @@ UpdateTerminalPage (
for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {
CheckFlags = 0;
- if (NewTerminalContext->TerminalType == Index) {
+ if (Index == 0) {
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
- CallbackData->BmmFakeNvData.COMTerminalType = NewTerminalContext->TerminalType;
}
HiiCreateOneOfOptionOpCode (
@@ -1074,9 +1121,9 @@ UpdateTerminalPage (
HiiCreateOneOfOpCode (
mStartOpCodeHandle,
- (EFI_QUESTION_ID) COM_TERMINAL_QUESTION_ID,
+ (EFI_QUESTION_ID) (COM_TERMINAL_QUESTION_ID + CurrentTerminal),
VARSTORE_ID_BOOT_MAINT,
- COM_TERMINAL_VAR_OFFSET,
+ (UINT16) (COM_TERMINAL_VAR_OFFSET + CurrentTerminal),
STRING_TOKEN (STR_COM_TERMI_TYPE),
STRING_TOKEN (STR_COM_TERMI_TYPE),
0,
@@ -1086,6 +1133,37 @@ UpdateTerminalPage (
);
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
+
+ for (Index = 0; Index < sizeof (mFlowControlType) / sizeof (mFlowControlType[0]); Index++) {
+ CheckFlags = 0;
+ if (Index == 0) {
+ CheckFlags |= EFI_IFR_OPTION_DEFAULT;
+ }
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ (EFI_STRING_ID) mFlowControlType[Index],
+ CheckFlags,
+ EFI_IFR_TYPE_NUM_SIZE_8,
+ mFlowControlValue[Index]
+ );
+ }
+
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
+ (EFI_QUESTION_ID) (COM_FLOWCONTROL_QUESTION_ID + CurrentTerminal),
+ VARSTORE_ID_BOOT_MAINT,
+ (UINT16) (COM_FLOWCONTROL_VAR_OFFSET + CurrentTerminal),
+ STRING_TOKEN (STR_COM_FLOW_CONTROL),
+ STRING_TOKEN (STR_COM_FLOW_CONTROL),
+ 0,
+ EFI_IFR_NUMERIC_SIZE_1,
+ OptionsOpCodeHandle,
+ NULL
+ );
+
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
UpdatePageEnd (CallbackData);
}
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
index 2b594fcbd4..c80fada8a2 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Variable.c
@@ -728,16 +728,16 @@ Var_UpdateBootOption (
Index = BOpt_GetBootOptionNumber () ;
UnicodeSPrint (BootString, sizeof (BootString), L"Boot%04x", Index);
- if (NvRamMap->DescriptionData[0] == 0x0000) {
- StrCpyS (NvRamMap->DescriptionData, sizeof (NvRamMap->DescriptionData) / sizeof (NvRamMap->DescriptionData[0]), BootString);
+ if (NvRamMap->BootDescriptionData[0] == 0x0000) {
+ StrCpyS (NvRamMap->BootDescriptionData, sizeof (NvRamMap->BootDescriptionData) / sizeof (NvRamMap->BootDescriptionData[0]), BootString);
}
- BufferSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (NvRamMap->DescriptionData);
+ BufferSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (NvRamMap->BootDescriptionData);
BufferSize += GetDevicePathSize (CallbackData->LoadContext->FilePathList);
- if (NvRamMap->OptionalData[0] != 0x0000) {
+ if (NvRamMap->BootOptionalData[0] != 0x0000) {
OptionalDataExist = TRUE;
- BufferSize += StrSize (NvRamMap->OptionalData);
+ BufferSize += StrSize (NvRamMap->BootOptionalData);
}
Buffer = AllocateZeroPool (BufferSize);
@@ -767,21 +767,21 @@ Var_UpdateBootOption (
CopyMem (
Ptr,
- NvRamMap->DescriptionData,
- StrSize (NvRamMap->DescriptionData)
+ NvRamMap->BootDescriptionData,
+ StrSize (NvRamMap->BootDescriptionData)
);
- NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->DescriptionData));
+ NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->BootDescriptionData));
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
CopyMem (
NewLoadContext->Description,
(VOID *) Ptr,
- StrSize (NvRamMap->DescriptionData)
+ StrSize (NvRamMap->BootDescriptionData)
);
- Ptr += StrSize (NvRamMap->DescriptionData);
+ Ptr += StrSize (NvRamMap->BootDescriptionData);
CopyMem (
Ptr,
CallbackData->LoadContext->FilePathList,
@@ -814,7 +814,7 @@ Var_UpdateBootOption (
if (OptionalDataExist) {
Ptr += (UINT8) GetDevicePathSize (CallbackData->LoadContext->FilePathList);
- CopyMem (Ptr, NvRamMap->OptionalData, StrSize (NvRamMap->OptionalData));
+ CopyMem (Ptr, NvRamMap->BootOptionalData, StrSize (NvRamMap->BootOptionalData));
}
Status = gRT->SetVariable (
@@ -852,8 +852,8 @@ Var_UpdateBootOption (
InsertTailList (&BootOptionMenu.Head, &NewMenuEntry->Link);
BootOptionMenu.MenuNumber++;
- NvRamMap->DescriptionData[0] = 0x0000;
- NvRamMap->OptionalData[0] = 0x0000;
+ NvRamMap->BootDescriptionData[0] = 0x0000;
+ NvRamMap->BootOptionalData[0] = 0x0000;
return EFI_SUCCESS;
}