]>
Commit | Line | Data |
---|---|---|
bcecde14 | 1 | /** @file\r |
2 | \r | |
0c9f676d | 3 | Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>\r |
bcecde14 | 4 | \r |
c0a00b14 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
bcecde14 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include "BiosBlkIo.h"\r | |
10 | \r | |
11 | /**\r | |
12 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
13 | \r | |
14 | This function retrieves the user readable name of a driver in the form of a\r | |
15 | Unicode string. If the driver specified by This has a user readable name in\r | |
16 | the language specified by Language, then a pointer to the driver name is\r | |
17 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
18 | by This does not support the language specified by Language,\r | |
19 | then EFI_UNSUPPORTED is returned.\r | |
20 | \r | |
21 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
22 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
23 | \r | |
24 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
25 | array indicating the language. This is the\r | |
26 | language of the driver name that the caller is\r | |
27 | requesting, and it must match one of the\r | |
28 | languages specified in SupportedLanguages. The\r | |
29 | number of languages supported by a driver is up\r | |
30 | to the driver writer. Language is specified\r | |
31 | in RFC 4646 or ISO 639-2 language code format.\r | |
32 | \r | |
33 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
34 | This Unicode string is the name of the\r | |
35 | driver specified by This in the language\r | |
36 | specified by Language.\r | |
37 | \r | |
38 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
39 | This and the language specified by Language was\r | |
40 | returned in DriverName.\r | |
41 | \r | |
42 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
43 | \r | |
44 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
45 | \r | |
46 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
47 | the language specified by Language.\r | |
48 | \r | |
49 | **/\r | |
50 | EFI_STATUS\r | |
51 | EFIAPI\r | |
52 | BiosBlockIoComponentNameGetDriverName (\r | |
53 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
54 | IN CHAR8 *Language,\r | |
55 | OUT CHAR16 **DriverName\r | |
56 | );\r | |
57 | \r | |
58 | /**\r | |
59 | Retrieves a Unicode string that is the user readable name of the controller\r | |
60 | that is being managed by a driver.\r | |
61 | \r | |
62 | This function retrieves the user readable name of the controller specified by\r | |
63 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
64 | driver specified by This has a user readable name in the language specified by\r | |
65 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
66 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
67 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
68 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
69 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
70 | \r | |
71 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
72 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
73 | \r | |
74 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
75 | specified by This is managing. This handle\r | |
76 | specifies the controller whose name is to be\r | |
77 | returned.\r | |
78 | \r | |
79 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
80 | the name of. This is an optional parameter that\r | |
81 | may be NULL. It will be NULL for device\r | |
82 | drivers. It will also be NULL for a bus drivers\r | |
83 | that wish to retrieve the name of the bus\r | |
84 | controller. It will not be NULL for a bus\r | |
85 | driver that wishes to retrieve the name of a\r | |
86 | child controller.\r | |
87 | \r | |
88 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
89 | array indicating the language. This is the\r | |
90 | language of the driver name that the caller is\r | |
91 | requesting, and it must match one of the\r | |
92 | languages specified in SupportedLanguages. The\r | |
93 | number of languages supported by a driver is up\r | |
94 | to the driver writer. Language is specified in\r | |
95 | RFC 4646 or ISO 639-2 language code format.\r | |
96 | \r | |
97 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
98 | This Unicode string is the name of the\r | |
99 | controller specified by ControllerHandle and\r | |
100 | ChildHandle in the language specified by\r | |
101 | Language from the point of view of the driver\r | |
102 | specified by This.\r | |
103 | \r | |
104 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
105 | the language specified by Language for the\r | |
106 | driver specified by This was returned in\r | |
107 | DriverName.\r | |
108 | \r | |
0c9f676d | 109 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
bcecde14 | 110 | \r |
111 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
112 | EFI_HANDLE.\r | |
113 | \r | |
114 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
115 | \r | |
116 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
117 | \r | |
118 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
119 | managing the controller specified by\r | |
120 | ControllerHandle and ChildHandle.\r | |
121 | \r | |
122 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
123 | the language specified by Language.\r | |
124 | \r | |
125 | **/\r | |
126 | EFI_STATUS\r | |
127 | EFIAPI\r | |
128 | BiosBlockIoComponentNameGetControllerName (\r | |
129 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
130 | IN EFI_HANDLE ControllerHandle,\r | |
131 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
132 | IN CHAR8 *Language,\r | |
133 | OUT CHAR16 **ControllerName\r | |
134 | );\r | |
135 | \r | |
136 | \r | |
137 | //\r | |
138 | // EFI Component Name Protocol\r | |
139 | //\r | |
140 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBiosBlockIoComponentName = {\r | |
141 | BiosBlockIoComponentNameGetDriverName,\r | |
142 | BiosBlockIoComponentNameGetControllerName,\r | |
143 | "eng"\r | |
144 | };\r | |
145 | \r | |
146 | //\r | |
147 | // EFI Component Name 2 Protocol\r | |
148 | //\r | |
149 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBiosBlockIoComponentName2 = {\r | |
150 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BiosBlockIoComponentNameGetDriverName,\r | |
151 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BiosBlockIoComponentNameGetControllerName,\r | |
152 | "en"\r | |
153 | };\r | |
154 | \r | |
155 | \r | |
156 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mBiosBlockIoDriverNameTable[] = {\r | |
157 | {\r | |
158 | "eng;en",\r | |
159 | L"BIOS[INT13] Block Io Driver"\r | |
160 | },\r | |
161 | {\r | |
162 | NULL,\r | |
163 | NULL\r | |
164 | }\r | |
165 | };\r | |
166 | \r | |
167 | /**\r | |
168 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
169 | \r | |
170 | This function retrieves the user readable name of a driver in the form of a\r | |
171 | Unicode string. If the driver specified by This has a user readable name in\r | |
172 | the language specified by Language, then a pointer to the driver name is\r | |
173 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
174 | by This does not support the language specified by Language,\r | |
175 | then EFI_UNSUPPORTED is returned.\r | |
176 | \r | |
177 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
178 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
179 | \r | |
180 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
181 | array indicating the language. This is the\r | |
182 | language of the driver name that the caller is\r | |
183 | requesting, and it must match one of the\r | |
184 | languages specified in SupportedLanguages. The\r | |
185 | number of languages supported by a driver is up\r | |
186 | to the driver writer. Language is specified\r | |
187 | in RFC 4646 or ISO 639-2 language code format.\r | |
188 | \r | |
189 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
190 | This Unicode string is the name of the\r | |
191 | driver specified by This in the language\r | |
192 | specified by Language.\r | |
193 | \r | |
194 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
195 | This and the language specified by Language was\r | |
196 | returned in DriverName.\r | |
197 | \r | |
198 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
199 | \r | |
200 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
201 | \r | |
202 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
203 | the language specified by Language.\r | |
204 | \r | |
205 | **/\r | |
206 | EFI_STATUS\r | |
207 | EFIAPI\r | |
208 | BiosBlockIoComponentNameGetDriverName (\r | |
209 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
210 | IN CHAR8 *Language,\r | |
211 | OUT CHAR16 **DriverName\r | |
212 | )\r | |
213 | {\r | |
214 | return LookupUnicodeString2 (\r | |
215 | Language,\r | |
216 | This->SupportedLanguages,\r | |
217 | mBiosBlockIoDriverNameTable,\r | |
218 | DriverName,\r | |
219 | (BOOLEAN)(This == &gBiosBlockIoComponentName)\r | |
220 | );\r | |
221 | }\r | |
222 | \r | |
223 | /**\r | |
224 | Retrieves a Unicode string that is the user readable name of the controller\r | |
225 | that is being managed by a driver.\r | |
226 | \r | |
227 | This function retrieves the user readable name of the controller specified by\r | |
228 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
229 | driver specified by This has a user readable name in the language specified by\r | |
230 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
231 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
232 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
233 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
234 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
235 | \r | |
236 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
237 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
238 | \r | |
239 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
240 | specified by This is managing. This handle\r | |
241 | specifies the controller whose name is to be\r | |
242 | returned.\r | |
243 | \r | |
244 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
245 | the name of. This is an optional parameter that\r | |
246 | may be NULL. It will be NULL for device\r | |
247 | drivers. It will also be NULL for a bus drivers\r | |
248 | that wish to retrieve the name of the bus\r | |
249 | controller. It will not be NULL for a bus\r | |
250 | driver that wishes to retrieve the name of a\r | |
251 | child controller.\r | |
252 | \r | |
253 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
254 | array indicating the language. This is the\r | |
255 | language of the driver name that the caller is\r | |
256 | requesting, and it must match one of the\r | |
257 | languages specified in SupportedLanguages. The\r | |
258 | number of languages supported by a driver is up\r | |
259 | to the driver writer. Language is specified in\r | |
260 | RFC 4646 or ISO 639-2 language code format.\r | |
261 | \r | |
262 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
263 | This Unicode string is the name of the\r | |
264 | controller specified by ControllerHandle and\r | |
265 | ChildHandle in the language specified by\r | |
266 | Language from the point of view of the driver\r | |
267 | specified by This.\r | |
268 | \r | |
269 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
270 | the language specified by Language for the\r | |
271 | driver specified by This was returned in\r | |
272 | DriverName.\r | |
273 | \r | |
0c9f676d | 274 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
bcecde14 | 275 | \r |
276 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
277 | EFI_HANDLE.\r | |
278 | \r | |
279 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
280 | \r | |
281 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
282 | \r | |
283 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
284 | managing the controller specified by\r | |
285 | ControllerHandle and ChildHandle.\r | |
286 | \r | |
287 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
288 | the language specified by Language.\r | |
289 | \r | |
290 | **/\r | |
291 | EFI_STATUS\r | |
292 | EFIAPI\r | |
293 | BiosBlockIoComponentNameGetControllerName (\r | |
294 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
295 | IN EFI_HANDLE ControllerHandle,\r | |
296 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
297 | IN CHAR8 *Language,\r | |
298 | OUT CHAR16 **ControllerName\r | |
299 | )\r | |
300 | {\r | |
301 | return EFI_UNSUPPORTED;\r | |
302 | }\r |