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