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