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