]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
UiApp code split from IntelFrameworkModulePkg/Universal/BdsDxe driver.
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / DeviceMngr / DeviceManager.h
CommitLineData
143f0b1d
ED
1/** @file\r
2 The platform device manager reference implement\r
3\r
4Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT 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 "Ui.h"\r
19#include "FrontPage.h"\r
20#include <Protocol/PciIo.h>\r
21\r
22//\r
23// These are defined as the same with vfr file\r
24//\r
25#define DEVICE_MANAGER_FORMSET_GUID \\r
26 { \\r
27 0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \\r
28 }\r
29\r
30#define LABEL_DEVICES_LIST 0x1100\r
31#define LABEL_NETWORK_DEVICE_LIST_ID 0x1101\r
32#define LABEL_NETWORK_DEVICE_ID 0x1102\r
33#define LABEL_END 0xffff\r
34#define LABEL_FORM_ID_OFFSET 0x0100\r
35\r
36#define LABEL_VBIOS 0x0040\r
37\r
38#define DEVICE_MANAGER_FORM_ID 0x1000\r
39#define NETWORK_DEVICE_LIST_FORM_ID 0x1001\r
40#define NETWORK_DEVICE_FORM_ID 0x1002\r
41#define DEVICE_KEY_OFFSET 0x4000\r
42#define NETWORK_DEVICE_LIST_KEY_OFFSET 0x2000\r
43#define DEVICE_MANAGER_KEY_VBIOS 0x3000\r
44#define MAX_KEY_SECTION_LEN 0x1000\r
45\r
46#define QUESTION_NETWORK_DEVICE_ID 0x3FFF\r
47//\r
48// These are the VFR compiler generated data representing our VFR data.\r
49//\r
50extern UINT8 DeviceManagerVfrBin[];\r
51\r
52#define DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('D', 'M', 'C', 'B')\r
53\r
54\r
55typedef struct {\r
56 UINTN Signature;\r
57\r
58 ///\r
59 /// Device Manager HII relative handles\r
60 ///\r
61 EFI_HII_HANDLE HiiHandle;\r
62\r
63 EFI_HANDLE DriverHandle;\r
64\r
65 ///\r
66 /// Device Manager Produced protocols\r
67 ///\r
68 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
69\r
70 ///\r
71 /// Configuration data\r
72 ///\r
73 UINT8 VideoBios;\r
74} DEVICE_MANAGER_CALLBACK_DATA;\r
75\r
76typedef struct {\r
77 EFI_STRING_ID PromptId;\r
78 EFI_QUESTION_ID QuestionId;\r
79}MENU_INFO_ITEM;\r
80\r
81typedef struct {\r
82 UINTN CurListLen;\r
83 UINTN MaxListLen;\r
84 MENU_INFO_ITEM *NodeList;\r
85} MAC_ADDRESS_NODE_LIST;\r
86\r
87#define DEVICE_MANAGER_CALLBACK_DATA_FROM_THIS(a) \\r
88 CR (a, \\r
89 DEVICE_MANAGER_CALLBACK_DATA, \\r
90 ConfigAccess, \\r
91 DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE \\r
92 )\r
93typedef struct {\r
94 EFI_STRING_ID StringId;\r
95 UINT16 Class;\r
96} DEVICE_MANAGER_MENU_ITEM;\r
97\r
98/**\r
99 This function is invoked if user selected a interactive opcode from Device Manager's\r
100 Formset. If user set VBIOS, the new value is saved to EFI variable.\r
101\r
102\r
103 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
104 @param Action Specifies the type of action taken by the browser.\r
105 @param QuestionId A unique value which is sent to the original exporting driver\r
106 so that it can identify the type of data to expect.\r
107 @param Type The type of value for the question.\r
108 @param Value A pointer to the data being sent to the original exporting driver.\r
109 @param ActionRequest On return, points to the action requested by the callback function.\r
110\r
111 @retval EFI_SUCCESS The callback successfully handled the action.\r
112 @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.\r
113\r
114**/\r
115EFI_STATUS\r
116EFIAPI\r
117DeviceManagerCallback (\r
118 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
119 IN EFI_BROWSER_ACTION Action,\r
120 IN EFI_QUESTION_ID QuestionId,\r
121 IN UINT8 Type,\r
122 IN EFI_IFR_TYPE_VALUE *Value,\r
123 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
124 );\r
125\r
126/**\r
127 This function registers HII packages to HII database.\r
128\r
129**/\r
130VOID\r
131InitializeDeviceManager (\r
132 VOID\r
133 );\r
134\r
135/**\r
136 Remove the installed packages from the HII Database. \r
137\r
138**/\r
139VOID\r
140FreeDeviceManager(\r
141 VOID\r
142);\r
143\r
144/**\r
145 Dynamic create Hii information for Device Manager.\r
146\r
147 @param NextShowFormId The FormId which need to be show.\r
148\r
149**/\r
150VOID\r
151CreateDeviceManagerForm(\r
152 IN EFI_FORM_ID NextShowFormId\r
153);\r
154\r
155#endif\r