]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/Partition/Dxe/ComponentName.c
added PPI and Protocol definitions needed by porting modules
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / Partition / Dxe / ComponentName.c
CommitLineData
b9575d60
A
1/** @file\r
2 UEFI Component Name protocol for Partition 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 "Partition.h"\r
21\r
22//\r
23// EFI Component Name Protocol\r
24//\r
25EFI_COMPONENT_NAME_PROTOCOL gPartitionComponentName = {\r
26 PartitionComponentNameGetDriverName,\r
27 PartitionComponentNameGetControllerName,\r
28 "eng"\r
29};\r
30\r
31static EFI_UNICODE_STRING_TABLE mPartitionDriverNameTable[] = {\r
32 {\r
33 "eng",\r
34 (CHAR16 *)L"Partition Driver(MBR/GPT/El Torito)"\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
82PartitionComponentNameGetDriverName (\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 gPartitionComponentName.SupportedLanguages,\r
91 mPartitionDriverNameTable,\r
92 DriverName\r
93 );\r
94}\r
95\r
b9575d60
A
96\r
97/**\r
98 Retrieves a Unicode string that is the user readable name of\r
99 the controller that is being managed by an EFI Driver.\r
100\r
101 @param This A pointer to the\r
102 EFI_COMPONENT_NAME_PROTOCOL instance.\r
103\r
104 @param ControllerHandle The handle of a controller that the\r
105 driver specified by This is managing.\r
106 This handle specifies the controller\r
107 whose name is to be returned.\r
108\r
109 @param ChildHandle The handle of the child controller to\r
110 retrieve the name of. This is an\r
111 optional parameter that may be NULL.\r
112 It will be NULL for device drivers.\r
113 It will also be NULL for a bus\r
114 drivers that wish to retrieve the\r
115 name of the bus controller. It will\r
116 not be NULL for a bus driver that\r
117 wishes to retrieve the name of a\r
118 child controller.\r
119\r
120 @param Language A pointer to a Null-terminated ASCII\r
121 string array indicating the language.\r
122 This is the language of the driver\r
123 name that the caller is requesting,\r
124 and it must match one of the\r
125 languages specified in\r
126 SupportedLanguages. The number of\r
127 languages supported by a driver is up\r
128 to the driver writer. Language is\r
129 specified in RFC 3066 language code\r
130 format.\r
131\r
132 @param ControllerName A pointer to the Unicode string to\r
133 return. This Unicode string is the\r
134 name of the controller specified by\r
135 ControllerHandle and ChildHandle in\r
136 the language specified by Language\r
137 from the point of view of the driver\r
138 specified by This.\r
139\r
140 @retval EFI_SUCCESS The Unicode string for the user\r
141 readable name in the language\r
142 specified by Language for the\r
143 driver specified by This was\r
144 returned in DriverName.\r
145\r
146 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\r
147 EFI_HANDLE.\r
148\r
149 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it\r
150 is not a valid EFI_HANDLE.\r
151\r
152 @retval EFI_INVALID_PARAMETER Language is NULL.\r
153\r
154 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
155\r
156 @retval EFI_UNSUPPORTED The driver specified by This is\r
157 not currently managing the\r
158 controller specified by\r
159 ControllerHandle and\r
160 ChildHandle.\r
161\r
162 @retval EFI_UNSUPPORTED The driver specified by This\r
163 does not support the language\r
164 specified by Language.\r
165\r
166**/\r
79840ee1 167EFI_STATUS\r
168EFIAPI\r
169PartitionComponentNameGetControllerName (\r
170 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
171 IN EFI_HANDLE ControllerHandle,\r
172 IN EFI_HANDLE ChildHandle OPTIONAL,\r
173 IN CHAR8 *Language,\r
174 OUT CHAR16 **ControllerName\r
175 )\r
79840ee1 176{\r
177 return EFI_UNSUPPORTED;\r
178}\r