3 Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
4 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
20 // EFI Component Name Functions
24 EmuGopComponentNameGetDriverName (
25 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
27 OUT CHAR16
**DriverName
32 EmuGopComponentNameGetControllerName (
33 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
34 IN EFI_HANDLE ControllerHandle
,
35 IN EFI_HANDLE ChildHandle OPTIONAL
,
37 OUT CHAR16
**ControllerName
41 // EFI Component Name Protocol
43 EFI_COMPONENT_NAME_PROTOCOL gEmuGopComponentName
= {
44 EmuGopComponentNameGetDriverName
,
45 EmuGopComponentNameGetControllerName
,
50 // EFI Component Name 2 Protocol
52 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gEmuGopComponentName2
= {
53 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
)EmuGopComponentNameGetDriverName
,
54 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
)EmuGopComponentNameGetControllerName
,
58 EFI_UNICODE_STRING_TABLE mEmuGopDriverNameTable
[] = {
59 { "eng", L
"Emulator GOP Driver" },
64 Retrieves a Unicode string that is the user readable name of the driver.
66 This function retrieves the user readable name of a driver in the form of a
67 Unicode string. If the driver specified by This has a user readable name in
68 the language specified by Language, then a pointer to the driver name is
69 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
70 by This does not support the language specified by Language,
71 then EFI_UNSUPPORTED is returned.
73 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
74 EFI_COMPONENT_NAME_PROTOCOL instance.
76 @param Language[in] A pointer to a Null-terminated ASCII string
77 array indicating the language. This is the
78 language of the driver name that the caller is
79 requesting, and it must match one of the
80 languages specified in SupportedLanguages. The
81 number of languages supported by a driver is up
82 to the driver writer. Language is specified
83 in RFC 4646 or ISO 639-2 language code format.
85 @param DriverName[out] A pointer to the Unicode string to return.
86 This Unicode string is the name of the
87 driver specified by This in the language
88 specified by Language.
90 @retval EFI_SUCCESS The Unicode string for the Driver specified by
91 This and the language specified by Language was
92 returned in DriverName.
94 @retval EFI_INVALID_PARAMETER Language is NULL.
96 @retval EFI_INVALID_PARAMETER DriverName is NULL.
98 @retval EFI_UNSUPPORTED The driver specified by This does not support
99 the language specified by Language.
104 EmuGopComponentNameGetDriverName (
105 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
107 OUT CHAR16
**DriverName
110 return LookupUnicodeString2 (
112 This
->SupportedLanguages
,
113 mEmuGopDriverNameTable
,
115 (BOOLEAN
)(This
== &gEmuGopComponentName
)
120 Retrieves a Unicode string that is the user readable name of the controller
121 that is being managed by a driver.
123 This function retrieves the user readable name of the controller specified by
124 ControllerHandle and ChildHandle in the form of a Unicode string. If the
125 driver specified by This has a user readable name in the language specified by
126 Language, then a pointer to the controller name is returned in ControllerName,
127 and EFI_SUCCESS is returned. If the driver specified by This is not currently
128 managing the controller specified by ControllerHandle and ChildHandle,
129 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
130 support the language specified by Language, then EFI_UNSUPPORTED is returned.
132 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
133 EFI_COMPONENT_NAME_PROTOCOL instance.
135 @param ControllerHandle[in] The handle of a controller that the driver
136 specified by This is managing. This handle
137 specifies the controller whose name is to be
140 @param ChildHandle[in] The handle of the child controller to retrieve
141 the name of. This is an optional parameter that
142 may be NULL. It will be NULL for device
143 drivers. It will also be NULL for a bus drivers
144 that wish to retrieve the name of the bus
145 controller. It will not be NULL for a bus
146 driver that wishes to retrieve the name of a
149 @param Language[in] A pointer to a Null-terminated ASCII string
150 array indicating the language. This is the
151 language of the driver name that the caller is
152 requesting, and it must match one of the
153 languages specified in SupportedLanguages. The
154 number of languages supported by a driver is up
155 to the driver writer. Language is specified in
156 RFC 4646 or ISO 639-2 language code format.
158 @param ControllerName[out] A pointer to the Unicode string to return.
159 This Unicode string is the name of the
160 controller specified by ControllerHandle and
161 ChildHandle in the language specified by
162 Language from the point of view of the driver
165 @retval EFI_SUCCESS The Unicode string for the user readable name in
166 the language specified by Language for the
167 driver specified by This was returned in
170 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
172 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
175 @retval EFI_INVALID_PARAMETER Language is NULL.
177 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
179 @retval EFI_UNSUPPORTED The driver specified by This is not currently
180 managing the controller specified by
181 ControllerHandle and ChildHandle.
183 @retval EFI_UNSUPPORTED The driver specified by This does not support
184 the language specified by Language.
189 EmuGopComponentNameGetControllerName (
190 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
191 IN EFI_HANDLE ControllerHandle
,
192 IN EFI_HANDLE ChildHandle OPTIONAL
,
194 OUT CHAR16
**ControllerName
197 return EFI_UNSUPPORTED
;