]>
Commit | Line | Data |
---|---|---|
b2570da8 | 1 | /** @file\r |
c8d8f1e3 | 2 | UEFI Component Name(2) protocol implementation for Ip4ConfigDxe driver.\r |
3 | \r | |
402fa70f | 4 | Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r |
b2570da8 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
402fa70f | 7 | which accompanies this distribution. The full text of the license may be found at<BR>\r |
b2570da8 | 8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
b2570da8 | 13 | **/\r |
14 | \r | |
b2570da8 | 15 | #include "Ip4Config.h"\r |
16 | \r | |
b2570da8 | 17 | //\r |
18 | // EFI Component Name Protocol\r | |
19 | //\r | |
1307dcd7 | 20 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIp4ConfigComponentName = {\r |
b2570da8 | 21 | Ip4ConfigComponentNameGetDriverName,\r |
22 | Ip4ConfigComponentNameGetControllerName,\r | |
23 | "eng"\r | |
1307dcd7 | 24 | };\r |
83cbd279 | 25 | \r |
26 | //\r | |
27 | // EFI Component Name 2 Protocol\r | |
28 | //\r | |
1307dcd7 | 29 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2 = {\r |
83cbd279 | 30 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Ip4ConfigComponentNameGetDriverName,\r |
31 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Ip4ConfigComponentNameGetControllerName,\r | |
32 | "en"\r | |
1307dcd7 | 33 | };\r |
83cbd279 | 34 | \r |
b2570da8 | 35 | \r |
d1aeb0bd | 36 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable[] = {\r |
83cbd279 | 37 | {"eng;en", L"IP4 CONFIG Network Service Driver"},\r |
b2570da8 | 38 | {NULL, NULL}\r |
39 | };\r | |
40 | \r | |
c8d8f1e3 | 41 | //\r |
42 | // EFI Component Name Functions\r | |
43 | //\r | |
44 | \r | |
83cbd279 | 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 | |
83cbd279 | 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 | |
0254efc0 | 64 | in RFC 4646 or ISO 639-2 language code format. \r |
83cbd279 | 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 | |
83cbd279 | 73 | @retval EFI_INVALID_PARAMETER Language is NULL.\r |
83cbd279 | 74 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r |
83cbd279 | 75 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r |
76 | the language specified by Language.\r | |
77 | \r | |
78 | **/\r | |
b2570da8 | 79 | EFI_STATUS\r |
80 | EFIAPI\r | |
81 | Ip4ConfigComponentNameGetDriverName (\r | |
82 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
83 | IN CHAR8 *Language,\r | |
84 | OUT CHAR16 **DriverName\r | |
85 | )\r | |
b2570da8 | 86 | {\r |
83cbd279 | 87 | return LookupUnicodeString2 (\r |
b2570da8 | 88 | Language,\r |
83cbd279 | 89 | This->SupportedLanguages,\r |
b2570da8 | 90 | mIp4ConfigDriverNameTable,\r |
83cbd279 | 91 | DriverName,\r |
92 | (BOOLEAN)(This == &gIp4ConfigComponentName)\r | |
b2570da8 | 93 | );\r |
94 | }\r | |
95 | \r | |
83cbd279 | 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 | |
83cbd279 | 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 | |
83cbd279 | 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 | |
83cbd279 | 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 | |
0254efc0 | 130 | RFC 4646 or ISO 639-2 language code format.\r |
83cbd279 | 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 | |
c8d8f1e3 | 137 | \r |
83cbd279 | 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 | |
83cbd279 | 142 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r |
83cbd279 | 143 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r |
144 | EFI_HANDLE.\r | |
83cbd279 | 145 | @retval EFI_INVALID_PARAMETER Language is NULL.\r |
83cbd279 | 146 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r |
83cbd279 | 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 | |
83cbd279 | 150 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r |
151 | the language specified by Language.\r | |
152 | \r | |
153 | **/\r | |
b2570da8 | 154 | EFI_STATUS\r |
155 | EFIAPI\r | |
156 | Ip4ConfigComponentNameGetControllerName (\r | |
83cbd279 | 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 | |
b2570da8 | 162 | )\r |
b2570da8 | 163 | {\r |
164 | return EFI_UNSUPPORTED;\r | |
165 | }\r |