2 UEFI Component Name(2) protocol implementation for the generic GOP driver.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/UefiLib.h>
13 extern EFI_COMPONENT_NAME_PROTOCOL mGraphicsOutputComponentName
;
14 extern EFI_COMPONENT_NAME2_PROTOCOL mGraphicsOutputComponentName2
;
17 // Driver name table for GraphicsOutput module.
18 // It is shared by the implementation of ComponentName & ComponentName2 Protocol.
20 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mGraphicsOutputDriverNameTable
[] = {
23 L
"Generic Graphics Output Driver"
32 Retrieves a Unicode string that is the user readable name of the driver.
34 This function retrieves the user readable name of a driver in the form of a
35 Unicode string. If the driver specified by This has a user readable name in
36 the language specified by Language, then a pointer to the driver name is
37 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
38 by This does not support the language specified by Language,
39 then EFI_UNSUPPORTED is returned.
41 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
42 EFI_COMPONENT_NAME_PROTOCOL instance.
44 @param Language[in] A pointer to a Null-terminated ASCII string
45 array indicating the language. This is the
46 language of the driver name that the caller is
47 requesting, and it must match one of the
48 languages specified in SupportedLanguages. The
49 number of languages supported by a driver is up
50 to the driver writer. Language is specified
51 in RFC 4646 or ISO 639-2 language code format.
53 @param DriverName[out] A pointer to the Unicode string to return.
54 This Unicode string is the name of the
55 driver specified by This in the language
56 specified by Language.
58 @retval EFI_SUCCESS The Unicode string for the Driver specified by
59 This and the language specified by Language was
60 returned in DriverName.
62 @retval EFI_INVALID_PARAMETER Language is NULL.
64 @retval EFI_INVALID_PARAMETER DriverName is NULL.
66 @retval EFI_UNSUPPORTED The driver specified by This does not support
67 the language specified by Language.
72 GraphicsOutputComponentNameGetDriverName (
73 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
75 OUT CHAR16
**DriverName
78 return LookupUnicodeString2 (
80 This
->SupportedLanguages
,
81 mGraphicsOutputDriverNameTable
,
83 (BOOLEAN
) (This
== &mGraphicsOutputComponentName
)
88 Retrieves a Unicode string that is the user readable name of the controller
89 that is being managed by a driver.
91 This function retrieves the user readable name of the controller specified by
92 ControllerHandle and ChildHandle in the form of a Unicode string. If the
93 driver specified by This has a user readable name in the language specified by
94 Language, then a pointer to the controller name is returned in ControllerName,
95 and EFI_SUCCESS is returned. If the driver specified by This is not currently
96 managing the controller specified by ControllerHandle and ChildHandle,
97 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
98 support the language specified by Language, then EFI_UNSUPPORTED is returned.
100 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
101 EFI_COMPONENT_NAME_PROTOCOL instance.
103 @param ControllerHandle[in] The handle of a controller that the driver
104 specified by This is managing. This handle
105 specifies the controller whose name is to be
108 @param ChildHandle[in] The handle of the child controller to retrieve
109 the name of. This is an optional parameter that
110 may be NULL. It will be NULL for device
111 drivers. It will also be NULL for a bus drivers
112 that wish to retrieve the name of the bus
113 controller. It will not be NULL for a bus
114 driver that wishes to retrieve the name of a
117 @param Language[in] A pointer to a Null-terminated ASCII string
118 array indicating the language. This is the
119 language of the driver name that the caller is
120 requesting, and it must match one of the
121 languages specified in SupportedLanguages. The
122 number of languages supported by a driver is up
123 to the driver writer. Language is specified in
124 RFC 4646 or ISO 639-2 language code format.
126 @param ControllerName[out] A pointer to the Unicode string to return.
127 This Unicode string is the name of the
128 controller specified by ControllerHandle and
129 ChildHandle in the language specified by
130 Language from the point of view of the driver
133 @retval EFI_SUCCESS The Unicode string for the user readable name in
134 the language specified by Language for the
135 driver specified by This was returned in
138 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
140 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
143 @retval EFI_INVALID_PARAMETER Language is NULL.
145 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
147 @retval EFI_UNSUPPORTED The driver specified by This is not currently
148 managing the controller specified by
149 ControllerHandle and ChildHandle.
151 @retval EFI_UNSUPPORTED The driver specified by This does not support
152 the language specified by Language.
157 GraphicsOutputComponentNameGetControllerName (
158 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
159 IN EFI_HANDLE ControllerHandle
,
160 IN EFI_HANDLE ChildHandle OPTIONAL
,
162 OUT CHAR16
**ControllerName
165 return EFI_UNSUPPORTED
;
169 // EFI Component Name Protocol
171 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mGraphicsOutputComponentName
= {
172 GraphicsOutputComponentNameGetDriverName
,
173 GraphicsOutputComponentNameGetControllerName
,
178 // EFI Component Name 2 Protocol
180 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mGraphicsOutputComponentName2
= {
181 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) GraphicsOutputComponentNameGetDriverName
,
182 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) GraphicsOutputComponentNameGetControllerName
,