]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/ConfigAccess.h
Bug fixes for FrameworkHiiToUefiHiiThunk;
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiToUefiHiiThunk / ConfigAccess.h
CommitLineData
ebbd2793 1/**@file\r
2 This file contains functions related to Config Access Protocols installed by\r
3 by HII Thunk Modules which is used to thunk UEFI Config Access Callback to \r
4 Framework HII Callback.\r
5 \r
6Copyright (c) 2008, Intel Corporation\r
7All rights reserved. This program and the accompanying materials\r
8are licensed and made available under the terms and conditions of the BSD License\r
9which accompanies this distribution. The full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#ifndef _HII_THUNK_CONFIG_ACCESS_H\r
18#define _HII_THUNK_CONFIG_ACCESS_H\r
19\r
bcf79fc8 20/**\r
21 This function installs a EFI_CONFIG_ACCESS_PROTOCOL instance for a form package registered\r
22 by a module using Framework HII Protocol Interfaces.\r
ebbd2793 23\r
bcf79fc8 24 UEFI HII require EFI_HII_CONFIG_ACCESS_PROTOCOL to be installed on a EFI_HANDLE, so\r
25 that Setup Utility can load the Buffer Storage using this protocol.\r
26 \r
27 @param Packages The framework package list.\r
0368663f 28 @param ThunkContext The Thunk Layer Handle Mapping Database Entry.\r
bcf79fc8 29 \r
0368663f 30 @retval EFI_SUCCESS The Config Access Protocol is installed successfully.\r
bcf79fc8 31 @retval EFI_OUT_RESOURCE There is not enough memory.\r
32 \r
33**/\r
ebbd2793 34EFI_STATUS\r
0368663f 35InstallDefaultConfigAccessProtocol (\r
ebbd2793 36 IN CONST EFI_HII_PACKAGES *Packages,\r
0368663f 37 IN OUT HII_THUNK_CONTEXT *ThunkContext\r
38 )\r
39;\r
40\r
41VOID\r
42UninstallDefaultConfigAccessProtocol (\r
43 IN HII_THUNK_CONTEXT *ThunkContext\r
ebbd2793 44 )\r
45;\r
46\r
bcf79fc8 47/**\r
48\r
49 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig\r
50 so that data can be read from the data storage such as UEFI Variable or module's\r
51 customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
52\r
0368663f 53 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
bcf79fc8 54 @param Request A null-terminated Unicode string in <ConfigRequest> format. Note that this\r
0368663f 55 includes the routing information as well as the configurable name / value pairs. It is\r
56 invalid for this string to be in <MultiConfigRequest> format.\r
bcf79fc8 57\r
0368663f 58 @param Progress On return, points to a character in the Request string. Points to the string's null\r
59 terminator if request was successful. Points to the most recent '&' before the first\r
60 failing name / value pair (or the beginning of the string if the failure is in the first\r
61 name / value pair) if the request was not successful\r
bcf79fc8 62 @param Results A null-terminated Unicode string in <ConfigAltResp> format which has all\r
0368663f 63 values filled in for the names in the Request string. String to be allocated by the called\r
64 function.\r
bcf79fc8 65 \r
66 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
0368663f 67 @retval EFI_SUCCESS The setting is retrived successfully.\r
68 @retval !EFI_SUCCESS The error returned by UEFI Get Variable or Framework Form Callback Nvread.\r
bcf79fc8 69 **/\r
ebbd2793 70EFI_STATUS\r
71EFIAPI\r
72ThunkExtractConfig (\r
73 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
74 IN CONST EFI_STRING Request,\r
75 OUT EFI_STRING *Progress,\r
76 OUT EFI_STRING *Results\r
77 )\r
78;\r
79\r
80\r
bcf79fc8 81/**\r
82\r
83 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig\r
84 so that data can be written to the data storage such as UEFI Variable or module's\r
85 customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
86 \r
87 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
0368663f 88 @param Configuration A null-terminated Unicode string in <ConfigResp> format.\r
89 @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first\r
90 failing name / value pair (or the beginning of the string if the failure is in the first\r
91 name / value pair) or the terminating NULL if all was successful.\r
bcf79fc8 92 \r
93 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
0368663f 94 @retval EFI_SUCCESS The setting is saved successfully.\r
95 @retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.\r
bcf79fc8 96**/ \r
ebbd2793 97EFI_STATUS\r
98EFIAPI\r
99ThunkRouteConfig (\r
100 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
101 IN CONST EFI_STRING Configuration,\r
102 OUT EFI_STRING *Progress\r
103 )\r
104;\r
105\r
bcf79fc8 106/**\r
107 Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,\r
108 the framework HII module willl do no porting (except some porting works needed for callback for EFI_ONE_OF_OPTION opcode)\r
109 and still work with a UEFI HII SetupBrowser.\r
110 \r
0368663f 111 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
112 @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.\r
113 @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the\r
114 type of data to expect. The format of the data tends to vary based on the opcode that\r
115 generated the callback.\r
116 @param Type The type of value for the question. See EFI_IFR_TYPE_x in\r
117 EFI_IFR_ONE_OF_OPTION.\r
118 @param Value A pointer to the data being sent to the original exporting driver. The type is specified\r
119 by Type. Type EFI_IFR_TYPE_VALUE is defined in\r
120 EFI_IFR_ONE_OF_OPTION.\r
121 @param ActionRequest On return, points to the action requested by the callback function. Type\r
122 EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form\r
123 Browser Protocol.\r
bcf79fc8 124 \r
125 @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under\r
0368663f 126 focuse to be INTERRACTIVE.\r
127 @retval EFI_SUCCESS The callback complete successfully.\r
128 @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.\r
bcf79fc8 129 \r
130 **/\r
ebbd2793 131EFI_STATUS\r
132EFIAPI\r
133ThunkCallback (\r
134 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
135 IN EFI_BROWSER_ACTION Action,\r
136 IN EFI_QUESTION_ID QuestionId,\r
137 IN UINT8 Type,\r
138 IN EFI_IFR_TYPE_VALUE *Value,\r
139 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
140 )\r
141;\r
142\r
143#endif\r
144\r