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