]>
Commit | Line | Data |
---|---|---|
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 | |
6 | Copyright (c) 2008, Intel Corporation\r | |
7 | All rights reserved. This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT 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 | 34 | EFI_STATUS\r |
0368663f | 35 | InstallDefaultConfigAccessProtocol (\r |
ebbd2793 | 36 | IN CONST EFI_HII_PACKAGES *Packages,\r |
0368663f | 37 | IN OUT HII_THUNK_CONTEXT *ThunkContext\r |
e00e1d46 | 38 | );\r |
0368663f | 39 | \r |
40 | VOID\r | |
41 | UninstallDefaultConfigAccessProtocol (\r | |
42 | IN HII_THUNK_CONTEXT *ThunkContext\r | |
e00e1d46 | 43 | );\r |
ebbd2793 | 44 | \r |
bcf79fc8 | 45 | /**\r |
46 | \r | |
47 | This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig\r | |
48 | so that data can be read from the data storage such as UEFI Variable or module's\r | |
49 | customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r | |
50 | \r | |
0368663f | 51 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r |
bcf79fc8 | 52 | @param Request A null-terminated Unicode string in <ConfigRequest> format. Note that this\r |
0368663f | 53 | includes the routing information as well as the configurable name / value pairs. It is\r |
54 | invalid for this string to be in <MultiConfigRequest> format.\r | |
bcf79fc8 | 55 | \r |
0368663f | 56 | @param Progress On return, points to a character in the Request string. Points to the string's null\r |
57 | terminator if request was successful. Points to the most recent '&' before the first\r | |
58 | failing name / value pair (or the beginning of the string if the failure is in the first\r | |
59 | name / value pair) if the request was not successful\r | |
bcf79fc8 | 60 | @param Results A null-terminated Unicode string in <ConfigAltResp> format which has all\r |
0368663f | 61 | values filled in for the names in the Request string. String to be allocated by the called\r |
62 | function.\r | |
bcf79fc8 | 63 | \r |
64 | @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r | |
0368663f | 65 | @retval EFI_SUCCESS The setting is retrived successfully.\r |
66 | @retval !EFI_SUCCESS The error returned by UEFI Get Variable or Framework Form Callback Nvread.\r | |
bcf79fc8 | 67 | **/\r |
ebbd2793 | 68 | EFI_STATUS\r |
69 | EFIAPI\r | |
70 | ThunkExtractConfig (\r | |
71 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
72 | IN CONST EFI_STRING Request,\r | |
73 | OUT EFI_STRING *Progress,\r | |
74 | OUT EFI_STRING *Results\r | |
e00e1d46 | 75 | );\r |
ebbd2793 | 76 | \r |
77 | \r | |
bcf79fc8 | 78 | /**\r |
79 | \r | |
80 | This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig\r | |
81 | so that data can be written to the data storage such as UEFI Variable or module's\r | |
82 | customized storage exposed by EFI_FRAMEWORK_CALLBACK.\r | |
83 | \r | |
84 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL\r | |
0368663f | 85 | @param Configuration A null-terminated Unicode string in <ConfigResp> format.\r |
86 | @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first\r | |
87 | failing name / value pair (or the beginning of the string if the failure is in the first\r | |
88 | name / value pair) or the terminating NULL if all was successful.\r | |
bcf79fc8 | 89 | \r |
90 | @retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.\r | |
0368663f | 91 | @retval EFI_SUCCESS The setting is saved successfully.\r |
92 | @retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.\r | |
bcf79fc8 | 93 | **/ \r |
ebbd2793 | 94 | EFI_STATUS\r |
95 | EFIAPI\r | |
96 | ThunkRouteConfig (\r | |
97 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
98 | IN CONST EFI_STRING Configuration,\r | |
99 | OUT EFI_STRING *Progress\r | |
e00e1d46 | 100 | );\r |
ebbd2793 | 101 | \r |
bcf79fc8 | 102 | /**\r |
103 | Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,\r | |
104 | the framework HII module willl do no porting (except some porting works needed for callback for EFI_ONE_OF_OPTION opcode)\r | |
105 | and still work with a UEFI HII SetupBrowser.\r | |
106 | \r | |
0368663f | 107 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r |
108 | @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.\r | |
109 | @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the\r | |
110 | type of data to expect. The format of the data tends to vary based on the opcode that\r | |
111 | generated the callback.\r | |
112 | @param Type The type of value for the question. See EFI_IFR_TYPE_x in\r | |
113 | EFI_IFR_ONE_OF_OPTION.\r | |
114 | @param Value A pointer to the data being sent to the original exporting driver. The type is specified\r | |
115 | by Type. Type EFI_IFR_TYPE_VALUE is defined in\r | |
116 | EFI_IFR_ONE_OF_OPTION.\r | |
117 | @param ActionRequest On return, points to the action requested by the callback function. Type\r | |
118 | EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form\r | |
119 | Browser Protocol.\r | |
bcf79fc8 | 120 | \r |
121 | @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under\r | |
0368663f | 122 | focuse to be INTERRACTIVE.\r |
123 | @retval EFI_SUCCESS The callback complete successfully.\r | |
124 | @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.\r | |
bcf79fc8 | 125 | \r |
126 | **/\r | |
ebbd2793 | 127 | EFI_STATUS\r |
128 | EFIAPI\r | |
129 | ThunkCallback (\r | |
130 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
131 | IN EFI_BROWSER_ACTION Action,\r | |
132 | IN EFI_QUESTION_ID QuestionId,\r | |
133 | IN UINT8 Type,\r | |
134 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
135 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
e00e1d46 | 136 | );\r |
ebbd2793 | 137 | \r |
138 | #endif\r | |
139 | \r |