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