]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/HttpDxe/ComponentName.c
NetworkPkg: Clean up source files
[mirror_edk2.git] / NetworkPkg / HttpDxe / ComponentName.c
CommitLineData
47f51a06
YT
1/** @file\r
2 Implementation of EFI_COMPONENT_NAME_PROTOCOL and\r
3 EFI_COMPONENT_NAME2_PROTOCOL protocol.\r
4\r
f75a7f56 5 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
47f51a06
YT
6\r
7 This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php.\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#include "HttpDriver.h"\r
18\r
19///\r
20/// Component Name Protocol instance\r
21///\r
f75a7f56 22GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
23EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {\r
24 (EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpDxeComponentNameGetDriverName,\r
25 (EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) HttpDxeComponentNameGetControllerName,\r
26 "eng"\r
27};\r
28\r
29///\r
30/// Component Name 2 Protocol instance\r
31///\r
f75a7f56 32GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
33EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {\r
34 HttpDxeComponentNameGetDriverName,\r
35 HttpDxeComponentNameGetControllerName,\r
36 "en"\r
37};\r
38\r
39///\r
40/// Table of driver names\r
41///\r
f75a7f56 42GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
43EFI_UNICODE_STRING_TABLE mHttpDxeDriverNameTable[] = {\r
44 { "eng;en", (CHAR16 *) L"HttpDxe" },\r
45 { NULL, NULL }\r
46};\r
47\r
48/**\r
49 Retrieves a Unicode string that is the user-readable name of the EFI Driver.\r
50\r
51 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
52 @param Language A pointer to a three-character ISO 639-2 language identifier.\r
53 This is the language of the driver name that that the caller\r
54 is requesting, and it must match one of the languages specified\r
55 in SupportedLanguages. The number of languages supported by a\r
56 driver is up to the driver writer.\r
57 @param DriverName A pointer to the Unicode string to return. This Unicode string\r
58 is the name of the driver specified by This in the language\r
59 specified by Language.\r
60\r
61 @retval EFI_SUCCESS The Unicode string for the Driver specified by This\r
62 and the language specified by Language was returned\r
63 in DriverName.\r
64 @retval EFI_INVALID_PARAMETER Language is NULL.\r
65 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
66 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
67 language specified by Language.\r
68\r
69**/\r
70EFI_STATUS\r
71EFIAPI\r
72HttpDxeComponentNameGetDriverName (\r
73 IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r
74 IN CHAR8 *Language,\r
75 OUT CHAR16 **DriverName\r
76 )\r
77{\r
78 return LookupUnicodeString2 (\r
79 Language,\r
80 This->SupportedLanguages,\r
81 mHttpDxeDriverNameTable,\r
82 DriverName,\r
83 (BOOLEAN)(This != &gHttpDxeComponentName2)\r
84 );\r
85}\r
86\r
87/**\r
88 Retrieves a Unicode string that is the user readable name of the controller\r
89 that is being managed by an EFI Driver.\r
90\r
91 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
92 @param ControllerHandle The handle of a controller that the driver specified by\r
93 This is managing. This handle specifies the controller\r
94 whose name is to be returned.\r
95 @param ChildHandle The handle of the child controller to retrieve the name\r
96 of. This is an optional parameter that may be NULL. It\r
97 will be NULL for device drivers. It will also be NULL\r
98 for a bus drivers that wish to retrieve the name of the\r
99 bus controller. It will not be NULL for a bus driver\r
100 that wishes to retrieve the name of a child controller.\r
101 @param Language A pointer to a three character ISO 639-2 language\r
102 identifier. This is the language of the controller name\r
103 that the caller is requesting, and it must match one\r
104 of the languages specified in SupportedLanguages. The\r
105 number of languages supported by a driver is up to the\r
106 driver writer.\r
107 @param ControllerName A pointer to the Unicode string to return. This Unicode\r
108 string is the name of the controller specified by\r
109 ControllerHandle and ChildHandle in the language specified\r
110 by Language, from the point of view of the driver specified\r
111 by This.\r
112\r
113 @retval EFI_SUCCESS The Unicode string for the user-readable name in the\r
114 language specified by Language for the driver\r
115 specified by This was returned in DriverName.\r
116 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
117 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
118 @retval EFI_INVALID_PARAMETER Language is NULL.\r
119 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
120 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing\r
121 the controller specified by ControllerHandle and\r
122 ChildHandle.\r
123 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
124 language specified by Language.\r
125\r
126**/\r
127EFI_STATUS\r
128EFIAPI\r
129HttpDxeComponentNameGetControllerName (\r
130 IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r
131 IN EFI_HANDLE ControllerHandle,\r
132 IN EFI_HANDLE ChildHandle OPTIONAL,\r
133 IN CHAR8 *Language,\r
134 OUT CHAR16 **ControllerName\r
135 )\r
136{\r
137 return EFI_UNSUPPORTED;\r
138}\r