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