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