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