2 UEFI Component Name protocol for DiskIo driver.
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. 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.
18 // EFI Component Name Protocol
20 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName
= {
21 DiskIoComponentNameGetDriverName
,
22 DiskIoComponentNameGetControllerName
,
27 // EFI Component Name 2 Protocol
29 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gDiskIoComponentName2
= {
30 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) DiskIoComponentNameGetDriverName
,
31 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) DiskIoComponentNameGetControllerName
,
36 static EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable
[] = {
39 (CHAR16
*)L
"Generic Disk I/O Driver"
50 Retrieves a Unicode string that is the user readable name of the driver.
52 This function retrieves the user readable name of a driver in the form of a
53 Unicode string. If the driver specified by This has a user readable name in
54 the language specified by Language, then a pointer to the driver name is
55 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
56 by This does not support the language specified by Language,
57 then EFI_UNSUPPORTED is returned.
59 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
60 EFI_COMPONENT_NAME_PROTOCOL instance.
62 @param Language[in] A pointer to a Null-terminated ASCII string
63 array indicating the language. This is the
64 language of the driver name that the caller is
65 requesting, and it must match one of the
66 languages specified in SupportedLanguages. The
67 number of languages supported by a driver is up
68 to the driver writer. Language is specified
69 in RFC 3066 or ISO 639-2 language code format.
71 @param DriverName[out] A pointer to the Unicode string to return.
72 This Unicode string is the name of the
73 driver specified by This in the language
74 specified by Language.
76 @retval EFI_SUCCESS The Unicode string for the Driver specified by
77 This and the language specified by Language was
78 returned in DriverName.
80 @retval EFI_INVALID_PARAMETER Language is NULL.
82 @retval EFI_INVALID_PARAMETER DriverName is NULL.
84 @retval EFI_UNSUPPORTED The driver specified by This does not support
85 the language specified by Language.
90 DiskIoComponentNameGetDriverName (
91 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
93 OUT CHAR16
**DriverName
96 return LookupUnicodeString2 (
98 This
->SupportedLanguages
,
99 mDiskIoDriverNameTable
,
101 (BOOLEAN
)(This
== &gDiskIoComponentName
)
108 Retrieves a Unicode string that is the user readable name of the controller
109 that is being managed by a driver.
111 This function retrieves the user readable name of the controller specified by
112 ControllerHandle and ChildHandle in the form of a Unicode string. If the
113 driver specified by This has a user readable name in the language specified by
114 Language, then a pointer to the controller name is returned in ControllerName,
115 and EFI_SUCCESS is returned. If the driver specified by This is not currently
116 managing the controller specified by ControllerHandle and ChildHandle,
117 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
118 support the language specified by Language, then EFI_UNSUPPORTED is returned.
120 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
121 EFI_COMPONENT_NAME_PROTOCOL instance.
123 @param ControllerHandle[in] The handle of a controller that the driver
124 specified by This is managing. This handle
125 specifies the controller whose name is to be
128 @param ChildHandle[in] The handle of the child controller to retrieve
129 the name of. This is an optional parameter that
130 may be NULL. It will be NULL for device
131 drivers. It will also be NULL for a bus drivers
132 that wish to retrieve the name of the bus
133 controller. It will not be NULL for a bus
134 driver that wishes to retrieve the name of a
137 @param Language[in] A pointer to a Null-terminated ASCII string
138 array indicating the language. This is the
139 language of the driver name that the caller is
140 requesting, and it must match one of the
141 languages specified in SupportedLanguages. The
142 number of languages supported by a driver is up
143 to the driver writer. Language is specified in
144 RFC 3066 or ISO 639-2 language code format.
146 @param ControllerName[out] A pointer to the Unicode string to return.
147 This Unicode string is the name of the
148 controller specified by ControllerHandle and
149 ChildHandle in the language specified by
150 Language from the point of view of the driver
153 @retval EFI_SUCCESS The Unicode string for the user readable name in
154 the language specified by Language for the
155 driver specified by This was returned in
158 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
160 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
163 @retval EFI_INVALID_PARAMETER Language is NULL.
165 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
167 @retval EFI_UNSUPPORTED The driver specified by This is not currently
168 managing the controller specified by
169 ControllerHandle and ChildHandle.
171 @retval EFI_UNSUPPORTED The driver specified by This does not support
172 the language specified by Language.
177 DiskIoComponentNameGetControllerName (
178 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
179 IN EFI_HANDLE ControllerHandle
,
180 IN EFI_HANDLE ChildHandle OPTIONAL
,
182 OUT CHAR16
**ControllerName
185 return EFI_UNSUPPORTED
;