]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/DiskIo/Dxe/ComponentName.c
added PPI and Protocol definitions needed by porting modules
[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
d8a43975 15//\r
16// Include common header file for this module.\r
17//\r
18#include "CommonHeader.h"\r
19\r
79840ee1 20#include "DiskIo.h"\r
21\r
22//\r
23// EFI Component Name Protocol\r
24//\r
25EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName = {\r
26 DiskIoComponentNameGetDriverName,\r
27 DiskIoComponentNameGetControllerName,\r
28 "eng"\r
29};\r
30\r
31static EFI_UNICODE_STRING_TABLE mDiskIoDriverNameTable[] = {\r
32 {\r
33 "eng",\r
34 (CHAR16 *)L"Generic Disk I/O Driver"\r
35 },\r
36 {\r
37 NULL,\r
38 NULL\r
39 }\r
40};\r
41\r
b9575d60
A
42\r
43\r
44/**\r
45 Retrieves a Unicode string that is the user readable name of\r
46 the EFI Driver.\r
47\r
48 @param This A pointer to the\r
49 EFI_COMPONENT_NAME_PROTOCOL instance.\r
50 \r
51 @param Language A pointer to a Null-terminated ASCII string\r
52 array indicating the language. This is the\r
53 language of the driver name that the caller\r
54 is requesting, and it must match one of the\r
55 languages specified in SupportedLanguages.\r
56 The number of languages supported by a\r
57 driver is up to the driver writer. Language\r
58 is specified in RFC 3066 language code\r
59 format.\r
60 \r
61 @param DriverName A pointer to the Unicode string to return.\r
62 This Unicode string is the name of the\r
63 driver specified by This in the language\r
64 specified by Language.\r
65\r
66 @retval EFI_SUCCESS The Unicode string for the\r
67 Driver specified by This and the\r
68 language specified by Language\r
69 was returned in DriverName.\r
70 \r
71 @retval EFI_INVALID_PARAMETER Language is NULL.\r
72 \r
73 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
74 \r
75 @retval EFI_UNSUPPORTED The driver specified by This\r
76 does not support the language\r
77 specified by Language.\r
78\r
79**/\r
79840ee1 80EFI_STATUS\r
81EFIAPI\r
82DiskIoComponentNameGetDriverName (\r
83 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
84 IN CHAR8 *Language,\r
85 OUT CHAR16 **DriverName\r
86 )\r
79840ee1 87{\r
88 return LookupUnicodeString (\r
89 Language,\r
90 gDiskIoComponentName.SupportedLanguages,\r
91 mDiskIoDriverNameTable,\r
92 DriverName\r
93 );\r
94}\r
95\r
b9575d60
A
96\r
97\r
98/**\r
99 Retrieves a Unicode string that is the user readable name of\r
100 the controller that is being managed by an EFI Driver.\r
101\r
102 @param This A pointer to the\r
103 EFI_COMPONENT_NAME_PROTOCOL instance.\r
104\r
105 @param ControllerHandle The handle of a controller that the\r
106 driver specified by This is managing.\r
107 This handle specifies the controller\r
108 whose name is to be returned.\r
109\r
110 @param ChildHandle The handle of the child controller to\r
111 retrieve the name of. This is an\r
112 optional parameter that may be NULL.\r
113 It will be NULL for device drivers.\r
114 It will also be NULL for a bus\r
115 drivers that wish to retrieve the\r
116 name of the bus controller. It will\r
117 not be NULL for a bus driver that\r
118 wishes to retrieve the name of a\r
119 child controller.\r
120\r
121 @param Language A pointer to a Null-terminated ASCII\r
122 string array indicating the language.\r
123 This is the language of the driver\r
124 name that the caller is requesting,\r
125 and it must match one of the\r
126 languages specified in\r
127 SupportedLanguages. The number of\r
128 languages supported by a driver is up\r
129 to the driver writer. Language is\r
130 specified in RFC 3066 language code\r
131 format.\r
132\r
133 @param ControllerName A pointer to the Unicode string to\r
134 return. This Unicode string is the\r
135 name of the controller specified by\r
136 ControllerHandle and ChildHandle in\r
137 the language specified by Language\r
138 from the point of view of the driver\r
139 specified by This.\r
140\r
141 @retval EFI_SUCCESS The Unicode string for the user\r
142 readable name in the language\r
143 specified by Language for the\r
144 driver specified by This was\r
145 returned in DriverName.\r
146\r
147 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\r
148 EFI_HANDLE.\r
149\r
150 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it\r
151 is not a valid EFI_HANDLE.\r
152\r
153 @retval EFI_INVALID_PARAMETER Language is NULL.\r
154\r
155 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
156\r
157 @retval EFI_UNSUPPORTED The driver specified by This is\r
158 not currently managing the\r
159 controller specified by\r
160 ControllerHandle and\r
161 ChildHandle.\r
162\r
163 @retval EFI_UNSUPPORTED The driver specified by This\r
164 does not support the language\r
165 specified by Language.\r
166\r
167**/\r
79840ee1 168EFI_STATUS\r
169EFIAPI\r
170DiskIoComponentNameGetControllerName (\r
171 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
172 IN EFI_HANDLE ControllerHandle,\r
173 IN EFI_HANDLE ChildHandle OPTIONAL,\r
174 IN CHAR8 *Language,\r
175 OUT CHAR16 **ControllerName\r
176 )\r
79840ee1 177{\r
178 return EFI_UNSUPPORTED;\r
179}\r