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
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.
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>
42 // Driver Binding Externs
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
;
56 } CONPLATFORM_VAR_OPERATION
;
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
68 ConPlatformTextInDriverBindingSupported (
69 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
71 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
76 ConPlatformTextOutDriverBindingSupported (
77 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
79 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
84 ConPlatformTextInDriverBindingStart (
85 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
87 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
92 ConPlatformTextOutDriverBindingStart (
93 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
95 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
100 ConPlatformTextInDriverBindingStop (
101 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
102 IN EFI_HANDLE Handle
,
103 IN UINTN NumberOfChildren
,
104 IN EFI_HANDLE
*ChildHandleBuffer
109 ConPlatformTextOutDriverBindingStop (
110 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
111 IN EFI_HANDLE Handle
,
112 IN UINTN NumberOfChildren
,
113 IN EFI_HANDLE
*ChildHandleBuffer
117 ConPlatformUnInstallProtocol (
118 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
119 IN EFI_HANDLE Handle
,
120 IN EFI_GUID
*ProtocolGuid
124 ConPlatformGetVariable (
129 ConPlatformMatchDevicePaths (
130 IN EFI_DEVICE_PATH_PROTOCOL
* Multi
,
131 IN EFI_DEVICE_PATH_PROTOCOL
* Single
,
132 IN EFI_DEVICE_PATH_PROTOCOL
**NewDevicePath OPTIONAL
,
137 ConPlatformUpdateDeviceVariable (
138 IN CHAR16
*VariableName
,
139 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
140 IN CONPLATFORM_VAR_OPERATION Operation
145 EFI_HANDLE DriverBindingHandle
,
146 EFI_HANDLE ControllerHandle
150 // EFI Component Name Functions
153 Retrieves a Unicode string that is the user readable name of the driver.
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.
162 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
163 EFI_COMPONENT_NAME_PROTOCOL instance.
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.
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.
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.
183 @retval EFI_INVALID_PARAMETER Language is NULL.
185 @retval EFI_INVALID_PARAMETER DriverName is NULL.
187 @retval EFI_UNSUPPORTED The driver specified by This does not support
188 the language specified by Language.
193 ConPlatformComponentNameGetDriverName (
194 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
196 OUT CHAR16
**DriverName
201 Retrieves a Unicode string that is the user readable name of the controller
202 that is being managed by a driver.
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.
213 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
214 EFI_COMPONENT_NAME_PROTOCOL instance.
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
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
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.
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
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
251 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
253 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
256 @retval EFI_INVALID_PARAMETER Language is NULL.
258 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
260 @retval EFI_UNSUPPORTED The driver specified by This is not currently
261 managing the controller specified by
262 ControllerHandle and ChildHandle.
264 @retval EFI_UNSUPPORTED The driver specified by This does not support
265 the language specified by Language.
270 ConPlatformComponentNameGetControllerName (
271 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
272 IN EFI_HANDLE ControllerHandle
,
273 IN EFI_HANDLE ChildHandle OPTIONAL
,
275 OUT CHAR16
**ControllerName