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