{NULL, NULL} //ConfigAccessStorageListHead\r
};\r
\r
+/**\r
+ Find and return the pointer to Package Header of the Form package\r
+ in the Framework Package List. The Framework Package List is created\r
+ by a module calling the Framework HII interface.\r
+ The Framwork Package List contains package data \r
+ generated by Intel's UEFI VFR Compiler and String gather tool. The data format\r
+ of the package data is defined by TIANO_AUTOGEN_PACKAGES_HEADER.\r
+\r
+ If the package list contains other type of packages such as KEYBOARD_LAYOUT,\r
+ FONTS and IMAGES, the ASSERT. This is to make sure the caller is a \r
+ Framework Module which does not include packages introduced by UEFI Specification\r
+ or packages that is not supported by Thunk layer.\r
+ \r
+ @param Packages The Framework Package List\r
+ \r
+ @retval EFI_HII_PACKAGE_HEADER* Return the Package Header of\r
+ Form Package.\r
+ @retval NULL If no Form Package is found.\r
+**/\r
EFI_HII_PACKAGE_HEADER *\r
GetIfrFormSet (\r
IN CONST EFI_HII_PACKAGES *Packages\r
return (EFI_HII_PACKAGE_HEADER *) NULL;\r
}\r
\r
+/**\r
+ This function scan EFI_IFR_VARSTORE_OP in the Form Package.\r
+ It create entries for these VARSTORE found and append the entry\r
+ to a Link List.\r
+\r
+ If FormSetPackage is not EFI_HII_PACKAGE_FORM, then ASSERT.\r
+ If there is no linear buffer storage in this formset, then ASSERT.\r
+\r
+ @param FormSetPackage The Form Package header.\r
+ @param BufferStorageListHead The link list for the VARSTORE found in the form package.\r
+ \r
+ @retval EFI_SUCCESS The function scan the form set and find one or more \r
+ VARSTOREs.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory to complete the function.\r
+**/\r
EFI_STATUS\r
GetBufferStorage (\r
IN CONST EFI_HII_PACKAGE_HEADER *FormSetPackage,\r
EFI_IFR_VARSTORE *VarStoreOpCode;\r
HII_TRHUNK_BUFFER_STORAGE_KEY *BufferStorageKey;\r
\r
+ ASSERT (FormSetPackage->Type == EFI_HII_PACKAGE_FORM);\r
+\r
OpCodeOffset = sizeof (EFI_HII_PACKAGE_HEADER);\r
while (OpCodeOffset < FormSetPackage->Length) {\r
OpCodeData = (UINT8 *) FormSetPackage + OpCodeOffset;\r
InsertTailList (BufferStorageListHead, &BufferStorageKey->List);\r
}\r
}\r
+\r
return EFI_SUCCESS;\r
}\r
\r
-\r
+/**\r
+ This function installs a EFI_CONFIG_ACCESS_PROTOCOL instance for a form package registered\r
+ by a module using Framework HII Protocol Interfaces.\r
+\r
+ UEFI HII require EFI_HII_CONFIG_ACCESS_PROTOCOL to be installed on a EFI_HANDLE, so\r
+ that Setup Utility can load the Buffer Storage using this protocol.\r
+ \r
+ @param Packages The framework package list.\r
+ @param MapEntry The Thunk Layer Handle Mapping Database Entry.\r
+ \r
+ @retval EFI_SUCCESS The Config Access Protocol is installed successfully.\r
+ @retval EFI_OUT_RESOURCE There is not enough memory.\r
+ \r
+**/\r
EFI_STATUS\r
InstallDefaultUefiConfigAccessProtocol (\r
IN CONST EFI_HII_PACKAGES *Packages,\r
sizeof (HII_TRHUNK_CONFIG_ACCESS_PROTOCOL_INSTANCE), \r
&ConfigAccessProtocolInstanceTempate\r
);\r
+ ASSERT (ConfigAccessInstance != NULL);\r
InitializeListHead (&ConfigAccessInstance->ConfigAccessBufferStorageListHead);\r
\r
//\r
// We assume there is only one formset package in each Forms Package\r
//\r
FormSetPackage = GetIfrFormSet (Packages);\r
+ ASSERT (FormSetPackage != NULL);\r
+ \r
Status = GetBufferStorage (FormSetPackage, &ConfigAccessInstance->ConfigAccessBufferStorageListHead);\r
if (EFI_ERROR (Status)) {\r
FreePool (ConfigAccessInstance);\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+\r
+ Wrap EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig to a call to EFI_FORM_CALLBACK_PROTOCOL.NvWrite.\r
+ \r
+ @param BufferStorageKey The key with all attributes needed to call EFI_FORM_CALLBACK_PROTOCOL.NvWrite.\r
+ @param FrameworkFormCallBack The EFI_FORM_CALLBACK_PROTOCOL registered by Framework HII module.\r
+ @param Data The data to be saved.\r
+ @param DataSize The size of data.\r
+ \r
+ @retval EFI_STATUS The status returned by the EFI_FORM_CALLBACK_PROTOCOL.NvWrite.\r
+ **/\r
EFI_STATUS\r
RouteConfigToFrameworkFormCallBack (\r
IN HII_TRHUNK_BUFFER_STORAGE_KEY *BufferStorageKey,\r
return Status;\r
}\r
\r
+/**\r
+ Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig to a call to EFI_FORM_CALLBACK_PROTOCOL.NvRead.\r
+ \r
+ @param BufferStorageKey The key with all attributes needed to call EFI_FORM_CALLBACK_PROTOCOL.NvRead.\r
+ @param FrameworkFormCallBack The EFI_FORM_CALLBACK_PROTOCOL registered by Framework HII module.\r
+ @param Data The data read.\r
+ @param DataSize The size of data.\r
+ \r
+ @retval EFI_STATUS The status returned by the EFI_FORM_CALLBACK_PROTOCOL.NvWrite.\r
+ @retval EFI_INVALID_PARAMETER If the EFI_FORM_CALLBACK_PROTOCOL.NvRead return the size information of the data\r
+ does not match what has been recorded early in he HII_TRHUNK_BUFFER_STORAGE_KEY.\r
+ **/\r
EFI_STATUS\r
ExtractConfigFromFrameworkFormCallBack (\r
IN HII_TRHUNK_BUFFER_STORAGE_KEY *BufferStorageKey,\r
return Status;\r
}\r
\r
+/**\r
+ Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig to a call to UEFI Variable Set Service.\r
+ \r
+ @param BufferStorageKey The key with all attributes needed to call a UEFI Variable Get Service.\r
+ @param Data The data read.\r
+ @param DataSize The size of data.\r
+\r
+ @retval EFI_STATUS The status returned by the UEFI Variable Set Service.\r
+ \r
+ **/\r
EFI_STATUS\r
RouteConfigToUefiVariable (\r
IN HII_TRHUNK_BUFFER_STORAGE_KEY *BufferStorageKey,\r
);\r
\r
}\r
+\r
+/**\r
+ Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig to a call to UEFI Variable Get Service.\r
+ \r
+ @param BufferStorageKey The key with all attributes needed to call a UEFI Variable Get Service.\r
+ @param Data The data read.\r
+ @param DataSize The size of data.\r
+\r
+ If the UEFI Variable Get Service return the size information of the data\r
+ does not match what has been recorded early in he HII_TRHUNK_BUFFER_STORAGE_KEY.\r
+ then ASSERT.\r
+ \r
+ @retval EFI_STATUS The status returned by the UEFI Variable Get Service.\r
+ @retval EFI_INVALID_PARAMETER If the UEFI Variable Get Service return the size information of the data\r
+ does not match what has been recorded early in he HII_TRHUNK_BUFFER_STORAGE_KEY.\r
+ **/\r
+\r
EFI_STATUS\r
ExtractConfigFromUefiVariable (\r
IN HII_TRHUNK_BUFFER_STORAGE_KEY *BufferStorageKey,\r
return Status;\r
}\r
\r
-\r
+/**\r
+\r
+ This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig\r
+ so that data can be read from the data storage such as UEFI Variable or module's\r
+ customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
+\r
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
+ @param Request A null-terminated Unicode string in <ConfigRequest> format. Note that this\r
+ includes the routing information as well as the configurable name / value pairs. It is\r
+ invalid for this string to be in <MultiConfigRequest> format.\r
+\r
+ @param Progress On return, points to a character in the Request string. Points to the string¡¯s null\r
+ terminator if request was successful. Points to the most recent ¡®&¡¯ before the first\r
+ failing name / value pair (or the beginning of the string if the failure is in the first\r
+ name / value pair) if the request was not successful\r
+ @param Results A null-terminated Unicode string in <ConfigAltResp> format which has all\r
+ values filled in for the names in the Request string. String to be allocated by the called\r
+ function.\r
+ \r
+ @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
+ @retval EFI_SUCCESS The setting is retrived successfully.\r
+ @retval !EFI_SUCCESS The error returned by UEFI Get Variable or Framework Form Callback Nvread.\r
+ **/\r
EFI_STATUS\r
EFIAPI\r
ThunkExtractConfig (\r
Data = NULL;\r
ConfigaAccessInstance = HII_TRHUNK_CONFIG_ACCESS_PROTOCOL_INSTANCE_FROM_PROTOCOL (This);\r
\r
+ //\r
+ // For now, only one var varstore is supported so that we don't need to parse the Configuration string.\r
+ //\r
ListEntry = GetFirstNode (&ConfigaAccessInstance->ConfigAccessBufferStorageListHead);\r
if (ListEntry == NULL) {\r
ASSERT (FALSE);\r
return Status;\r
}\r
\r
-\r
+/**\r
+\r
+ This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig\r
+ so that data can be written to the data storage such as UEFI Variable or module's\r
+ customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
+ \r
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
+ @param Configuration A null-terminated Unicode string in <ConfigResp> format.\r
+ @param a pointer to a string filled in with the offset of the most recent ¡®&¡¯ before the first\r
+ failing name / value pair (or the beginning of the string if the failure is in the first\r
+ name / value pair) or the terminating NULL if all was successful.\r
+ \r
+ @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
+ @retval EFI_SUCCESS The setting is saved successfully.\r
+ @retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.\r
+**/ \r
EFI_STATUS\r
EFIAPI\r
ThunkRouteConfig (\r
Data = NULL;\r
ConfigaAccessInstance = HII_TRHUNK_CONFIG_ACCESS_PROTOCOL_INSTANCE_FROM_PROTOCOL (This);\r
\r
+ //\r
+ // For now, only one var varstore is supported so that we don't need to parse the Configuration string.\r
+ //\r
ListEntry = GetFirstNode (&ConfigaAccessInstance->ConfigAccessBufferStorageListHead);\r
if (ListEntry == NULL) {\r
ASSERT (FALSE);\r
return Status;\r
}\r
\r
+/**\r
+ Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,\r
+ the framework HII module willl do no porting (except some porting works needed for callback for EFI_ONE_OF_OPTION opcode)\r
+ and still work with a UEFI HII SetupBrowser.\r
+ \r
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+ @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.\r
+ @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the\r
+ type of data to expect. The format of the data tends to vary based on the opcode that\r
+ generated the callback.\r
+ @param Type The type of value for the question. See EFI_IFR_TYPE_x in\r
+ EFI_IFR_ONE_OF_OPTION.\r
+ @param Value A pointer to the data being sent to the original exporting driver. The type is specified\r
+ by Type. Type EFI_IFR_TYPE_VALUE is defined in\r
+ EFI_IFR_ONE_OF_OPTION.\r
+ @param ActionRequest On return, points to the action requested by the callback function. Type\r
+ EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form\r
+ Browser Protocol.\r
+ \r
+ @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under\r
+ focuse to be INTERRACTIVE.\r
+ @retval EFI_SUCCESS The callback complete successfully.\r
+ @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.\r
+ \r
+ **/\r
EFI_STATUS\r
EFIAPI\r
ThunkCallback (\r