diff options
author | Eric Dong <eric.dong@intel.com> | 2015-05-27 02:32:59 +0000 |
---|---|---|
committer | ydong10 <ydong10@Edk2> | 2015-05-27 02:32:59 +0000 |
commit | f2e7732e446f9120e83673abb2c701aa7cba17f7 (patch) | |
tree | dc25423930c10d2a5c7988c23f19aac8384682ed /MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | |
parent | 1c2a496292122bcaa519b1307512dc93f139b1e4 (diff) | |
download | edk2-f2e7732e446f9120e83673abb2c701aa7cba17f7.zip edk2-f2e7732e446f9120e83673abb2c701aa7cba17f7.tar.gz edk2-f2e7732e446f9120e83673abb2c701aa7cba17f7.tar.bz2 |
MdeModulePkg: Enable reconnect request from action request or question flag.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17516 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index b8c5a39..002a86a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -1885,6 +1885,30 @@ FindNextMenu ( }
/**
+ Reconnect the controller.
+
+ @param DriverHandle The controller handle which need to be reconnect.
+
+ @retval TRUE do the reconnect behavior success.
+ @retval FALSE do the reconnect behavior failed.
+
+**/
+BOOLEAN
+ReconnectController (
+ IN EFI_HANDLE DriverHandle
+ )
+{
+ EFI_STATUS Status;
+
+ Status = gBS->DisconnectController(DriverHandle, NULL, NULL);
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->ConnectController(DriverHandle, NULL, NULL, TRUE);
+ }
+
+ return Status == EFI_SUCCESS;
+}
+
+/**
Call the call back function for the question and process the return action.
@param Selection On input, Selection tell setup browser the information
@@ -2055,6 +2079,10 @@ ProcessCallBackFunction ( SettingLevel = FormLevel;
break;
+ case EFI_BROWSER_ACTION_REQUEST_RECONNECT:
+ gCallbackReconnect = TRUE;
+ break;
+
default:
break;
}
@@ -2155,6 +2183,28 @@ ProcessCallBackFunction ( }
}
+ if (gCallbackReconnect && (EFI_BROWSER_ACTION_CHANGED == Action)) {
+ //
+ // Confirm changes with user first.
+ //
+ if (IsNvUpdateRequiredForFormSet(FormSet)) {
+ if (BROWSER_ACTION_DISCARD == PopupErrorMessage(BROWSER_RECONNECT_SAVE_CHANGES, NULL, NULL, NULL)) {
+ gCallbackReconnect = FALSE;
+ DiscardFormIsRequired = TRUE;
+ } else {
+ SubmitFormIsRequired = TRUE;
+ }
+ } else {
+ PopupErrorMessage(BROWSER_RECONNECT_REQUIRED, NULL, NULL, NULL);
+ }
+
+ //
+ // Exit current formset before do the reconnect.
+ //
+ NeedExit = TRUE;
+ SettingLevel = FormSetLevel;
+ }
+
if (SubmitFormIsRequired && !SkipSaveOrDiscard) {
SubmitForm (FormSet, Form, SettingLevel);
}
@@ -2476,13 +2526,18 @@ SetupBrowser ( }
//
- // If question has EFI_IFR_FLAG_RESET_REQUIRED flag and without storage and process question success till here,
- // trig the gResetFlag.
+ // If question has EFI_IFR_FLAG_RESET_REQUIRED/EFI_IFR_FLAG_RECONNECT_REQUIRED flag and without storage
+ // and process question success till here, trig the gResetFlag/gFlagReconnect.
//
if ((Status == EFI_SUCCESS) &&
- (Statement->Storage == NULL) &&
- ((Statement->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0)) {
- gResetRequired = TRUE;
+ (Statement->Storage == NULL)) {
+ if ((Statement->QuestionFlags & EFI_IFR_FLAG_RESET_REQUIRED) != 0) {
+ gResetRequired = TRUE;
+ }
+
+ if ((Statement->QuestionFlags & EFI_IFR_FLAG_RECONNECT_REQUIRED) != 0) {
+ gFlagReconnect = TRUE;
+ }
}
}
|