]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/HttpDxe/ComponentName.c
NetworkPkg: Replace BSD License with BSD+Patent License
[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 6\r
ecf98fbc 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
47f51a06
YT
8\r
9**/\r
10\r
11#include "HttpDriver.h"\r
12\r
13///\r
14/// Component Name Protocol instance\r
15///\r
f75a7f56 16GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
17EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {\r
18 (EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpDxeComponentNameGetDriverName,\r
19 (EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) HttpDxeComponentNameGetControllerName,\r
20 "eng"\r
21};\r
22\r
23///\r
24/// Component Name 2 Protocol instance\r
25///\r
f75a7f56 26GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
27EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {\r
28 HttpDxeComponentNameGetDriverName,\r
29 HttpDxeComponentNameGetControllerName,\r
30 "en"\r
31};\r
32\r
33///\r
34/// Table of driver names\r
35///\r
f75a7f56 36GLOBAL_REMOVE_IF_UNREFERENCED\r
47f51a06
YT
37EFI_UNICODE_STRING_TABLE mHttpDxeDriverNameTable[] = {\r
38 { "eng;en", (CHAR16 *) L"HttpDxe" },\r
39 { NULL, NULL }\r
40};\r
41\r
42/**\r
43 Retrieves a Unicode string that is the user-readable name of the EFI Driver.\r
44\r
45 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
46 @param Language A pointer to a three-character ISO 639-2 language identifier.\r
47 This is the language of the driver name that that the caller\r
48 is requesting, and it must match one of the languages specified\r
49 in SupportedLanguages. The number of languages supported by a\r
50 driver is up to the driver writer.\r
51 @param DriverName A pointer to the Unicode string to return. This Unicode string\r
52 is the name of the driver specified by This in the language\r
53 specified by Language.\r
54\r
55 @retval EFI_SUCCESS The Unicode string for the Driver specified by This\r
56 and the language specified by Language was returned\r
57 in DriverName.\r
58 @retval EFI_INVALID_PARAMETER Language is NULL.\r
59 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
60 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
61 language specified by Language.\r
62\r
63**/\r
64EFI_STATUS\r
65EFIAPI\r
66HttpDxeComponentNameGetDriverName (\r
67 IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r
68 IN CHAR8 *Language,\r
69 OUT CHAR16 **DriverName\r
70 )\r
71{\r
72 return LookupUnicodeString2 (\r
73 Language,\r
74 This->SupportedLanguages,\r
75 mHttpDxeDriverNameTable,\r
76 DriverName,\r
77 (BOOLEAN)(This != &gHttpDxeComponentName2)\r
78 );\r
79}\r
80\r
81/**\r
82 Retrieves a Unicode string that is the user readable name of the controller\r
83 that is being managed by an EFI Driver.\r
84\r
85 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
86 @param ControllerHandle The handle of a controller that the driver specified by\r
87 This is managing. This handle specifies the controller\r
88 whose name is to be returned.\r
89 @param ChildHandle The handle of the child controller to retrieve the name\r
90 of. This is an optional parameter that may be NULL. It\r
91 will be NULL for device drivers. It will also be NULL\r
92 for a bus drivers that wish to retrieve the name of the\r
93 bus controller. It will not be NULL for a bus driver\r
94 that wishes to retrieve the name of a child controller.\r
95 @param Language A pointer to a three character ISO 639-2 language\r
96 identifier. This is the language of the controller name\r
97 that the caller is requesting, and it must match one\r
98 of the languages specified in SupportedLanguages. The\r
99 number of languages supported by a driver is up to the\r
100 driver writer.\r
101 @param ControllerName A pointer to the Unicode string to return. This Unicode\r
102 string is the name of the controller specified by\r
103 ControllerHandle and ChildHandle in the language specified\r
104 by Language, from the point of view of the driver specified\r
105 by This.\r
106\r
107 @retval EFI_SUCCESS The Unicode string for the user-readable name in the\r
108 language specified by Language for the driver\r
109 specified by This was returned in DriverName.\r
110 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
111 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
112 @retval EFI_INVALID_PARAMETER Language is NULL.\r
113 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
114 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing\r
115 the controller specified by ControllerHandle and\r
116 ChildHandle.\r
117 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
118 language specified by Language.\r
119\r
120**/\r
121EFI_STATUS\r
122EFIAPI\r
123HttpDxeComponentNameGetControllerName (\r
124 IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r
125 IN EFI_HANDLE ControllerHandle,\r
126 IN EFI_HANDLE ChildHandle OPTIONAL,\r
127 IN CHAR8 *Language,\r
128 OUT CHAR16 **ControllerName\r
129 )\r
130{\r
131 return EFI_UNSUPPORTED;\r
132}\r