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