]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c
fix some checklist issues
[mirror_edk2.git] / MdeModulePkg / Universal / Network / MnpDxe / ComponentName.c
1 /** @file
2 UEFI Component Name(2) protocol implementation for MnpDxe driver.
3
4 Copyright (c) 2005 - 2007, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials are licensed
6 and made available under the terms and conditions of the BSD License which
7 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 "MnpDriver.h"
17
18
19 //
20 // EFI Component Name Protocol
21 //
22 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gMnpComponentName = {
23 MnpComponentNameGetDriverName,
24 MnpComponentNameGetControllerName,
25 "eng"
26 };
27
28 //
29 // EFI Component Name 2 Protocol
30 //
31 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gMnpComponentName2 = {
32 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) MnpComponentNameGetDriverName,
33 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) MnpComponentNameGetControllerName,
34 "en"
35 };
36
37
38 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mMnpDriverNameTable[] = {
39 {
40 "eng;en",
41 L"MNP Network Service Driver"
42 },
43 {
44 NULL,
45 NULL
46 }
47 };
48
49 /**
50 Retrieves a Unicode string that is the user readable name of the driver.
51
52 This function retrieves the user readable name of a driver in the form of a
53 Unicode string. If the driver specified by This has a user readable name in
54 the language specified by Language, then a pointer to the driver name is
55 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
56 by This does not support the language specified by Language,
57 then EFI_UNSUPPORTED is returned.
58
59 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
60 EFI_COMPONENT_NAME_PROTOCOL instance.
61
62 @param[in] Language A pointer to a Null-terminated ASCII string
63 array indicating the language. This is the
64 language of the driver name that the caller is
65 requesting, and it must match one of the
66 languages specified in SupportedLanguages. The
67 number of languages supported by a driver is up
68 to the driver writer. Language is specified
69 in RFC 3066 or ISO 639-2 language code format.
70
71 @param[out] DriverName A pointer to the Unicode string to return.
72 This Unicode string is the name of the
73 driver specified by This in the language
74 specified by Language.
75
76 @retval EFI_SUCCESS The Unicode string for the Driver specified by
77 This and the language specified by Language was
78 returned in DriverName.
79
80 @retval EFI_INVALID_PARAMETER Language is NULL.
81
82 @retval EFI_INVALID_PARAMETER DriverName is NULL.
83
84 @retval EFI_UNSUPPORTED The driver specified by This does not support
85 the language specified by Language.
86
87 **/
88 EFI_STATUS
89 EFIAPI
90 MnpComponentNameGetDriverName (
91 IN EFI_COMPONENT_NAME_PROTOCOL *This,
92 IN CHAR8 *Language,
93 OUT CHAR16 **DriverName
94 )
95 {
96 return LookupUnicodeString2 (
97 Language,
98 This->SupportedLanguages,
99 mMnpDriverNameTable,
100 DriverName,
101 (BOOLEAN) (This == &gMnpComponentName)
102 );
103 }
104
105 /**
106 Retrieves a Unicode string that is the user readable name of the controller
107 that is being managed by a driver.
108
109 This function retrieves the user readable name of the controller specified by
110 ControllerHandle and ChildHandle in the form of a Unicode string. If the
111 driver specified by This has a user readable name in the language specified by
112 Language, then a pointer to the controller name is returned in ControllerName,
113 and EFI_SUCCESS is returned. If the driver specified by This is not currently
114 managing the controller specified by ControllerHandle and ChildHandle,
115 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
116 support the language specified by Language, then EFI_UNSUPPORTED is returned.
117 Currently not implemented.
118
119 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
120 EFI_COMPONENT_NAME_PROTOCOL instance.
121
122 @param[in] ControllerHandle The handle of a controller that the driver
123 specified by This is managing. This handle
124 specifies the controller whose name is to be
125 returned.
126
127 @param[in] ChildHandle The handle of the child controller to retrieve
128 the name of. This is an optional parameter that
129 may be NULL. It will be NULL for device
130 drivers. It will also be NULL for a bus drivers
131 that wish to retrieve the name of the bus
132 controller. It will not be NULL for a bus
133 driver that wishes to retrieve the name of a
134 child controller.
135
136 @param[in] Language A pointer to a Null-terminated ASCII string
137 array indicating the language. This is the
138 language of the driver name that the caller is
139 requesting, and it must match one of the
140 languages specified in SupportedLanguages. The
141 number of languages supported by a driver is up
142 to the driver writer. Language is specified in
143 RFC 3066 or ISO 639-2 language code format.
144
145 @param[out] ControllerName A pointer to the Unicode string to return.
146 This Unicode string is the name of the
147 controller specified by ControllerHandle and
148 ChildHandle in the language specified by
149 Language from the point of view of the driver
150 specified by This.
151
152 @retval EFI_SUCCESS The Unicode string for the user readable name
153 specified by This, ControllerHandle, ChildHandle,
154 and Language was returned in ControllerName.
155
156 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
157
158 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
159 EFI_HANDLE.
160
161 @retval EFI_INVALID_PARAMETER Language is NULL.
162
163 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
164
165 @retval EFI_UNSUPPORTED The driver specified by This is not currently
166 managing the controller specified by
167 ControllerHandle and ChildHandle.
168
169 @retval EFI_UNSUPPORTED The driver specified by This does not support
170 the language specified by Language.
171
172 **/
173 EFI_STATUS
174 EFIAPI
175 MnpComponentNameGetControllerName (
176 IN EFI_COMPONENT_NAME_PROTOCOL *This,
177 IN EFI_HANDLE ControllerHandle,
178 IN EFI_HANDLE ChildHandle OPTIONAL,
179 IN CHAR8 *Language,
180 OUT CHAR16 **ControllerName
181 )
182 {
183 return EFI_UNSUPPORTED;
184 }