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