]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.h
Fixed build failed.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiOnUefiHiiThunk / ConfigAccess.h
CommitLineData
26a76fbc 1/** @file\r
ebbd2793 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
584d5652
HT
6Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
7This program and the accompanying materials\r
ebbd2793 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
26a76fbc
LG
17#ifndef _HII_THUNK_CONFIG_ACCESS_H_\r
18#define _HII_THUNK_CONFIG_ACCESS_H_\r
ebbd2793 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
26a76fbc
LG
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
bcf79fc8 26 \r
26a76fbc
LG
27 @param Packages The Package List.\r
28 @param ThunkContext The Thunk Context.\r
bcf79fc8 29 \r
26a76fbc
LG
30 @retval EFI_SUCCESS The Config Access Protocol is installed successfully.\r
31 @retval EFI_OUT_RESOURCE There is not enough memory.\r
bcf79fc8 32 \r
33**/\r
ebbd2793 34EFI_STATUS\r
0368663f 35InstallDefaultConfigAccessProtocol (\r
26a76fbc
LG
36 IN CONST EFI_HII_PACKAGES *Packages,\r
37 IN OUT HII_THUNK_CONTEXT *ThunkContext\r
e00e1d46 38 );\r
0368663f 39\r
26a76fbc
LG
40/**\r
41 This function un-installs the EFI_CONFIG_ACCESS_PROTOCOL instance for a form package registered\r
42 by a module using Framework HII Protocol Interfaces.\r
43\r
44 ASSERT if no Config Access is found for such pakcage list or failed to uninstall the protocol.\r
45\r
46 @param ThunkContext The Thunk Context.\r
47 \r
48**/\r
0368663f 49VOID\r
50UninstallDefaultConfigAccessProtocol (\r
51 IN HII_THUNK_CONTEXT *ThunkContext\r
e00e1d46 52 );\r
ebbd2793 53\r
bcf79fc8 54/**\r
55\r
56 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig\r
57 so that data can be read from the data storage such as UEFI Variable or module's\r
58 customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
59\r
0368663f 60 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
bcf79fc8 61 @param Request A null-terminated Unicode string in <ConfigRequest> format. Note that this\r
0368663f 62 includes the routing information as well as the configurable name / value pairs. It is\r
63 invalid for this string to be in <MultiConfigRequest> format.\r
bcf79fc8 64\r
0368663f 65 @param Progress On return, points to a character in the Request string. Points to the string's null\r
66 terminator if request was successful. Points to the most recent '&' before the first\r
67 failing name / value pair (or the beginning of the string if the failure is in the first\r
68 name / value pair) if the request was not successful\r
bcf79fc8 69 @param Results A null-terminated Unicode string in <ConfigAltResp> format which has all\r
0368663f 70 values filled in for the names in the Request string. String to be allocated by the called\r
71 function.\r
bcf79fc8 72 \r
73 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
0368663f 74 @retval EFI_SUCCESS The setting is retrived successfully.\r
75 @retval !EFI_SUCCESS The error returned by UEFI Get Variable or Framework Form Callback Nvread.\r
bcf79fc8 76 **/\r
ebbd2793 77EFI_STATUS\r
78EFIAPI\r
79ThunkExtractConfig (\r
80 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
81 IN CONST EFI_STRING Request,\r
82 OUT EFI_STRING *Progress,\r
83 OUT EFI_STRING *Results\r
e00e1d46 84 );\r
ebbd2793 85\r
86\r
bcf79fc8 87/**\r
bcf79fc8 88 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig\r
89 so that data can be written to the data storage such as UEFI Variable or module's\r
90 customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r
91 \r
26a76fbc
LG
92 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r
93 @param Configuration A null-terminated Unicode string in <ConfigResp> format.\r
94 @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first\r
95 failing name / value pair (or the beginning of the string if the failure is in the first\r
96 name / value pair) or the terminating NULL if all was successful.\r
bcf79fc8 97 \r
98 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r
0368663f 99 @retval EFI_SUCCESS The setting is saved successfully.\r
100 @retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.\r
26a76fbc 101**/ \r
ebbd2793 102EFI_STATUS\r
103EFIAPI\r
104ThunkRouteConfig (\r
105 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
106 IN CONST EFI_STRING Configuration,\r
107 OUT EFI_STRING *Progress\r
e00e1d46 108 );\r
ebbd2793 109\r
bcf79fc8 110/**\r
111 Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,\r
26a76fbc 112 the framework HII module willl do no porting and work with a UEFI HII SetupBrowser.\r
bcf79fc8 113 \r
26a76fbc
LG
114 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
115 @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.\r
116 @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the\r
117 type of data to expect. The format of the data tends to vary based on the opcode that\r
118 generated the callback.\r
119 @param Type The type of value for the question. See EFI_IFR_TYPE_x in\r
120 EFI_IFR_ONE_OF_OPTION.\r
121 @param Value A pointer to the data being sent to the original exporting driver. The type is specified\r
122 by Type. Type EFI_IFR_TYPE_VALUE is defined in\r
123 EFI_IFR_ONE_OF_OPTION.\r
124 @param ActionRequest On return, points to the action requested by the callback function. Type\r
125 EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form\r
126 Browser Protocol.\r
bcf79fc8 127 \r
26a76fbc
LG
128 @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under\r
129 focuse to be INTERRACTIVE.\r
130 @retval EFI_SUCCESS The callback complete successfully.\r
131 @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.\r
bcf79fc8 132 \r
133 **/\r
ebbd2793 134EFI_STATUS\r
135EFIAPI\r
136ThunkCallback (\r
137 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
138 IN EFI_BROWSER_ACTION Action,\r
139 IN EFI_QUESTION_ID QuestionId,\r
140 IN UINT8 Type,\r
141 IN EFI_IFR_TYPE_VALUE *Value,\r
142 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
e00e1d46 143 );\r
ebbd2793 144\r
145#endif\r
146\r