]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h
UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI.
[mirror_edk2.git] / MdeModulePkg / Library / DeviceManagerUiLib / DeviceManager.h
CommitLineData
32465d9a
DB
1/** @file\r
2The device manager reference implement\r
3\r
4Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
32465d9a
DB
6\r
7**/\r
8\r
9#ifndef _DEVICE_MANAGER_H_\r
10#define _DEVICE_MANAGER_H_\r
11\r
12#include <Guid/MdeModuleHii.h>\r
13#include <Guid/HiiPlatformSetupFormset.h>\r
14\r
15#include <Protocol/HiiConfigAccess.h>\r
16#include <Protocol/PciIo.h>\r
17\r
18#include <Library/PrintLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/BaseMemoryLib.h>\r
21#include <Library/UefiBootServicesTableLib.h>\r
22#include <Library/MemoryAllocationLib.h>\r
23#include <Library/BaseLib.h>\r
24#include <Library/HiiLib.h>\r
25#include <Library/DevicePathLib.h>\r
26#include <Library/UefiHiiServicesLib.h>\r
27\r
28//\r
29// These are defined as the same with vfr file\r
30//\r
31#define DEVICE_MANAGER_FORMSET_GUID \\r
32 { \\r
33 0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \\r
34 }\r
35\r
36#define LABEL_END 0xffff\r
37#define LABEL_FORM_ID_OFFSET 0x0100\r
38\r
39#define DEVICE_MANAGER_FORM_ID 0x1000\r
40#define NETWORK_DEVICE_LIST_FORM_ID 0x1001\r
41#define NETWORK_DEVICE_FORM_ID 0x1002\r
42#define DEVICE_KEY_OFFSET 0x4000\r
43#define NETWORK_DEVICE_LIST_KEY_OFFSET 0x2000\r
44\r
45#define MAX_KEY_SECTION_LEN 0x1000\r
46\r
47#define QUESTION_NETWORK_DEVICE_ID 0x3FFF\r
48//\r
49// These are the VFR compiler generated data representing our VFR data.\r
50//\r
51extern UINT8 DeviceManagerVfrBin[];\r
52\r
53#define DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('D', 'M', 'C', 'B')\r
54\r
55///\r
56/// HII specific Vendor Device Path definition.\r
57///\r
58typedef struct {\r
59 VENDOR_DEVICE_PATH VendorDevicePath;\r
60 EFI_DEVICE_PATH_PROTOCOL End;\r
61} HII_VENDOR_DEVICE_PATH;\r
62\r
63typedef struct {\r
64 UINTN Signature;\r
65\r
66 ///\r
67 /// Device Manager HII relative handles\r
68 ///\r
69 EFI_HII_HANDLE HiiHandle;\r
70\r
71 EFI_HANDLE DriverHandle;\r
72\r
73 ///\r
74 /// Device Manager Produced protocols\r
75 ///\r
76 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
77\r
78 ///\r
79 /// Configuration data\r
80 ///\r
81 UINT8 VideoBios;\r
82} DEVICE_MANAGER_CALLBACK_DATA;\r
83\r
84typedef struct {\r
85 EFI_STRING_ID PromptId;\r
86 EFI_QUESTION_ID QuestionId;\r
87}MENU_INFO_ITEM;\r
88\r
89typedef struct {\r
90 UINTN CurListLen;\r
91 UINTN MaxListLen;\r
92 MENU_INFO_ITEM *NodeList;\r
93} MAC_ADDRESS_NODE_LIST;\r
94\r
95#define DEVICE_MANAGER_CALLBACK_DATA_FROM_THIS(a) \\r
96 CR (a, \\r
97 DEVICE_MANAGER_CALLBACK_DATA, \\r
98 ConfigAccess, \\r
99 DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE \\r
100 )\r
101typedef struct {\r
102 EFI_STRING_ID StringId;\r
103 UINT16 Class;\r
104} DEVICE_MANAGER_MENU_ITEM;\r
105\r
106/**\r
107 This function allows a caller to extract the current configuration for one\r
108 or more named elements from the target driver.\r
109\r
110\r
111 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
112 @param Request A null-terminated Unicode string in <ConfigRequest> format.\r
113 @param Progress On return, points to a character in the Request string.\r
114 Points to the string's null terminator if request was successful.\r
115 Points to the most recent '&' before the first failing name/value\r
116 pair (or the beginning of the string if the failure is in the\r
117 first name/value pair) if the request was not successful.\r
118 @param Results A null-terminated Unicode string in <ConfigAltResp> format which\r
119 has all values filled in for the names in the Request string.\r
120 String to be allocated by the called function.\r
121\r
122 @retval EFI_SUCCESS The Results is filled with the requested values.\r
123 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
124 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
125 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
126\r
127**/\r
128EFI_STATUS\r
129EFIAPI\r
130DeviceManagerExtractConfig (\r
131 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
132 IN CONST EFI_STRING Request,\r
133 OUT EFI_STRING *Progress,\r
134 OUT EFI_STRING *Results\r
135 );\r
136\r
137/**\r
138 This function processes the results of changes in configuration.\r
139\r
140\r
141 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
142 @param Configuration A null-terminated Unicode string in <ConfigResp> format.\r
143 @param Progress A pointer to a string filled in with the offset of the most\r
144 recent '&' before the first failing name/value pair (or the\r
145 beginning of the string if the failure is in the first\r
146 name/value pair) or the terminating NULL if all was successful.\r
147\r
148 @retval EFI_SUCCESS The Results is processed successfully.\r
149 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
150 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
151\r
152**/\r
153EFI_STATUS\r
154EFIAPI\r
155DeviceManagerRouteConfig (\r
156 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
157 IN CONST EFI_STRING Configuration,\r
158 OUT EFI_STRING *Progress\r
159 );\r
160\r
161/**\r
162 This function is invoked if user selected a interactive opcode from Device Manager's\r
163 Formset. If user set VBIOS, the new value is saved to EFI variable.\r
164\r
165 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
166 @param Action Specifies the type of action taken by the browser.\r
167 @param QuestionId A unique value which is sent to the original exporting driver\r
168 so that it can identify the type of data to expect.\r
169 @param Type The type of value for the question.\r
170 @param Value A pointer to the data being sent to the original exporting driver.\r
171 @param ActionRequest On return, points to the action requested by the callback function.\r
172\r
173 @retval EFI_SUCCESS The callback successfully handled the action.\r
174 @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.\r
175\r
176**/\r
177EFI_STATUS\r
178EFIAPI\r
179DeviceManagerCallback (\r
180 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
181 IN EFI_BROWSER_ACTION Action,\r
182 IN EFI_QUESTION_ID QuestionId,\r
183 IN UINT8 Type,\r
184 IN EFI_IFR_TYPE_VALUE *Value,\r
185 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
186 );\r
187\r
188#endif\r