Update for IntelFrameworkModulePkg.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / DeviceMngr / DeviceManager.c
index d0bf764..6cb9d6b 100644 (file)
@@ -133,35 +133,30 @@ DeviceManagerCallback (
 {\r
   UINTN CurIndex;\r
 \r
-  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
-    if ((Value == NULL) || (ActionRequest == NULL)) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    gCallbackKey = QuestionId;\r
-    if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {\r
-      //\r
-      // If user select the mac address, need to record mac address string to support next form show.\r
-      //\r
-      for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {\r
-        if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {\r
-           mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);\r
-        }\r
-      }\r
-    }\r
-  \r
+  if (Action != EFI_BROWSER_ACTION_CHANGING) {\r
     //\r
-    // Request to exit SendForm(), so as to switch to selected form\r
+    // All other action return unsupported.\r
     //\r
-    *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
+    return EFI_UNSUPPORTED;\r
+  }\r
 \r
-    return EFI_SUCCESS;\r
+  if (Value == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  //\r
-  // All other action return unsupported.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
+  gCallbackKey = QuestionId;\r
+  if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {\r
+    //\r
+    // If user select the mac address, need to record mac address string to support next form show.\r
+    //\r
+    for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {\r
+      if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {\r
+         mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);\r
+      }\r
+    }\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -873,7 +868,7 @@ CallDeviceManager (
           AddNetworkMenu = TRUE;\r
           HiiCreateGotoOpCode (\r
             StartOpCodeHandle,\r
-            DEVICE_MANAGER_FORM_ID,\r
+            INVALID_FORM_ID,\r
             STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_TITLE),\r
             STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_HELP),\r
             EFI_IFR_FLAG_CALLBACK,\r
@@ -887,7 +882,7 @@ CallDeviceManager (
         while (AddItemCount > 0) {\r
             HiiCreateGotoOpCode (\r
               StartOpCodeHandle,\r
-              NETWORK_DEVICE_LIST_FORM_ID,\r
+              INVALID_FORM_ID,\r
               mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].PromptId,\r
               STRING_TOKEN (STR_NETWORK_DEVICE_HELP),\r
               EFI_IFR_FLAG_CALLBACK,\r
@@ -901,7 +896,7 @@ CallDeviceManager (
         //\r
         HiiCreateGotoOpCode (\r
           StartOpCodeHandle,\r
-          NETWORK_DEVICE_FORM_ID,\r
+          INVALID_FORM_ID,\r
           Token,\r
           TokenHelp,\r
           EFI_IFR_FLAG_CALLBACK,\r
@@ -916,7 +911,7 @@ CallDeviceManager (
       if (mNextShowFormId == DEVICE_MANAGER_FORM_ID) {\r
         HiiCreateGotoOpCode (\r
           StartOpCodeHandle,\r
-          DEVICE_MANAGER_FORM_ID,\r
+          INVALID_FORM_ID,\r
           Token,\r
           TokenHelp,\r
           EFI_IFR_FLAG_CALLBACK,\r
@@ -1097,7 +1092,7 @@ DriverHealthCallback (
   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
   )\r
 {\r
-  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+  if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
     if ((Value == NULL) || (ActionRequest == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r