]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h
Update to support to produce Component Name and & Component Name 2 protocol based...
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ConPlatform.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 ConPlatform.h
15
16 Abstract:
17
18 --*/
19
20 #ifndef CON_MANAGE_H_
21 #define CON_MANAGE_H_
22
23 #include <Uefi.h>
24 #include <Protocol/SimpleTextOut.h>
25 #include <Guid/GlobalVariable.h>
26 #include <Guid/ConsoleInDevice.h>
27 #include <Protocol/DevicePath.h>
28 #include <Protocol/SimpleTextIn.h>
29 #include <Guid/HotPlugDevice.h>
30 #include <Guid/StandardErrorDevice.h>
31 #include <Guid/ConsoleOutDevice.h>
32 #include <Library/DebugLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/UefiLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/UefiBootServicesTableLib.h>
37 #include <Library/UefiRuntimeServicesTableLib.h>
38 #include <Library/DevicePathLib.h>
39 #include <Library/MemoryAllocationLib.h>
40
41 //
42 // Driver Binding Externs
43 //
44 extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding;
45 extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;
46 extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;
47 extern EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding;
48 extern EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName;
49 extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;
50
51
52 typedef enum {
53 CHECK,
54 APPEND,
55 DELETE
56 } CONPLATFORM_VAR_OPERATION;
57
58 EFI_STATUS
59 ConPlatformDriverBindingSupported (
60 IN EFI_DRIVER_BINDING_PROTOCOL *This,
61 IN EFI_HANDLE ControllerHandle,
62 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,
63 IN EFI_GUID *ProtocolGuid
64 );
65
66 EFI_STATUS
67 EFIAPI
68 ConPlatformTextInDriverBindingSupported (
69 IN EFI_DRIVER_BINDING_PROTOCOL *This,
70 IN EFI_HANDLE Handle,
71 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
72 );
73
74 EFI_STATUS
75 EFIAPI
76 ConPlatformTextOutDriverBindingSupported (
77 IN EFI_DRIVER_BINDING_PROTOCOL *This,
78 IN EFI_HANDLE Handle,
79 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
80 );
81
82 EFI_STATUS
83 EFIAPI
84 ConPlatformTextInDriverBindingStart (
85 IN EFI_DRIVER_BINDING_PROTOCOL *This,
86 IN EFI_HANDLE Handle,
87 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
88 );
89
90 EFI_STATUS
91 EFIAPI
92 ConPlatformTextOutDriverBindingStart (
93 IN EFI_DRIVER_BINDING_PROTOCOL *This,
94 IN EFI_HANDLE Handle,
95 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
96 );
97
98 EFI_STATUS
99 EFIAPI
100 ConPlatformTextInDriverBindingStop (
101 IN EFI_DRIVER_BINDING_PROTOCOL *This,
102 IN EFI_HANDLE Handle,
103 IN UINTN NumberOfChildren,
104 IN EFI_HANDLE *ChildHandleBuffer
105 );
106
107 EFI_STATUS
108 EFIAPI
109 ConPlatformTextOutDriverBindingStop (
110 IN EFI_DRIVER_BINDING_PROTOCOL *This,
111 IN EFI_HANDLE Handle,
112 IN UINTN NumberOfChildren,
113 IN EFI_HANDLE *ChildHandleBuffer
114 );
115
116 VOID
117 ConPlatformUnInstallProtocol (
118 IN EFI_DRIVER_BINDING_PROTOCOL *This,
119 IN EFI_HANDLE Handle,
120 IN EFI_GUID *ProtocolGuid
121 );
122
123 VOID *
124 ConPlatformGetVariable (
125 IN CHAR16 *Name
126 );
127
128 EFI_STATUS
129 ConPlatformMatchDevicePaths (
130 IN EFI_DEVICE_PATH_PROTOCOL * Multi,
131 IN EFI_DEVICE_PATH_PROTOCOL * Single,
132 IN EFI_DEVICE_PATH_PROTOCOL **NewDevicePath OPTIONAL,
133 IN BOOLEAN Delete
134 );
135
136 EFI_STATUS
137 ConPlatformUpdateDeviceVariable (
138 IN CHAR16 *VariableName,
139 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
140 IN CONPLATFORM_VAR_OPERATION Operation
141 );
142
143 BOOLEAN
144 IsHotPlugDevice (
145 EFI_HANDLE DriverBindingHandle,
146 EFI_HANDLE ControllerHandle
147 );
148
149 //
150 // EFI Component Name Functions
151 //
152 /**
153 Retrieves a Unicode string that is the user readable name of the driver.
154
155 This function retrieves the user readable name of a driver in the form of a
156 Unicode string. If the driver specified by This has a user readable name in
157 the language specified by Language, then a pointer to the driver name is
158 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
159 by This does not support the language specified by Language,
160 then EFI_UNSUPPORTED is returned.
161
162 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
163 EFI_COMPONENT_NAME_PROTOCOL instance.
164
165 @param Language[in] A pointer to a Null-terminated ASCII string
166 array indicating the language. This is the
167 language of the driver name that the caller is
168 requesting, and it must match one of the
169 languages specified in SupportedLanguages. The
170 number of languages supported by a driver is up
171 to the driver writer. Language is specified
172 in RFC 3066 or ISO 639-2 language code format.
173
174 @param DriverName[out] A pointer to the Unicode string to return.
175 This Unicode string is the name of the
176 driver specified by This in the language
177 specified by Language.
178
179 @retval EFI_SUCCESS The Unicode string for the Driver specified by
180 This and the language specified by Language was
181 returned in DriverName.
182
183 @retval EFI_INVALID_PARAMETER Language is NULL.
184
185 @retval EFI_INVALID_PARAMETER DriverName is NULL.
186
187 @retval EFI_UNSUPPORTED The driver specified by This does not support
188 the language specified by Language.
189
190 **/
191 EFI_STATUS
192 EFIAPI
193 ConPlatformComponentNameGetDriverName (
194 IN EFI_COMPONENT_NAME_PROTOCOL *This,
195 IN CHAR8 *Language,
196 OUT CHAR16 **DriverName
197 );
198
199
200 /**
201 Retrieves a Unicode string that is the user readable name of the controller
202 that is being managed by a driver.
203
204 This function retrieves the user readable name of the controller specified by
205 ControllerHandle and ChildHandle in the form of a Unicode string. If the
206 driver specified by This has a user readable name in the language specified by
207 Language, then a pointer to the controller name is returned in ControllerName,
208 and EFI_SUCCESS is returned. If the driver specified by This is not currently
209 managing the controller specified by ControllerHandle and ChildHandle,
210 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
211 support the language specified by Language, then EFI_UNSUPPORTED is returned.
212
213 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
214 EFI_COMPONENT_NAME_PROTOCOL instance.
215
216 @param ControllerHandle[in] The handle of a controller that the driver
217 specified by This is managing. This handle
218 specifies the controller whose name is to be
219 returned.
220
221 @param ChildHandle[in] The handle of the child controller to retrieve
222 the name of. This is an optional parameter that
223 may be NULL. It will be NULL for device
224 drivers. It will also be NULL for a bus drivers
225 that wish to retrieve the name of the bus
226 controller. It will not be NULL for a bus
227 driver that wishes to retrieve the name of a
228 child controller.
229
230 @param Language[in] A pointer to a Null-terminated ASCII string
231 array indicating the language. This is the
232 language of the driver name that the caller is
233 requesting, and it must match one of the
234 languages specified in SupportedLanguages. The
235 number of languages supported by a driver is up
236 to the driver writer. Language is specified in
237 RFC 3066 or ISO 639-2 language code format.
238
239 @param ControllerName[out] A pointer to the Unicode string to return.
240 This Unicode string is the name of the
241 controller specified by ControllerHandle and
242 ChildHandle in the language specified by
243 Language from the point of view of the driver
244 specified by This.
245
246 @retval EFI_SUCCESS The Unicode string for the user readable name in
247 the language specified by Language for the
248 driver specified by This was returned in
249 DriverName.
250
251 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
252
253 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
254 EFI_HANDLE.
255
256 @retval EFI_INVALID_PARAMETER Language is NULL.
257
258 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
259
260 @retval EFI_UNSUPPORTED The driver specified by This is not currently
261 managing the controller specified by
262 ControllerHandle and ChildHandle.
263
264 @retval EFI_UNSUPPORTED The driver specified by This does not support
265 the language specified by Language.
266
267 **/
268 EFI_STATUS
269 EFIAPI
270 ConPlatformComponentNameGetControllerName (
271 IN EFI_COMPONENT_NAME_PROTOCOL *This,
272 IN EFI_HANDLE ControllerHandle,
273 IN EFI_HANDLE ChildHandle OPTIONAL,
274 IN CHAR8 *Language,
275 OUT CHAR16 **ControllerName
276 );
277
278
279 #endif