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