/* This function is invoked if user selected a interactive opcode from Device Manager's Formset. If user set VBIOS, the new value is saved to EFI variable. */
EFI_STATUS EFIAPI DeviceManagerCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
/* This function is invoked if user selected a interactive opcode from Device Manager's Formset. If user set VBIOS, the new value is saved to EFI variable. */
EFI_STATUS EFIAPI DeviceManagerCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
{
  UINTN  CurIndex;
  if (Action != EFI_BROWSER_ACTION_CHANGING) {
    return EFI_UNSUPPORTED;
  }
  if ((Value == NULL) || (ActionRequest == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {
    for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex++) {
      if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {
        mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);
      }
    }
    CreateDeviceManagerForm (NETWORK_DEVICE_FORM_ID);
  } else if (QuestionId == QUESTION_NETWORK_DEVICE_ID) {
    CreateDeviceManagerForm (NETWORK_DEVICE_LIST_FORM_ID);
  }
  return EFI_SUCCESS;
}