Update for NetworkPkg.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 02:57:46 +0000 (02:57 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Dec 2011 02:57:46 +0000 (02:57 +0000)
Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of ActionRequest will be ignored, but on CallBack action EFI_BROWSER_ACTION_CHANGED, the return value of ActionRequest will be used.
But, EDKII browser still processes the got ActionRequest. And, all HII drivers in EDKII project also returns their expected ActionRequest value on action EFI_BROWSER_ACTION_CHANGING.
Now update the browser to follow the spec, and update all core Hii drivers to keep old working modal.

Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12867 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/IScsiDxe/IScsiConfig.c
NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr
NetworkPkg/Ip6Dxe/Ip6Config.vfr
NetworkPkg/Ip6Dxe/Ip6ConfigNv.c

index d347d8d..eea73a8 100644 (file)
@@ -1605,14 +1605,6 @@ IScsiConfigProcessDefault (
   UINTN                       TotalNumber;\r
   UINTN                       Index;\r
 \r
   UINTN                       TotalNumber;\r
   UINTN                       Index;\r
 \r
-  //\r
-  // Free any attempt that is previously created but not saved to system.\r
-  //\r
-  if (mPrivate->NewAttempt != NULL) {\r
-    FreePool (mPrivate->NewAttempt);\r
-    mPrivate->NewAttempt = NULL;\r
-  }\r
-\r
   //\r
   // Is User creating a new attempt?\r
   //\r
   //\r
   // Is User creating a new attempt?\r
   //\r
@@ -1637,6 +1629,14 @@ IScsiConfigProcessDefault (
     //\r
     return EFI_SUCCESS;\r
   }\r
     //\r
     return EFI_SUCCESS;\r
   }\r
+  \r
+  //\r
+  // Free any attempt that is previously created but not saved to system.\r
+  //\r
+  if (mPrivate->NewAttempt != NULL) {\r
+    FreePool (mPrivate->NewAttempt);\r
+    mPrivate->NewAttempt = NULL;\r
+  }\r
 \r
   if (NewAttempt) {\r
     //\r
 \r
   if (NewAttempt) {\r
     //\r
@@ -2103,37 +2103,75 @@ IScsiFormCallback (
     return EFI_SUCCESS;\r
   }\r
 \r
     return EFI_SUCCESS;\r
   }\r
 \r
-  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
-    if (This == NULL || Value == NULL || ActionRequest == NULL) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);\r
-\r
+  if ((Action != EFI_BROWSER_ACTION_CHANGING) && (Action != EFI_BROWSER_ACTION_CHANGED)) {\r
     //\r
     //\r
-    // Retrieve uncommitted data from Browser\r
+    // All other type return unsupported.\r
     //\r
     //\r
+    return EFI_UNSUPPORTED;\r
+  }\r
 \r
 \r
-    BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);\r
-    IfrNvData = AllocateZeroPool (BufferSize);\r
-    if (IfrNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);\r
-    if (IScsiName == NULL) {\r
-      FreePool (IfrNvData);\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    Status = EFI_SUCCESS;\r
+  if ((Value == NULL) || (ActionRequest == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
 \r
 \r
-    ZeroMem (&OldIfrNvData, BufferSize);\r
+  Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);\r
+  \r
+  //\r
+  // Retrieve uncommitted data from Browser\r
+  //\r
+  \r
+  BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);\r
+  IfrNvData = AllocateZeroPool (BufferSize);\r
+  if (IfrNvData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+  \r
+  IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);\r
+  if (IScsiName == NULL) {\r
+    FreePool (IfrNvData);\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+  \r
+  Status = EFI_SUCCESS;\r
+  \r
+  ZeroMem (&OldIfrNvData, BufferSize);\r
+  \r
+  HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);\r
+  \r
+  CopyMem (&OldIfrNvData, IfrNvData, BufferSize);\r
 \r
 \r
-    HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);\r
+  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+    switch (QuestionId) {\r
+    case KEY_ADD_ATTEMPT:\r
+      Status = IScsiConfigAddAttempt ();\r
+      break;\r
 \r
 \r
-    CopyMem (&OldIfrNvData, IfrNvData, BufferSize);\r
+    case KEY_DELETE_ATTEMPT:\r
+      CopyMem (\r
+        OldIfrNvData.DeleteAttemptList,\r
+        IfrNvData->DeleteAttemptList,\r
+        sizeof (IfrNvData->DeleteAttemptList)\r
+        );\r
+      Status = IScsiConfigDisplayDeleteAttempts (IfrNvData);\r
+      break;\r
 \r
 \r
+    case KEY_ORDER_ATTEMPT_CONFIG:\r
+      //\r
+      // Order the attempt according to user input.\r
+      //\r
+      CopyMem (\r
+        OldIfrNvData.DynamicOrderedList,\r
+        IfrNvData->DynamicOrderedList,\r
+        sizeof (IfrNvData->DynamicOrderedList)\r
+        );\r
+      IScsiConfigDisplayOrderAttempts ();\r
+      break;\r
+    \r
+    default:\r
+      Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);\r
+      break;\r
+    }\r
+  } else if (Action == EFI_BROWSER_ACTION_CHANGED) {  \r
     switch (QuestionId) {\r
     case KEY_INITIATOR_NAME:\r
       UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);\r
     switch (QuestionId) {\r
     case KEY_INITIATOR_NAME:\r
       UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);\r
@@ -2151,54 +2189,34 @@ IScsiFormCallback (
 \r
       *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
 \r
       *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
+    case KEY_ATTEMPT_NAME:\r
+      if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {\r
+        CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));\r
+        CopyMem (&AttemptName[ATTEMPT_NAME_SIZE], L"...", 4 * sizeof (CHAR16));\r
+      } else {\r
+        CopyMem (\r
+          AttemptName,\r
+          IfrNvData->AttemptName,\r
+          (StrLen (IfrNvData->AttemptName) + 1) * sizeof (CHAR16)\r
+          );\r
+      }\r
 \r
 \r
-    case KEY_ADD_ATTEMPT:\r
-      Status = IScsiConfigAddAttempt ();\r
-      break;\r
+      UnicodeStrToAsciiStr (IfrNvData->AttemptName, Private->Current->AttemptName);\r
 \r
 \r
-    case KEY_DELETE_ATTEMPT:\r
-      CopyMem (\r
-        OldIfrNvData.DeleteAttemptList,\r
-        IfrNvData->DeleteAttemptList,\r
-        sizeof (IfrNvData->DeleteAttemptList)\r
-        );\r
-      Status = IScsiConfigDisplayDeleteAttempts (IfrNvData);\r
-      break;\r
+      IScsiConfigUpdateAttempt ();\r
 \r
 \r
-    case KEY_SAVE_DELETE_ATTEMPT:\r
-      //\r
-      // Delete the Attempt Order from NVR\r
-      //\r
-      Status = IScsiConfigDeleteAttempts (IfrNvData);\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+      break;\r
+      \r
+    case KEY_SAVE_ATTEMPT_CONFIG:\r
+      Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);\r
       if (EFI_ERROR (Status)) {\r
         break;\r
       }\r
 \r
       if (EFI_ERROR (Status)) {\r
         break;\r
       }\r
 \r
-      IScsiConfigUpdateAttempt ();\r
       *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
 \r
       *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
       break;\r
 \r
-    case KEY_IGNORE_DELETE_ATTEMPT:\r
-      CopyMem (\r
-        IfrNvData->DeleteAttemptList,\r
-        OldIfrNvData.DeleteAttemptList,\r
-        sizeof (IfrNvData->DeleteAttemptList)\r
-        );\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;\r
-      break;\r
-\r
-    case KEY_ORDER_ATTEMPT_CONFIG:\r
-      //\r
-      // Order the attempt according to user input.\r
-      //\r
-      CopyMem (\r
-        OldIfrNvData.DynamicOrderedList,\r
-        IfrNvData->DynamicOrderedList,\r
-        sizeof (IfrNvData->DynamicOrderedList)\r
-        );\r
-      IScsiConfigDisplayOrderAttempts ();\r
-      break;\r
-\r
     case KEY_SAVE_ORDER_CHANGES:\r
       //\r
       // Sync the Attempt Order to NVR.\r
     case KEY_SAVE_ORDER_CHANGES:\r
       //\r
       // Sync the Attempt Order to NVR.\r
@@ -2209,7 +2227,7 @@ IScsiFormCallback (
       }\r
 \r
       IScsiConfigUpdateAttempt ();\r
       }\r
 \r
       IScsiConfigUpdateAttempt ();\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
       break;\r
 \r
     case KEY_IGNORE_ORDER_CHANGES:\r
       break;\r
 \r
     case KEY_IGNORE_ORDER_CHANGES:\r
@@ -2218,26 +2236,29 @@ IScsiFormCallback (
         OldIfrNvData.DynamicOrderedList,\r
         sizeof (IfrNvData->DynamicOrderedList)\r
         );\r
         OldIfrNvData.DynamicOrderedList,\r
         sizeof (IfrNvData->DynamicOrderedList)\r
         );\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;\r
       break;\r
 \r
       break;\r
 \r
-    case KEY_ATTEMPT_NAME:\r
-      if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {\r
-        CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));\r
-        CopyMem (&AttemptName[ATTEMPT_NAME_SIZE], L"...", 4 * sizeof (CHAR16));\r
-      } else {\r
-        CopyMem (\r
-          AttemptName,\r
-          IfrNvData->AttemptName,\r
-          (StrLen (IfrNvData->AttemptName) + 1) * sizeof (CHAR16)\r
-          );\r
+    case KEY_SAVE_DELETE_ATTEMPT:\r
+      //\r
+      // Delete the Attempt Order from NVR\r
+      //\r
+      Status = IScsiConfigDeleteAttempts (IfrNvData);\r
+      if (EFI_ERROR (Status)) {\r
+        break;\r
       }\r
 \r
       }\r
 \r
-      UnicodeStrToAsciiStr (IfrNvData->AttemptName, Private->Current->AttemptName);\r
-\r
       IScsiConfigUpdateAttempt ();\r
       IScsiConfigUpdateAttempt ();\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
+      break;\r
 \r
 \r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
+    case KEY_IGNORE_DELETE_ATTEMPT:\r
+      CopyMem (\r
+        IfrNvData->DeleteAttemptList,\r
+        OldIfrNvData.DeleteAttemptList,\r
+        sizeof (IfrNvData->DeleteAttemptList)\r
+        );\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;\r
       break;\r
 \r
     case KEY_IP_MODE:\r
       break;\r
 \r
     case KEY_IP_MODE:\r
@@ -2409,38 +2430,23 @@ IScsiFormCallback (
 \r
       break;\r
 \r
 \r
       break;\r
 \r
-    case KEY_SAVE_ATTEMPT_CONFIG:\r
-      Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);\r
-      if (EFI_ERROR (Status)) {\r
-        break;\r
-      }\r
-\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
-      break;\r
-\r
     default:\r
     default:\r
-      Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);\r
       break;\r
     }\r
       break;\r
     }\r
+  }\r
 \r
 \r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // Pass changed uncommitted data back to Form Browser.\r
-      //\r
-      BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);\r
-      HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);\r
-    }\r
-\r
-    FreePool (IfrNvData);\r
-    FreePool (IScsiName);\r
-\r
-    return Status;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // Pass changed uncommitted data back to Form Browser.\r
+    //\r
+    BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);\r
+    HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);\r
   }\r
 \r
   }\r
 \r
-  //\r
-  // All other action return unsupported.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
+  FreePool (IfrNvData);\r
+  FreePool (IScsiName);\r
+\r
+  return Status;\r
 }\r
 \r
 \r
 }\r
 \r
 \r
index 0cf4ffe..4a322cf 100644 (file)
@@ -85,18 +85,19 @@ formset
     label ORDER_ENTRY_LABEL;\r
     label LABEL_END;\r
 \r
     label ORDER_ENTRY_LABEL;\r
     label LABEL_END;\r
 \r
-    goto FORMID_MAIN_FORM,\r
-      prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+    text\r
       help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
       help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
       flags  = INTERACTIVE,\r
       key    = KEY_SAVE_ORDER_CHANGES;\r
       flags  = INTERACTIVE,\r
       key    = KEY_SAVE_ORDER_CHANGES;\r
-      \r
-    goto FORMID_MAIN_FORM,\r
-      prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+\r
+    text\r
       help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
       help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
       flags  = INTERACTIVE,\r
       key    = KEY_IGNORE_ORDER_CHANGES;\r
       flags  = INTERACTIVE,\r
       key    = KEY_IGNORE_ORDER_CHANGES;\r
-\r
   endform;\r
 \r
   form formid = FORMID_DELETE_FORM,\r
   endform;\r
 \r
   form formid = FORMID_DELETE_FORM,\r
@@ -105,18 +106,19 @@ formset
     label DELETE_ENTRY_LABEL;\r
     label LABEL_END;\r
 \r
     label DELETE_ENTRY_LABEL;\r
     label LABEL_END;\r
 \r
-    goto FORMID_MAIN_FORM,\r
-      prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+    text\r
       help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
       help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
       flags  = INTERACTIVE,\r
       key    = KEY_SAVE_DELETE_ATTEMPT;\r
       flags  = INTERACTIVE,\r
       key    = KEY_SAVE_DELETE_ATTEMPT;\r
-      \r
-    goto FORMID_MAIN_FORM,\r
-      prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+\r
+    text\r
       help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
       help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
       flags  = INTERACTIVE,\r
       key    = KEY_IGNORE_DELETE_ATTEMPT;\r
       flags  = INTERACTIVE,\r
       key    = KEY_IGNORE_DELETE_ATTEMPT;\r
-      \r
   endform;    \r
 \r
   form formid = FORMID_ATTEMPT_FORM,\r
   endform;    \r
 \r
   form formid = FORMID_ATTEMPT_FORM,\r
@@ -348,12 +350,13 @@ formset
 \r
     subtitle text = STRING_TOKEN(STR_NULL);\r
 \r
 \r
     subtitle text = STRING_TOKEN(STR_NULL);\r
 \r
-    goto FORMID_ATTEMPT_FORM,\r
-    prompt = STRING_TOKEN (STR_SAVE_CHANGES),\r
-    help   = STRING_TOKEN (STR_SAVE_CHANGES_HELP),\r
-    flags  = INTERACTIVE,\r
-    key    = KEY_SAVE_ATTEMPT_CONFIG;\r
-\r
+    text\r
+      help   = STRING_TOKEN (STR_SAVE_CHANGES_HELP),\r
+      text   = STRING_TOKEN (STR_SAVE_CHANGES),\r
+        text   = STRING_TOKEN (STR_SAVE_CHANGES),\r
+      flags  = INTERACTIVE,\r
+      key    = KEY_SAVE_ATTEMPT_CONFIG;\r
+      \r
     goto FORMID_MAIN_FORM,\r
     prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),\r
     help   = STRING_TOKEN (STR_RETURN_MAIN_FORM),\r
     goto FORMID_MAIN_FORM,\r
     prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),\r
     help   = STRING_TOKEN (STR_RETURN_MAIN_FORM),\r
index 7639f5a..de63f4d 100644 (file)
@@ -163,17 +163,19 @@ formset
             maxsize = ADDRESS_STR_MAX_SIZE,\r
     endstring;\r
 \r
             maxsize = ADDRESS_STR_MAX_SIZE,\r
     endstring;\r
 \r
-    goto FORMID_MAIN_FORM,\r
-    prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
-    help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
-    flags  = INTERACTIVE,\r
-    key    = KEY_SAVE_CONFIG_CHANGES;\r
+    text\r
+      help   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_SAVE_AND_EXIT),\r
+      flags  = INTERACTIVE,\r
+      key    = KEY_SAVE_CONFIG_CHANGES;\r
 \r
 \r
-    goto FORMID_MAIN_FORM,\r
-    prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
-    help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
-    flags  = INTERACTIVE,\r
-    key    = KEY_IGNORE_CONFIG_CHANGES;\r
+    text\r
+      help   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+      text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+        text   = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),\r
+      flags  = INTERACTIVE,\r
+      key    = KEY_IGNORE_CONFIG_CHANGES;\r
 \r
   endform;\r
 \r
 \r
   endform;\r
 \r
index b383488..db2155e 100644 (file)
@@ -1651,7 +1651,7 @@ Ip6FormCallback (
     return EFI_SUCCESS;\r
   }\r
 \r
     return EFI_SUCCESS;\r
   }\r
 \r
-  if (Action != EFI_BROWSER_ACTION_CHANGING) {\r
+  if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -1677,224 +1677,230 @@ Ip6FormCallback (
 \r
   CopyMem (&OldIfrNvData, IfrNvData, BufferSize);\r
 \r
 \r
   CopyMem (&OldIfrNvData, IfrNvData, BufferSize);\r
 \r
-  switch (QuestionId) {\r
-  case KEY_INTERFACE_ID:\r
-    Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);\r
-    if (EFI_ERROR (Status)) {\r
-      CreatePopUp (\r
-        EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
-        &Key,\r
-        L"Invalid Interface ID!",\r
-        NULL\r
-        );\r
-    }\r
-\r
-    break;\r
-\r
-  case KEY_MANUAL_ADDRESS:\r
-    Status = Ip6ParseAddressListFromString (\r
-               IfrNvData->ManualAddress,\r
-               &Ip6NvData->ManualAddress,\r
-               &Ip6NvData->ManualAddressCount\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      CreatePopUp (\r
-        EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
-        &Key,\r
-        L"Invalid Host Addresses!",\r
-        NULL\r
-        );\r
-    }\r
-\r
-    break;\r
-\r
-  case KEY_GATEWAY_ADDRESS:\r
-    Status = Ip6ParseAddressListFromString (\r
-               IfrNvData->GatewayAddress,\r
-               &Ip6NvData->GatewayAddress,\r
-               &Ip6NvData->GatewayAddressCount\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      CreatePopUp (\r
-        EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
-        &Key,\r
-        L"Invalid Gateway Addresses!",\r
-        NULL\r
-        );\r
-    }\r
-\r
-    break;\r
-\r
-  case KEY_DNS_ADDRESS:\r
-    Status = Ip6ParseAddressListFromString (\r
-               IfrNvData->DnsAddress,\r
-               &Ip6NvData->DnsAddress,\r
-               &Ip6NvData->DnsAddressCount\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      CreatePopUp (\r
-        EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
-        &Key,\r
-        L"Invalid DNS Addresses!",\r
-        NULL\r
-        );\r
-    }\r
-\r
-    break;\r
-\r
-  case KEY_SAVE_CONFIG_CHANGES:\r
-    CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));\r
-    *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
-    break;\r
-\r
-  case KEY_IGNORE_CONFIG_CHANGES:\r
-    CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));\r
-    *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;\r
-    break;\r
-\r
-  case KEY_SAVE_CHANGES:\r
-    Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
-    break;\r
-\r
-  case KEY_GET_CURRENT_SETTING:\r
-    Ip6Config = &Instance->Ip6Config;\r
-    HiiHandle = Instance->CallbackInfo.RegisteredHandle;\r
-    Data      = NULL;\r
-\r
-    //\r
-    // Get current interface info.\r
-    //\r
-    Status = Ip6ConfigNvGetData (\r
-               Ip6Config,\r
-               Ip6ConfigDataTypeInterfaceInfo,\r
-               &DataSize,\r
-               (VOID **) &Data\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    //\r
-    // Generate dynamic text opcode for host address and draw it.\r
-    //\r
-    IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;\r
-    Status = Ip6ConvertAddressListToString (\r
-               PortString,\r
-               HiiHandle,\r
-               Ip6ConfigNvHostAddress,\r
-               IfInfo->AddressInfo,\r
-               IfInfo->AddressInfoCount\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      FreePool (Data);\r
-      return Status;\r
-    }\r
-\r
-    //\r
-    // Generate the dynamic text opcode for route table and draw it.\r
-    //\r
-    Status = Ip6ConvertAddressListToString (\r
-               PortString,\r
-               HiiHandle,\r
-               Ip6ConfigNvRouteTable,\r
-               IfInfo->RouteTable,\r
-               IfInfo->RouteCount\r
-               );\r
-    if (EFI_ERROR (Status)) {\r
-      FreePool (Data);\r
-      return Status;\r
-    }\r
+  if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
+    switch (QuestionId) {\r
+    case KEY_GET_CURRENT_SETTING:\r
+      Ip6Config = &Instance->Ip6Config;\r
+      HiiHandle = Instance->CallbackInfo.RegisteredHandle;\r
+      Data      = NULL;\r
 \r
 \r
-    //\r
-    // Get DNS server list.\r
-    //\r
-    FreePool (Data);\r
-    DataSize = 0;\r
-    Data = NULL;\r
-    Status = Ip6ConfigNvGetData (\r
-               Ip6Config,\r
-               Ip6ConfigDataTypeDnsServer,\r
-               &DataSize,\r
-               (VOID **) &Data\r
-               );\r
-    if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {\r
-      if (Data != NULL) {\r
-        FreePool (Data);\r
+      //\r
+      // Get current interface info.\r
+      //\r
+      Status = Ip6ConfigNvGetData (\r
+                 Ip6Config,\r
+                 Ip6ConfigDataTypeInterfaceInfo,\r
+                 &DataSize,\r
+                 (VOID **) &Data\r
+                 );\r
+      if (EFI_ERROR (Status)) {\r
+        return Status;\r
       }\r
       }\r
-      return Status;\r
-    }\r
 \r
 \r
-    if (DataSize > 0) {\r
       //\r
       //\r
-      // Generate the dynamic text opcode for DNS server and draw it.\r
+      // Generate dynamic text opcode for host address and draw it.\r
       //\r
       //\r
+      IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;\r
       Status = Ip6ConvertAddressListToString (\r
                  PortString,\r
                  HiiHandle,\r
       Status = Ip6ConvertAddressListToString (\r
                  PortString,\r
                  HiiHandle,\r
-                 Ip6ConfigNvDnsAddress,\r
-                 Data,\r
-                 DataSize / sizeof (EFI_IPv6_ADDRESS)\r
+                 Ip6ConfigNvHostAddress,\r
+                 IfInfo->AddressInfo,\r
+                 IfInfo->AddressInfoCount\r
                  );\r
       if (EFI_ERROR (Status)) {\r
         FreePool (Data);\r
         return Status;\r
       }\r
                  );\r
       if (EFI_ERROR (Status)) {\r
         FreePool (Data);\r
         return Status;\r
       }\r
-    }\r
-\r
-    //\r
-    // Get gateway adderss list.\r
-    //\r
-    if (Data != NULL) {\r
-      FreePool (Data);\r
-    }\r
-\r
-    DataSize = 0;\r
-    Data = NULL;\r
-    Status = Ip6ConfigNvGetData (\r
-               Ip6Config,\r
-               Ip6ConfigDataTypeGateway,\r
-               &DataSize,\r
-               (VOID **) &Data\r
-               );\r
-    if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {\r
-      if (Data != NULL) {\r
-        FreePool (Data);\r
-      }\r
-      return Status;\r
-    }\r
 \r
 \r
-    if (DataSize > 0) {\r
       //\r
       //\r
-      // Generate the dynamic text opcode for gateway and draw it.\r
+      // Generate the dynamic text opcode for route table and draw it.\r
       //\r
       Status = Ip6ConvertAddressListToString (\r
                  PortString,\r
                  HiiHandle,\r
       //\r
       Status = Ip6ConvertAddressListToString (\r
                  PortString,\r
                  HiiHandle,\r
-                 Ip6ConfigNvGatewayAddress,\r
-                 Data,\r
-                 DataSize / sizeof (EFI_IPv6_ADDRESS)\r
+                 Ip6ConfigNvRouteTable,\r
+                 IfInfo->RouteTable,\r
+                 IfInfo->RouteCount\r
                  );\r
       if (EFI_ERROR (Status)) {\r
         FreePool (Data);\r
         return Status;\r
       }\r
                  );\r
       if (EFI_ERROR (Status)) {\r
         FreePool (Data);\r
         return Status;\r
       }\r
-    }\r
 \r
 \r
-    if (Data != NULL) {\r
+      //\r
+      // Get DNS server list.\r
+      //\r
       FreePool (Data);\r
       FreePool (Data);\r
+      DataSize = 0;\r
+      Data = NULL;\r
+      Status = Ip6ConfigNvGetData (\r
+                 Ip6Config,\r
+                 Ip6ConfigDataTypeDnsServer,\r
+                 &DataSize,\r
+                 (VOID **) &Data\r
+                 );\r
+      if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {\r
+        if (Data != NULL) {\r
+          FreePool (Data);\r
+        }\r
+        return Status;\r
+      }\r
+\r
+      if (DataSize > 0) {\r
+        //\r
+        // Generate the dynamic text opcode for DNS server and draw it.\r
+        //\r
+        Status = Ip6ConvertAddressListToString (\r
+                   PortString,\r
+                   HiiHandle,\r
+                   Ip6ConfigNvDnsAddress,\r
+                   Data,\r
+                   DataSize / sizeof (EFI_IPv6_ADDRESS)\r
+                   );\r
+        if (EFI_ERROR (Status)) {\r
+          FreePool (Data);\r
+          return Status;\r
+        }\r
+      }\r
+\r
+      //\r
+      // Get gateway adderss list.\r
+      //\r
+      if (Data != NULL) {\r
+        FreePool (Data);\r
+      }\r
+\r
+      DataSize = 0;\r
+      Data = NULL;\r
+      Status = Ip6ConfigNvGetData (\r
+                 Ip6Config,\r
+                 Ip6ConfigDataTypeGateway,\r
+                 &DataSize,\r
+                 (VOID **) &Data\r
+                 );\r
+      if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {\r
+        if (Data != NULL) {\r
+          FreePool (Data);\r
+        }\r
+        return Status;\r
+      }\r
+\r
+      if (DataSize > 0) {\r
+        //\r
+        // Generate the dynamic text opcode for gateway and draw it.\r
+        //\r
+        Status = Ip6ConvertAddressListToString (\r
+                   PortString,\r
+                   HiiHandle,\r
+                   Ip6ConfigNvGatewayAddress,\r
+                   Data,\r
+                   DataSize / sizeof (EFI_IPv6_ADDRESS)\r
+                   );\r
+        if (EFI_ERROR (Status)) {\r
+          FreePool (Data);\r
+          return Status;\r
+        }\r
+      }\r
+\r
+      if (Data != NULL) {\r
+        FreePool (Data);\r
+      }\r
+\r
+      Status = EFI_SUCCESS;\r
+\r
+      break;\r
+\r
+    default:\r
+      break;\r
     }\r
     }\r
+  } else if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
+    switch (QuestionId) {\r
+    case KEY_SAVE_CONFIG_CHANGES:\r
+      CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
+      break;\r
 \r
 \r
-    Status = EFI_SUCCESS;\r
+    case KEY_IGNORE_CONFIG_CHANGES:\r
+      CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;\r
+      break;\r
 \r
 \r
-    break;\r
+    case KEY_SAVE_CHANGES:\r
+      Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);\r
+      if (EFI_ERROR (Status)) {\r
+        break;\r
+      }\r
+      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
+      break;\r
+    \r
+    case KEY_INTERFACE_ID:\r
+      Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);\r
+      if (EFI_ERROR (Status)) {\r
+        CreatePopUp (\r
+          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+          &Key,\r
+          L"Invalid Interface ID!",\r
+          NULL\r
+          );\r
+      }\r
+    \r
+      break;\r
+    \r
+    case KEY_MANUAL_ADDRESS:\r
+      Status = Ip6ParseAddressListFromString (\r
+                 IfrNvData->ManualAddress,\r
+                 &Ip6NvData->ManualAddress,\r
+                 &Ip6NvData->ManualAddressCount\r
+                 );\r
+      if (EFI_ERROR (Status)) {\r
+        CreatePopUp (\r
+          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+          &Key,\r
+          L"Invalid Host Addresses!",\r
+          NULL\r
+          );\r
+      }\r
+    \r
+      break;\r
+    \r
+    case KEY_GATEWAY_ADDRESS:\r
+      Status = Ip6ParseAddressListFromString (\r
+                 IfrNvData->GatewayAddress,\r
+                 &Ip6NvData->GatewayAddress,\r
+                 &Ip6NvData->GatewayAddressCount\r
+                 );\r
+      if (EFI_ERROR (Status)) {\r
+        CreatePopUp (\r
+          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+          &Key,\r
+          L"Invalid Gateway Addresses!",\r
+          NULL\r
+          );\r
+      }\r
+    \r
+      break;\r
+    \r
+    case KEY_DNS_ADDRESS:\r
+      Status = Ip6ParseAddressListFromString (\r
+                 IfrNvData->DnsAddress,\r
+                 &Ip6NvData->DnsAddress,\r
+                 &Ip6NvData->DnsAddressCount\r
+                 );\r
+      if (EFI_ERROR (Status)) {\r
+        CreatePopUp (\r
+          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+          &Key,\r
+          L"Invalid DNS Addresses!",\r
+          NULL\r
+          );\r
+      }\r
+    \r
+      break;\r
 \r
 \r
-  default:\r
-    break;\r
+    default:\r
+      break;\r
+    }\r
   }\r
 \r
   if (!EFI_ERROR (Status)) {\r
   }\r
 \r
   if (!EFI_ERROR (Status)) {\r