2 UEFI Component Name(2) protocol implementation for IsaBusDxe driver.
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 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
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.
15 #include "ComponentName.h"
16 #include <Library/UefiLib.h>
21 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable
[] = {
22 { "eng;en", L
"PI ISA BUS Driver" },
27 // EFI Component Name Protocol
29 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIsaBusComponentName
= {
30 IsaBusComponentNameGetDriverName
,
31 IsaBusComponentNameGetControllerName
,
36 // EFI Component Name 2 Protocol
38 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIsaBusComponentName2
= {
39 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) IsaBusComponentNameGetDriverName
,
40 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) IsaBusComponentNameGetControllerName
,
45 Retrieves a Unicode string that is the user readable name of the driver.
47 This function retrieves the user readable name of a driver in the form of a
48 Unicode string. If the driver specified by This has a user readable name in
49 the language specified by Language, then a pointer to the driver name is
50 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
51 by This does not support the language specified by Language,
52 then EFI_UNSUPPORTED is returned.
54 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
55 EFI_COMPONENT_NAME_PROTOCOL instance.
57 @param Language[in] A pointer to a Null-terminated ASCII string
58 array indicating the language. This is the
59 language of the driver name that the caller is
60 requesting, and it must match one of the
61 languages specified in SupportedLanguages. The
62 number of languages supported by a driver is up
63 to the driver writer. Language is specified
64 in RFC 4646 or ISO 639-2 language code format.
66 @param DriverName[out] A pointer to the Unicode string to return.
67 This Unicode string is the name of the
68 driver specified by This in the language
69 specified by Language.
71 @retval EFI_SUCCESS The Unicode string for the Driver specified by
72 This and the language specified by Language was
73 returned in DriverName.
75 @retval EFI_INVALID_PARAMETER Language is NULL.
77 @retval EFI_INVALID_PARAMETER DriverName is NULL.
79 @retval EFI_UNSUPPORTED The driver specified by This does not support
80 the language specified by Language.
85 IsaBusComponentNameGetDriverName (
86 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
88 OUT CHAR16
**DriverName
91 return LookupUnicodeString2 (
93 This
->SupportedLanguages
,
94 mIsaBusDriverNameTable
,
96 (BOOLEAN
)(This
== &gIsaBusComponentName
)
102 Retrieves a Unicode string that is the user readable name of the controller
103 that is being managed by a driver.
105 This function retrieves the user readable name of the controller specified by
106 ControllerHandle and ChildHandle in the form of a Unicode string. If the
107 driver specified by This has a user readable name in the language specified by
108 Language, then a pointer to the controller name is returned in ControllerName,
109 and EFI_SUCCESS is returned. If the driver specified by This is not currently
110 managing the controller specified by ControllerHandle and ChildHandle,
111 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
112 support the language specified by Language, then EFI_UNSUPPORTED is returned.
114 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
115 EFI_COMPONENT_NAME_PROTOCOL instance.
117 @param ControllerHandle[in] The handle of a controller that the driver
118 specified by This is managing. This handle
119 specifies the controller whose name is to be
122 @param ChildHandle[in] The handle of the child controller to retrieve
123 the name of. This is an optional parameter that
124 may be NULL. It will be NULL for device
125 drivers. It will also be NULL for a bus drivers
126 that wish to retrieve the name of the bus
127 controller. It will not be NULL for a bus
128 driver that wishes to retrieve the name of a
131 @param Language[in] A pointer to a Null-terminated ASCII string
132 array indicating the language. This is the
133 language of the driver name that the caller is
134 requesting, and it must match one of the
135 languages specified in SupportedLanguages. The
136 number of languages supported by a driver is up
137 to the driver writer. Language is specified in
138 RFC 4646 or ISO 639-2 language code format.
140 @param ControllerName[out] A pointer to the Unicode string to return.
141 This Unicode string is the name of the
142 controller specified by ControllerHandle and
143 ChildHandle in the language specified by
144 Language from the point of view of the driver
147 @retval EFI_SUCCESS The Unicode string for the user readable name in
148 the language specified by Language for the
149 driver specified by This was returned in
152 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
154 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
157 @retval EFI_INVALID_PARAMETER Language is NULL.
159 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
161 @retval EFI_UNSUPPORTED The driver specified by This is not currently
162 managing the controller specified by
163 ControllerHandle and ChildHandle.
165 @retval EFI_UNSUPPORTED The driver specified by This does not support
166 the language specified by Language.
171 IsaBusComponentNameGetControllerName (
172 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
173 IN EFI_HANDLE ControllerHandle
,
174 IN EFI_HANDLE ChildHandle OPTIONAL
,
176 OUT CHAR16
**ControllerName
179 return EFI_UNSUPPORTED
;