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