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