2 UEFI Component Name(2) protocol implementation for DiskIo driver.
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
12 // EFI Component Name Protocol
14 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName
= {
15 DiskIoComponentNameGetDriverName
,
16 DiskIoComponentNameGetControllerName
,
21 // EFI Component Name 2 Protocol
23 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gDiskIoComponentName2
= {
24 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) DiskIoComponentNameGetDriverName
,
25 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) DiskIoComponentNameGetControllerName
,
30 // Driver name table for DiskIo module.
31 // It is shared by the implementation of ComponentName & ComponentName2 Protocol.
33 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable
[] = {
36 (CHAR16
*)L
"Generic Disk I/O Driver"
47 Retrieves a Unicode string that is the user readable name of the driver.
49 This function retrieves the user readable name of a driver in the form of a
50 Unicode string. If the driver specified by This has a user readable name in
51 the language specified by Language, then a pointer to the driver name is
52 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
53 by This does not support the language specified by Language,
54 then EFI_UNSUPPORTED is returned.
56 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
57 EFI_COMPONENT_NAME_PROTOCOL instance.
59 @param Language[in] A pointer to a Null-terminated ASCII string
60 array indicating the language. This is the
61 language of the driver name that the caller is
62 requesting, and it must match one of the
63 languages specified in SupportedLanguages. The
64 number of languages supported by a driver is up
65 to the driver writer. Language is specified
66 in RFC 4646 or ISO 639-2 language code format.
68 @param DriverName[out] A pointer to the Unicode string to return.
69 This Unicode string is the name of the
70 driver specified by This in the language
71 specified by Language.
73 @retval EFI_SUCCESS The Unicode string for the Driver specified by
74 This and the language specified by Language was
75 returned in DriverName.
77 @retval EFI_INVALID_PARAMETER Language is NULL.
79 @retval EFI_INVALID_PARAMETER DriverName is NULL.
81 @retval EFI_UNSUPPORTED The driver specified by This does not support
82 the language specified by Language.
87 DiskIoComponentNameGetDriverName (
88 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
90 OUT CHAR16
**DriverName
93 return LookupUnicodeString2 (
95 This
->SupportedLanguages
,
96 mDiskIoDriverNameTable
,
98 (BOOLEAN
)(This
== &gDiskIoComponentName
)
105 Retrieves a Unicode string that is the user readable name of the controller
106 that is being managed by a driver.
108 This function retrieves the user readable name of the controller specified by
109 ControllerHandle and ChildHandle in the form of a Unicode string. If the
110 driver specified by This has a user readable name in the language specified by
111 Language, then a pointer to the controller name is returned in ControllerName,
112 and EFI_SUCCESS is returned. If the driver specified by This is not currently
113 managing the controller specified by ControllerHandle and ChildHandle,
114 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
115 support the language specified by Language, then EFI_UNSUPPORTED is returned.
117 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
118 EFI_COMPONENT_NAME_PROTOCOL instance.
120 @param ControllerHandle[in] The handle of a controller that the driver
121 specified by This is managing. This handle
122 specifies the controller whose name is to be
125 @param ChildHandle[in] The handle of the child controller to retrieve
126 the name of. This is an optional parameter that
127 may be NULL. It will be NULL for device
128 drivers. It will also be NULL for a bus drivers
129 that wish to retrieve the name of the bus
130 controller. It will not be NULL for a bus
131 driver that wishes to retrieve the name of a
134 @param Language[in] A pointer to a Null-terminated ASCII string
135 array indicating the language. This is the
136 language of the driver name that the caller is
137 requesting, and it must match one of the
138 languages specified in SupportedLanguages. The
139 number of languages supported by a driver is up
140 to the driver writer. Language is specified in
141 RFC 4646 or ISO 639-2 language code format.
143 @param ControllerName[out] A pointer to the Unicode string to return.
144 This Unicode string is the name of the
145 controller specified by ControllerHandle and
146 ChildHandle in the language specified by
147 Language from the point of view of the driver
150 @retval EFI_SUCCESS The Unicode string for the user readable name in
151 the language specified by Language for the
152 driver specified by This was returned in
155 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
157 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
160 @retval EFI_INVALID_PARAMETER Language is NULL.
162 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
164 @retval EFI_UNSUPPORTED The driver specified by This is not currently
165 managing the controller specified by
166 ControllerHandle and ChildHandle.
168 @retval EFI_UNSUPPORTED The driver specified by This does not support
169 the language specified by Language.
174 DiskIoComponentNameGetControllerName (
175 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
176 IN EFI_HANDLE ControllerHandle
,
177 IN EFI_HANDLE ChildHandle OPTIONAL
,
179 OUT CHAR16
**ControllerName
182 return EFI_UNSUPPORTED
;