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