]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/ConfigAccess.h
refine code.
[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 MapEntry 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 InstallDefaultUefiConfigAccessProtocol (
36 IN CONST EFI_HII_PACKAGES *Packages,
37 IN OUT HII_TRHUNK_HANDLE_MAPPING_DATABASE_ENTRY *MapEntry
38 )
39 ;
40
41 /**
42
43 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig
44 so that data can be read from the data storage such as UEFI Variable or module's
45 customized storage exposed by EFI_FRAMEWORK_CALLBACK.
46
47 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
48 @param Request A null-terminated Unicode string in <ConfigRequest> format. Note that this
49 includes the routing information as well as the configurable name / value pairs. It is
50 invalid for this string to be in <MultiConfigRequest> format.
51
52 @param Progress On return, points to a character in the Request string. Points to the string's null
53 terminator if request was successful. Points to the most recent '&' before the first
54 failing name / value pair (or the beginning of the string if the failure is in the first
55 name / value pair) if the request was not successful
56 @param Results A null-terminated Unicode string in <ConfigAltResp> format which has all
57 values filled in for the names in the Request string. String to be allocated by the called
58 function.
59
60 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.
61 @retval EFI_SUCCESS The setting is retrived successfully.
62 @retval !EFI_SUCCESS The error returned by UEFI Get Variable or Framework Form Callback Nvread.
63 **/
64 EFI_STATUS
65 EFIAPI
66 ThunkExtractConfig (
67 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
68 IN CONST EFI_STRING Request,
69 OUT EFI_STRING *Progress,
70 OUT EFI_STRING *Results
71 )
72 ;
73
74
75 /**
76
77 This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig
78 so that data can be written to the data storage such as UEFI Variable or module's
79 customized storage exposed by EFI_FRAMEWORK_CALLBACK.
80
81 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
82 @param Configuration A null-terminated Unicode string in <ConfigResp> format.
83 @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first
84 failing name / value pair (or the beginning of the string if the failure is in the first
85 name / value pair) or the terminating NULL if all was successful.
86
87 @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.
88 @retval EFI_SUCCESS The setting is saved successfully.
89 @retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.
90 **/
91 EFI_STATUS
92 EFIAPI
93 ThunkRouteConfig (
94 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
95 IN CONST EFI_STRING Configuration,
96 OUT EFI_STRING *Progress
97 )
98 ;
99
100 /**
101 Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,
102 the framework HII module willl do no porting (except some porting works needed for callback for EFI_ONE_OF_OPTION opcode)
103 and still work with a UEFI HII SetupBrowser.
104
105 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
106 @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.
107 @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the
108 type of data to expect. The format of the data tends to vary based on the opcode that
109 generated the callback.
110 @param Type The type of value for the question. See EFI_IFR_TYPE_x in
111 EFI_IFR_ONE_OF_OPTION.
112 @param Value A pointer to the data being sent to the original exporting driver. The type is specified
113 by Type. Type EFI_IFR_TYPE_VALUE is defined in
114 EFI_IFR_ONE_OF_OPTION.
115 @param ActionRequest On return, points to the action requested by the callback function. Type
116 EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form
117 Browser Protocol.
118
119 @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under
120 focuse to be INTERRACTIVE.
121 @retval EFI_SUCCESS The callback complete successfully.
122 @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.
123
124 **/
125 EFI_STATUS
126 EFIAPI
127 ThunkCallback (
128 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
129 IN EFI_BROWSER_ACTION Action,
130 IN EFI_QUESTION_ID QuestionId,
131 IN UINT8 Type,
132 IN EFI_IFR_TYPE_VALUE *Value,
133 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
134 )
135 ;
136
137 #endif
138