]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / VlanConfigDxe / VlanConfigImpl.c
index ea70d5e28d0e0ba8fd65acf00c7bf942f5a4e4e2..f992cea07b80bc6a742f86d40dbf4543d9e019c3 100644 (file)
@@ -239,16 +239,23 @@ VlanCallback (
     return EFI_SUCCESS;\r
   }\r
 \r
-  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+  if ((Action != EFI_BROWSER_ACTION_CHANGED) && (Action != EFI_BROWSER_ACTION_CHANGING)) {\r
     //\r
-    // Get Browser data\r
+    // All other action return unsupported.\r
     //\r
-    Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));\r
-    ASSERT (Configuration != NULL);\r
-    HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Get Browser data\r
+  //\r
+  Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));\r
+  ASSERT (Configuration != NULL);\r
+  HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);\r
 \r
-    VlanConfig = PrivateData->VlanConfig;\r
+  VlanConfig = PrivateData->VlanConfig;\r
 \r
+  if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
     switch (QuestionId) {\r
     case VLAN_ADD_QUESTION_ID:\r
       //\r
@@ -304,6 +311,11 @@ VlanCallback (
       ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);\r
       break;\r
 \r
+    default:\r
+      break;\r
+    }\r
+  } else if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+    switch (QuestionId) {\r
     case VLAN_UPDATE_QUESTION_ID:\r
       //\r
       // Update current VLAN list into Form.\r
@@ -314,16 +326,11 @@ VlanCallback (
     default:\r
       break;\r
     }\r
-\r
-    HiiSetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);\r
-    FreePool (Configuration);\r
-    return EFI_SUCCESS;\r
   }\r
-\r
-  //\r
-  // All other action return unsupported.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
+  \r
+  HiiSetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);\r
+  FreePool (Configuration);\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 \r