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