**/\r
\r
#include "Setup.h"\r
-#include "Ui.h"\r
-\r
\r
SETUP_DRIVER_PRIVATE_DATA mPrivateData = {\r
SETUP_DRIVER_SIGNATURE,\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Initialize Question's Edit copy from Storage.\r
\r
+ @param Selection Selection contains the information about \r
+ the Selection, form and formset to be displayed.\r
+ Selection action may be updated in retrieve callback.\r
@param FormSet FormSet data structure.\r
@param Form Form data structure.\r
\r
**/\r
EFI_STATUS\r
LoadFormConfig (\r
- IN FORM_BROWSER_FORMSET *FormSet,\r
- IN FORM_BROWSER_FORM *Form\r
+ IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet,\r
+ IN FORM_BROWSER_FORM *Form\r
)\r
{\r
- EFI_STATUS Status;\r
- LIST_ENTRY *Link;\r
- FORM_BROWSER_STATEMENT *Question;\r
-\r
+ EFI_STATUS Status;\r
+ LIST_ENTRY *Link;\r
+ FORM_BROWSER_STATEMENT *Question;\r
+ UINT8 *BufferValue;\r
+ UINTN StorageWidth;\r
+ EFI_HII_VALUE *HiiValue;\r
+ EFI_BROWSER_ACTION_REQUEST ActionRequest;\r
+ \r
Link = GetFirstNode (&Form->StatementListHead);\r
while (!IsNull (&Form->StatementListHead, Link)) {\r
Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+ \r
+ //\r
+ // Check whether EfiVarstore with CallBack can be got.\r
+ //\r
+ if ((Question->QuestionId != 0) && (Question->Storage != NULL) &&\r
+ (Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) && \r
+ ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK)) {\r
+ //\r
+ // ConfigAccess can't be NULL.\r
+ //\r
+ if (FormSet->ConfigAccess == NULL) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+ //\r
+ // Check QuestionValue does exist.\r
+ //\r
+ StorageWidth = Question->StorageWidth;\r
+ if (Question->BufferValue != NULL) {\r
+ BufferValue = Question->BufferValue;\r
+ } else {\r
+ BufferValue = (UINT8 *) &Question->HiiValue.Value;\r
+ }\r
+ Status = gRT->GetVariable (\r
+ Question->VariableName,\r
+ &Question->Storage->Guid,\r
+ NULL,\r
+ &StorageWidth,\r
+ BufferValue\r
+ );\r
+\r
+ if (!EFI_ERROR (Status)) {\r
+ ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
+ HiiValue = &Question->HiiValue;\r
+ BufferValue = (UINT8 *) &Question->HiiValue.Value;\r
+ if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
+ //\r
+ // Create String in HII database for Configuration Driver to retrieve\r
+ //\r
+ HiiValue->Value.string = NewString ((CHAR16 *) Question->BufferValue, FormSet->HiiHandle);\r
+ } else if (HiiValue->Type == EFI_IFR_TYPE_BUFFER) {\r
+ BufferValue = Question->BufferValue;\r
+ }\r
+\r
+ Status = FormSet->ConfigAccess->Callback (\r
+ FormSet->ConfigAccess,\r
+ EFI_BROWSER_ACTION_RETRIEVE,\r
+ Question->QuestionId,\r
+ HiiValue->Type,\r
+ (EFI_IFR_TYPE_VALUE *) BufferValue,\r
+ &ActionRequest\r
+ );\r
+\r
+ if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
+ //\r
+ // Clean the String in HII Database\r
+ //\r
+ DeleteString (HiiValue->Value.string, FormSet->HiiHandle);\r
+ }\r
+\r
+ if (!EFI_ERROR (Status)) {\r
+ switch (ActionRequest) {\r
+ case EFI_BROWSER_ACTION_REQUEST_RESET:\r
+ gResetRequired = TRUE;\r
+ break;\r
+\r
+ case EFI_BROWSER_ACTION_REQUEST_SUBMIT:\r
+ //\r
+ // Till now there is no uncommitted data, so ignore this request\r
+ //\r
+ break;\r
+\r
+ case EFI_BROWSER_ACTION_REQUEST_EXIT:\r
+ Selection->Action = UI_ACTION_EXIT;\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
\r
Link = GetNextNode (&Form->StatementListHead, Link);\r
}\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Initialize Question's Edit copy from Storage for the whole Formset.\r
\r
+ @param Selection Selection contains the information about \r
+ the Selection, form and formset to be displayed.\r
+ Selection action may be updated in retrieve callback.\r
@param FormSet FormSet data structure.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
**/\r
EFI_STATUS\r
LoadFormSetConfig (\r
- IN FORM_BROWSER_FORMSET *FormSet\r
+ IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet\r
)\r
{\r
- EFI_STATUS Status;\r
- LIST_ENTRY *Link;\r
- FORM_BROWSER_FORM *Form;\r
+ EFI_STATUS Status;\r
+ LIST_ENTRY *Link;\r
+ FORM_BROWSER_FORM *Form;\r
\r
Link = GetFirstNode (&FormSet->FormListHead);\r
while (!IsNull (&FormSet->FormListHead, Link)) {\r
//\r
// Initialize local copy of Value for each Form\r
//\r
- Status = LoadFormConfig (FormSet, Form);\r
+ Status = LoadFormConfig (Selection, FormSet, Form);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Fill storage's edit copy with settings requested from Configuration Driver.\r
\r
extern EFI_GUID gZeroGuid;\r
extern EFI_GUID gTianoHiiIfrGuid;\r
\r
+#include "Ui.h"\r
//\r
// Global Procedure Defines\r
//\r
/**\r
Initialize Question's Edit copy from Storage.\r
\r
+ @param Selection Selection contains the information about \r
+ the Selection, form and formset to be displayed.\r
+ Selection action may be updated in retrieve callback.\r
@param FormSet FormSet data structure.\r
@param Form Form data structure.\r
\r
**/\r
EFI_STATUS\r
LoadFormConfig (\r
- IN FORM_BROWSER_FORMSET *FormSet,\r
- IN FORM_BROWSER_FORM *Form\r
+ IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet,\r
+ IN FORM_BROWSER_FORM *Form\r
);\r
\r
/**\r
Initialize Question's Edit copy from Storage for the whole Formset.\r
\r
+ @param Selection Selection contains the information about \r
+ the Selection, form and formset to be displayed.\r
+ Selection action may be updated in retrieve callback.\r
@param FormSet FormSet data structure.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
**/\r
EFI_STATUS\r
LoadFormSetConfig (\r
- IN FORM_BROWSER_FORMSET *FormSet\r
+ IN OUT UI_MENU_SELECTION *Selection,\r
+ IN FORM_BROWSER_FORMSET *FormSet\r
);\r
\r
/**\r