]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | UEFI Component Name(2) protocol implementation for ArpDxe driver.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r | |
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 | |
7 | which accompanies this distribution. The full text of the license may be found at<BR>\r | |
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 | |
13 | **/\r | |
14 | \r | |
15 | #include "ArpDriver.h"\r | |
16 | \r | |
17 | \r | |
18 | //\r | |
19 | // EFI Component Name Protocol\r | |
20 | //\r | |
21 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gArpComponentName = {\r | |
22 | ArpComponentNameGetDriverName,\r | |
23 | ArpComponentNameGetControllerName,\r | |
24 | "eng"\r | |
25 | };\r | |
26 | \r | |
27 | //\r | |
28 | // EFI Component Name 2 Protocol\r | |
29 | //\r | |
30 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gArpComponentName2 = {\r | |
31 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ArpComponentNameGetDriverName,\r | |
32 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ArpComponentNameGetControllerName,\r | |
33 | "en"\r | |
34 | };\r | |
35 | \r | |
36 | \r | |
37 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mArpDriverNameTable[] = {\r | |
38 | { "eng;en", L"ARP Network Service Driver" },\r | |
39 | { NULL, NULL }\r | |
40 | };\r | |
41 | \r | |
42 | /**\r | |
43 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
44 | \r | |
45 | This function retrieves the user readable name of a driver in the form of a\r | |
46 | Unicode string. If the driver specified by This has a user readable name in\r | |
47 | the language specified by Language, then a pointer to the driver name is\r | |
48 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
49 | by This does not support the language specified by Language,\r | |
50 | then EFI_UNSUPPORTED is returned.\r | |
51 | \r | |
52 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
53 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
54 | \r | |
55 | @param[in] Language A pointer to a Null-terminated ASCII string\r | |
56 | array indicating the language. This is the\r | |
57 | language of the driver name that the caller is\r | |
58 | requesting, and it must match one of the\r | |
59 | languages specified in SupportedLanguages. The\r | |
60 | number of languages supported by a driver is up\r | |
61 | to the driver writer. Language is specified\r | |
62 | in RFC 3066 or ISO 639-2 language code format.\r | |
63 | \r | |
64 | @param[out] DriverName A pointer to the Unicode string to return.\r | |
65 | This Unicode string is the name of the\r | |
66 | driver specified by This in the language\r | |
67 | specified by Language.\r | |
68 | \r | |
69 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
70 | This and the language specified by Language was\r | |
71 | returned in DriverName.\r | |
72 | \r | |
73 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
74 | \r | |
75 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
76 | \r | |
77 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
78 | the language specified by Language.\r | |
79 | \r | |
80 | **/\r | |
81 | EFI_STATUS\r | |
82 | EFIAPI\r | |
83 | ArpComponentNameGetDriverName (\r | |
84 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
85 | IN CHAR8 *Language,\r | |
86 | OUT CHAR16 **DriverName\r | |
87 | )\r | |
88 | {\r | |
89 | return LookupUnicodeString2 (\r | |
90 | Language,\r | |
91 | This->SupportedLanguages,\r | |
92 | mArpDriverNameTable,\r | |
93 | DriverName,\r | |
94 | (BOOLEAN)(This == &gArpComponentName)\r | |
95 | );\r | |
96 | }\r | |
97 | \r | |
98 | /**\r | |
99 | Retrieves a Unicode string that is the user readable name of the controller\r | |
100 | that is being managed by a driver.\r | |
101 | \r | |
102 | This function retrieves the user readable name of the controller specified by\r | |
103 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
104 | driver specified by This has a user readable name in the language specified by\r | |
105 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
106 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
107 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
108 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
109 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
110 | \r | |
111 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
112 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
113 | \r | |
114 | @param[in] ControllerHandle The handle of a controller that the driver\r | |
115 | specified by This is managing. This handle\r | |
116 | specifies the controller whose name is to be\r | |
117 | returned.\r | |
118 | \r | |
119 | @param[in] ChildHandle The handle of the child controller to retrieve\r | |
120 | the name of. This is an optional parameter that\r | |
121 | may be NULL. It will be NULL for device\r | |
122 | drivers. It will also be NULL for a bus drivers\r | |
123 | that wish to retrieve the name of the bus\r | |
124 | controller. It will not be NULL for a bus\r | |
125 | driver that wishes to retrieve the name of a\r | |
126 | child controller.\r | |
127 | \r | |
128 | @param[in] Language A pointer to a Null-terminated ASCII string\r | |
129 | array indicating the language. This is the\r | |
130 | language of the driver name that the caller is\r | |
131 | requesting, and it must match one of the\r | |
132 | languages specified in SupportedLanguages. The\r | |
133 | number of languages supported by a driver is up\r | |
134 | to the driver writer. Language is specified in\r | |
135 | RFC 3066 or ISO 639-2 language code format.\r | |
136 | \r | |
137 | @param[out] ControllerName A pointer to the Unicode string to return.\r | |
138 | This Unicode string is the name of the\r | |
139 | controller specified by ControllerHandle and\r | |
140 | ChildHandle in the language specified by\r | |
141 | Language from the point of view of the driver\r | |
142 | specified by This.\r | |
143 | \r | |
144 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
145 | the language specified by Language for the\r | |
146 | driver specified by This was returned in\r | |
147 | DriverName.\r | |
148 | \r | |
149 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
150 | \r | |
151 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
152 | EFI_HANDLE.\r | |
153 | \r | |
154 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
155 | \r | |
156 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
157 | \r | |
158 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
159 | managing the controller specified by\r | |
160 | ControllerHandle and ChildHandle.\r | |
161 | \r | |
162 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
163 | the language specified by Language.\r | |
164 | \r | |
165 | **/\r | |
166 | EFI_STATUS\r | |
167 | EFIAPI\r | |
168 | ArpComponentNameGetControllerName (\r | |
169 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
170 | IN EFI_HANDLE ControllerHandle,\r | |
171 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
172 | IN CHAR8 *Language,\r | |
173 | OUT CHAR16 **ControllerName\r | |
174 | )\r | |
175 | {\r | |
176 | return EFI_UNSUPPORTED;\r | |
177 | }\r | |
178 | \r |