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