]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
4bcd09a1b0bf3e4010ad77e0f01c2ee8ab6f74b4
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / DeviceMngr / DeviceManager.h
1 /** @file
2 The platform device manager reference implement
3
4 Copyright (c) 2004 - 2008, Intel Corporation. <BR>
5 All rights reserved. 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 "Bds.h"
19 #include "FrontPage.h"
20
21 //
22 // These are defined as the same with vfr file
23 //
24 #define DEVICE_MANAGER_FORMSET_GUID \
25 { \
26 0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \
27 }
28
29 #define LABEL_DEVICES_LIST 0x0080
30 #define LABEL_END 0xffff
31
32 #define LABEL_VBIOS 0x0040
33
34 #define DEVICE_MANAGER_FORM_ID 0x1000
35
36 #define DEVICE_KEY_OFFSET 0x1000
37 #define DEVICE_MANAGER_KEY_VBIOS 0x2000
38
39 //
40 // These are the VFR compiler generated data representing our VFR data.
41 //
42 extern UINT8 DeviceManagerVfrBin[];
43
44 #define DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('D', 'M', 'C', 'B')
45
46 typedef struct {
47 UINTN Signature;
48
49 ///
50 /// HII relative handles
51 ///
52 EFI_HII_HANDLE HiiHandle;
53 EFI_HANDLE DriverHandle;
54
55 ///
56 /// Produced protocols
57 ///
58 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
59
60 ///
61 /// Configuration data
62 ///
63 UINT8 VideoBios;
64 } DEVICE_MANAGER_CALLBACK_DATA;
65
66 #define DEVICE_MANAGER_CALLBACK_DATA_FROM_THIS(a) \
67 CR (a, \
68 DEVICE_MANAGER_CALLBACK_DATA, \
69 ConfigAccess, \
70 DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE \
71 )
72 typedef struct {
73 EFI_STRING_ID StringId;
74 UINT16 Class;
75 } DEVICE_MANAGER_MENU_ITEM;
76
77 /**
78 This function is invoked if user selected a iteractive opcode from Device Manager's
79 Formset. The decision by user is saved to gCallbackKey for later processing. If
80 user set VBIOS, the new value is saved to EFI variable.
81
82
83 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
84 @param Action Specifies the type of action taken by the browser.
85 @param QuestionId A unique value which is sent to the original exporting driver
86 so that it can identify the type of data to expect.
87 @param Type The type of value for the question.
88 @param Value A pointer to the data being sent to the original exporting driver.
89 @param ActionRequest On return, points to the action requested by the callback function.
90
91 @retval EFI_SUCCESS The callback successfully handled the action.
92 @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
93
94 **/
95 EFI_STATUS
96 EFIAPI
97 DeviceManagerCallback (
98 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
99 IN EFI_BROWSER_ACTION Action,
100 IN EFI_QUESTION_ID QuestionId,
101 IN UINT8 Type,
102 IN EFI_IFR_TYPE_VALUE *Value,
103 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
104 );
105
106 /**
107
108 This function registers HII packages to HII database.
109
110 @retval EFI_SUCCESS HII packages for the Device Manager were registered successfully.
111 @retval EFI_OUT_OF_RESOURCES HII packages for the Device Manager failed to be registered.
112
113 **/
114 EFI_STATUS
115 InitializeDeviceManager (
116 VOID
117 );
118
119 /**
120
121 Call the browser and display the device manager to allow user
122 to configure the platform.
123
124 This function create the dynamic content for device manager. It includes
125 section header for all class of devices, one-of opcode to set VBIOS.
126
127 @retval EFI_SUCCESS Operation is successful.
128 @retval Other values if failed to clean up the dynamic content from HII
129 database.
130
131 **/
132 EFI_STATUS
133 CallDeviceManager (
134 VOID
135 );
136
137 #endif