]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/DiskIoDxe/ComponentName.c
Update all files to follow doxygen style file header.
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / DiskIoDxe / ComponentName.c
CommitLineData
adbcbf8f 1/** @file\r
f42be642 2 UEFI Component Name(2) protocol implementation for DiskIo driver.\r
adbcbf8f 3\r
f42be642 4Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
adbcbf8f 12\r
13**/\r
14\r
15#include "DiskIo.h"\r
16\r
17//\r
18// EFI Component Name Protocol\r
19//\r
1307dcd7 20GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName = {\r
adbcbf8f 21 DiskIoComponentNameGetDriverName,\r
22 DiskIoComponentNameGetControllerName,\r
23 "eng"\r
1307dcd7 24};\r
d38a0f44 25\r
26//\r
27// EFI Component Name 2 Protocol\r
28//\r
1307dcd7 29GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gDiskIoComponentName2 = {\r
d38a0f44 30 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DiskIoComponentNameGetDriverName,\r
31 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DiskIoComponentNameGetControllerName,\r
32 "en"\r
1307dcd7 33};\r
d38a0f44 34\r
adbcbf8f 35\r
d1aeb0bd 36GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable[] = {\r
adbcbf8f 37 {\r
d38a0f44 38 "eng;en",\r
adbcbf8f 39 (CHAR16 *)L"Generic Disk I/O Driver"\r
40 },\r
41 {\r
42 NULL,\r
43 NULL\r
44 }\r
45};\r
46\r
47\r
48\r
49/**\r
d38a0f44 50 Retrieves a Unicode string that is the user readable name of the driver.\r
51\r
52 This function retrieves the user readable name of a driver in the form of a\r
53 Unicode string. If the driver specified by This has a user readable name in\r
54 the language specified by Language, then a pointer to the driver name is\r
55 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
56 by This does not support the language specified by Language,\r
57 then EFI_UNSUPPORTED is returned.\r
58\r
59 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
60 EFI_COMPONENT_NAME_PROTOCOL instance.\r
61\r
62 @param Language[in] A pointer to a Null-terminated ASCII string\r
63 array indicating the language. This is the\r
64 language of the driver name that the caller is\r
65 requesting, and it must match one of the\r
66 languages specified in SupportedLanguages. The\r
67 number of languages supported by a driver is up\r
68 to the driver writer. Language is specified\r
69 in RFC 3066 or ISO 639-2 language code format.\r
70\r
71 @param DriverName[out] A pointer to the Unicode string to return.\r
72 This Unicode string is the name of the\r
73 driver specified by This in the language\r
74 specified by Language.\r
75\r
76 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
77 This and the language specified by Language was\r
78 returned in DriverName.\r
adbcbf8f 79\r
adbcbf8f 80 @retval EFI_INVALID_PARAMETER Language is NULL.\r
d38a0f44 81\r
adbcbf8f 82 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
d38a0f44 83\r
84 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
85 the language specified by Language.\r
adbcbf8f 86\r
87**/\r
88EFI_STATUS\r
89EFIAPI\r
90DiskIoComponentNameGetDriverName (\r
91 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
92 IN CHAR8 *Language,\r
93 OUT CHAR16 **DriverName\r
94 )\r
95{\r
d38a0f44 96 return LookupUnicodeString2 (\r
adbcbf8f 97 Language,\r
d38a0f44 98 This->SupportedLanguages,\r
adbcbf8f 99 mDiskIoDriverNameTable,\r
d38a0f44 100 DriverName,\r
101 (BOOLEAN)(This == &gDiskIoComponentName)\r
adbcbf8f 102 );\r
103}\r
104\r
105\r
106\r
107/**\r
d38a0f44 108 Retrieves a Unicode string that is the user readable name of the controller\r
109 that is being managed by a driver.\r
110\r
111 This function retrieves the user readable name of the controller specified by\r
112 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
113 driver specified by This has a user readable name in the language specified by\r
114 Language, then a pointer to the controller name is returned in ControllerName,\r
115 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
116 managing the controller specified by ControllerHandle and ChildHandle,\r
117 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
118 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
119\r
120 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
121 EFI_COMPONENT_NAME_PROTOCOL instance.\r
122\r
123 @param ControllerHandle[in] The handle of a controller that the driver\r
124 specified by This is managing. This handle\r
125 specifies the controller whose name is to be\r
126 returned.\r
127\r
128 @param ChildHandle[in] The handle of the child controller to retrieve\r
129 the name of. This is an optional parameter that\r
130 may be NULL. It will be NULL for device\r
131 drivers. It will also be NULL for a bus drivers\r
132 that wish to retrieve the name of the bus\r
133 controller. It will not be NULL for a bus\r
134 driver that wishes to retrieve the name of a\r
135 child controller.\r
136\r
137 @param Language[in] A pointer to a Null-terminated ASCII string\r
138 array indicating the language. This is the\r
139 language of the driver name that the caller is\r
140 requesting, and it must match one of the\r
141 languages specified in SupportedLanguages. The\r
142 number of languages supported by a driver is up\r
143 to the driver writer. Language is specified in\r
144 RFC 3066 or ISO 639-2 language code format.\r
145\r
146 @param ControllerName[out] A pointer to the Unicode string to return.\r
147 This Unicode string is the name of the\r
148 controller specified by ControllerHandle and\r
149 ChildHandle in the language specified by\r
150 Language from the point of view of the driver\r
151 specified by This.\r
152\r
153 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
154 the language specified by Language for the\r
155 driver specified by This was returned in\r
156 DriverName.\r
157\r
158 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
159\r
160 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
adbcbf8f 161 EFI_HANDLE.\r
162\r
adbcbf8f 163 @retval EFI_INVALID_PARAMETER Language is NULL.\r
164\r
165 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
166\r
d38a0f44 167 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
168 managing the controller specified by\r
169 ControllerHandle and ChildHandle.\r
adbcbf8f 170\r
d38a0f44 171 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
172 the language specified by Language.\r
adbcbf8f 173\r
174**/\r
175EFI_STATUS\r
176EFIAPI\r
177DiskIoComponentNameGetControllerName (\r
178 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
179 IN EFI_HANDLE ControllerHandle,\r
180 IN EFI_HANDLE ChildHandle OPTIONAL,\r
181 IN CHAR8 *Language,\r
182 OUT CHAR16 **ControllerName\r
183 )\r
184{\r
185 return EFI_UNSUPPORTED;\r
186}\r