]>
Commit | Line | Data |
---|---|---|
e811b22f | 1 | /** @file\r |
2 | Library functions that abstract driver model protocols\r | |
3 | installation.\r | |
4 | \r | |
5 | Copyright (c) 2006 - 2007, Intel Corporation<BR> All rights\r | |
6 | reserved. This program and the accompanying materials are\r | |
7 | licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/ \r | |
15 | \r | |
16 | //\r | |
17 | // Include common header file for this module.\r | |
18 | //\r | |
f734a10a | 19 | #include "UefiLibInternal.h"\r |
e811b22f | 20 | \r |
21 | /**\r | |
22 | Intialize a driver by installing the Driver Binding Protocol onto the\r | |
23 | driver's DriverBindingHandle. This is typically the same as the driver's\r | |
24 | ImageHandle, but it can be different if the driver produces multiple\r | |
25 | DriverBinding Protocols. This function also initializes the EFI Driver\r | |
26 | Library that initializes the global variables gST, gBS, gRT.\r | |
27 | \r | |
28 | @param ImageHandle The image handle of the driver\r | |
29 | @param SystemTable The EFI System Table that was passed to the driver's entry point\r | |
30 | @param DriverBinding A Driver Binding Protocol instance that this driver is producing\r | |
31 | @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r | |
32 | parameter is NULL, then a new handle is created.\r | |
33 | \r | |
34 | @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle\r | |
35 | @retval Other Status from gBS->InstallProtocolInterface()\r | |
36 | \r | |
37 | **/\r | |
38 | EFI_STATUS\r | |
39 | EFIAPI\r | |
40 | EfiLibInstallDriverBinding (\r | |
41 | IN const EFI_HANDLE ImageHandle,\r | |
42 | IN const EFI_SYSTEM_TABLE *SystemTable,\r | |
43 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
44 | IN EFI_HANDLE DriverBindingHandle\r | |
45 | )\r | |
46 | {\r | |
47 | EFI_STATUS Status;\r | |
48 | \r | |
49 | ASSERT (NULL != DriverBinding);\r | |
50 | \r | |
51 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
52 | &DriverBindingHandle,\r | |
53 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
54 | NULL\r | |
55 | );\r | |
56 | //\r | |
57 | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r | |
58 | //\r | |
59 | ASSERT_EFI_ERROR (Status);\r | |
60 | \r | |
61 | //\r | |
62 | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r | |
63 | //\r | |
64 | DriverBinding->ImageHandle = ImageHandle;\r | |
65 | DriverBinding->DriverBindingHandle = DriverBindingHandle;\r | |
66 | \r | |
67 | return Status;\r | |
68 | }\r | |
69 | \r | |
70 | /**\r | |
71 | Intialize a driver by installing the Driver Binding Protocol onto the\r | |
72 | driver's DriverBindingHandle. This is typically the same as the driver's\r | |
73 | ImageHandle, but it can be different if the driver produces multiple\r | |
74 | DriverBinding Protocols. This function also initializes the EFI Driver\r | |
75 | Library that initializes the global variables gST, gBS, gRT.\r | |
76 | \r | |
77 | @ImageHandle The image handle of the driver\r | |
78 | @SystemTable The EFI System Table that was passed to the driver's entry point\r | |
79 | @DriverBinding A Driver Binding Protocol instance that this driver is producing\r | |
80 | @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r | |
81 | parameter is NULL, then a new handle is created.\r | |
82 | @ComponentName A Component Name Protocol instance that this driver is producing\r | |
83 | @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing\r | |
84 | @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing\r | |
85 | \r | |
86 | @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle\r | |
87 | @retval Other Status from gBS->InstallProtocolInterface()\r | |
88 | \r | |
89 | **/\r | |
90 | EFI_STATUS\r | |
91 | EFIAPI\r | |
92 | EfiLibInstallAllDriverProtocols (\r | |
93 | IN const EFI_HANDLE ImageHandle,\r | |
94 | IN const EFI_SYSTEM_TABLE *SystemTable,\r | |
95 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
96 | IN EFI_HANDLE DriverBindingHandle,\r | |
97 | IN const EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r | |
98 | IN const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r | |
99 | IN const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL\r | |
100 | )\r | |
101 | {\r | |
102 | EFI_STATUS Status;\r | |
103 | \r | |
104 | ASSERT (NULL != DriverBinding);\r | |
105 | \r | |
106 | if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r | |
107 | if (DriverConfiguration == NULL) {\r | |
108 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
109 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
110 | &DriverBindingHandle,\r | |
111 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
112 | NULL\r | |
113 | );\r | |
114 | } else {\r | |
115 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
116 | &DriverBindingHandle,\r | |
117 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
118 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
119 | NULL\r | |
120 | );\r | |
121 | }\r | |
122 | } else {\r | |
123 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
124 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
125 | &DriverBindingHandle,\r | |
126 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
127 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
128 | NULL\r | |
129 | );\r | |
130 | } else {\r | |
131 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
132 | &DriverBindingHandle,\r | |
133 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
134 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
135 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
136 | NULL\r | |
137 | );\r | |
138 | }\r | |
139 | }\r | |
140 | } else {\r | |
141 | if (DriverConfiguration == NULL) {\r | |
142 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
143 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
144 | &DriverBindingHandle,\r | |
145 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
146 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
147 | NULL\r | |
148 | );\r | |
149 | } else {\r | |
150 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
151 | &DriverBindingHandle,\r | |
152 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
153 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
154 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
155 | NULL\r | |
156 | );\r | |
157 | }\r | |
158 | } else {\r | |
159 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
160 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
161 | &DriverBindingHandle,\r | |
162 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
163 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
164 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
165 | NULL\r | |
166 | );\r | |
167 | } else {\r | |
168 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
169 | &DriverBindingHandle,\r | |
170 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
171 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
172 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
173 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
174 | NULL\r | |
175 | );\r | |
176 | }\r | |
177 | }\r | |
178 | }\r | |
179 | \r | |
180 | //\r | |
181 | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r | |
182 | //\r | |
183 | ASSERT_EFI_ERROR (Status);\r | |
184 | \r | |
185 | //\r | |
186 | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r | |
187 | //\r | |
188 | DriverBinding->ImageHandle = ImageHandle;\r | |
189 | DriverBinding->DriverBindingHandle = DriverBindingHandle;\r | |
190 | \r | |
191 | return Status;\r | |
192 | }\r | |
193 | \r | |
194 | \r | |
195 | /**\r | |
196 | Intialize a driver by installing the Driver Binding Protocol onto the\r | |
197 | driver's DriverBindingHandle. This is typically the same as the driver's\r | |
198 | ImageHandle, but it can be different if the driver produces multiple\r | |
199 | DriverBinding Protocols. This function also initializes the EFI Driver\r | |
200 | Library that initializes the global variables gST, gBS, gRT.\r | |
201 | \r | |
202 | @ImageHandle The image handle of the driver\r | |
203 | @SystemTable The EFI System Table that was passed to the driver's entry point\r | |
204 | @DriverBinding A Driver Binding Protocol instance that this driver is producing\r | |
205 | @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r | |
206 | parameter is NULL, then a new handle is created.\r | |
207 | @ComponentName A Component Name Protocol instance that this driver is producing\r | |
208 | @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing\r | |
209 | @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing\r | |
210 | \r | |
211 | @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle\r | |
212 | @retval Other Status from gBS->InstallProtocolInterface()\r | |
213 | \r | |
214 | **/\r | |
215 | EFI_STATUS\r | |
216 | EFIAPI\r | |
217 | EfiLibInstallAllDriverProtocols2 (\r | |
218 | IN const EFI_HANDLE ImageHandle,\r | |
219 | IN const EFI_SYSTEM_TABLE *SystemTable,\r | |
220 | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r | |
221 | IN EFI_HANDLE DriverBindingHandle,\r | |
222 | IN const EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r | |
223 | IN const EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL\r | |
224 | IN const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r | |
225 | IN const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL\r | |
226 | IN const EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL\r | |
227 | )\r | |
228 | {\r | |
229 | EFI_STATUS Status;\r | |
230 | \r | |
231 | ASSERT (NULL != DriverBinding);\r | |
232 | \r | |
233 | if (DriverConfiguration == NULL) {\r | |
234 | if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r | |
235 | if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r | |
236 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
237 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
238 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
239 | &DriverBindingHandle,\r | |
240 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
241 | NULL\r | |
242 | );\r | |
243 | } else {\r | |
244 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
245 | &DriverBindingHandle,\r | |
246 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
247 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
248 | NULL\r | |
249 | );\r | |
250 | }\r | |
251 | } else {\r | |
252 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
253 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
254 | &DriverBindingHandle,\r | |
255 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
256 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
257 | NULL\r | |
258 | );\r | |
259 | } else {\r | |
260 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
261 | &DriverBindingHandle,\r | |
262 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
263 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
264 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
265 | NULL\r | |
266 | );\r | |
267 | }\r | |
268 | }\r | |
269 | } else {\r | |
270 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
271 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
272 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
273 | &DriverBindingHandle,\r | |
274 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
275 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
276 | NULL\r | |
277 | );\r | |
278 | } else {\r | |
279 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
280 | &DriverBindingHandle,\r | |
281 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
282 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
283 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
284 | NULL\r | |
285 | );\r | |
286 | }\r | |
287 | } else {\r | |
288 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
289 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
290 | &DriverBindingHandle,\r | |
291 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
292 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
293 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
294 | NULL\r | |
295 | );\r | |
296 | } else {\r | |
297 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
298 | &DriverBindingHandle,\r | |
299 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
300 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
301 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
302 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
303 | NULL\r | |
304 | );\r | |
305 | }\r | |
306 | }\r | |
307 | }\r | |
308 | } else {\r | |
309 | if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r | |
310 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
311 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
312 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
313 | &DriverBindingHandle,\r | |
314 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
315 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
316 | NULL\r | |
317 | );\r | |
318 | } else {\r | |
319 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
320 | &DriverBindingHandle,\r | |
321 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
322 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
323 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
324 | NULL\r | |
325 | );\r | |
326 | }\r | |
327 | } else {\r | |
328 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
329 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
330 | &DriverBindingHandle,\r | |
331 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
332 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
333 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
334 | NULL\r | |
335 | );\r | |
336 | } else {\r | |
337 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
338 | &DriverBindingHandle,\r | |
339 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
340 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
341 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
342 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
343 | NULL\r | |
344 | );\r | |
345 | }\r | |
346 | }\r | |
347 | } else {\r | |
348 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
349 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
350 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
351 | &DriverBindingHandle,\r | |
352 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
353 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
354 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
355 | NULL\r | |
356 | );\r | |
357 | } else {\r | |
358 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
359 | &DriverBindingHandle,\r | |
360 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
361 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
362 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
363 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
364 | NULL\r | |
365 | );\r | |
366 | }\r | |
367 | } else {\r | |
368 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
369 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
370 | &DriverBindingHandle,\r | |
371 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
372 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
373 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
374 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
375 | NULL\r | |
376 | );\r | |
377 | } else {\r | |
378 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
379 | &DriverBindingHandle,\r | |
380 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
381 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
382 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
383 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
384 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
385 | NULL\r | |
386 | );\r | |
387 | }\r | |
388 | }\r | |
389 | }\r | |
390 | }\r | |
391 | } else {\r | |
392 | if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r | |
393 | if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r | |
394 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
395 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
396 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
397 | &DriverBindingHandle,\r | |
398 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
399 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
400 | NULL\r | |
401 | );\r | |
402 | } else {\r | |
403 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
404 | &DriverBindingHandle,\r | |
405 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
406 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
407 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
408 | NULL\r | |
409 | );\r | |
410 | }\r | |
411 | } else {\r | |
412 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
413 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
414 | &DriverBindingHandle,\r | |
415 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
416 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
417 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
418 | NULL\r | |
419 | );\r | |
420 | } else {\r | |
421 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
422 | &DriverBindingHandle,\r | |
423 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
424 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
425 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
426 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
427 | NULL\r | |
428 | );\r | |
429 | }\r | |
430 | }\r | |
431 | } else {\r | |
432 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
433 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
434 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
435 | &DriverBindingHandle,\r | |
436 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
437 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
438 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
439 | NULL\r | |
440 | );\r | |
441 | } else {\r | |
442 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
443 | &DriverBindingHandle,\r | |
444 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
445 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
446 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
447 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
448 | NULL\r | |
449 | );\r | |
450 | }\r | |
451 | } else {\r | |
452 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
453 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
454 | &DriverBindingHandle,\r | |
455 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
456 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
457 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
458 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
459 | NULL\r | |
460 | );\r | |
461 | } else {\r | |
462 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
463 | &DriverBindingHandle,\r | |
464 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
465 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
466 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
467 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
468 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
469 | NULL\r | |
470 | );\r | |
471 | }\r | |
472 | }\r | |
473 | }\r | |
474 | } else {\r | |
475 | if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r | |
476 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
477 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
478 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
479 | &DriverBindingHandle,\r | |
480 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
481 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
482 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
483 | NULL\r | |
484 | );\r | |
485 | } else {\r | |
486 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
487 | &DriverBindingHandle,\r | |
488 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
489 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
490 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
491 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
492 | NULL\r | |
493 | );\r | |
494 | }\r | |
495 | } else {\r | |
496 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
497 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
498 | &DriverBindingHandle,\r | |
499 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
500 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
501 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
502 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
503 | NULL\r | |
504 | );\r | |
505 | } else {\r | |
506 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
507 | &DriverBindingHandle,\r | |
508 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
509 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
510 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
511 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
512 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
513 | NULL\r | |
514 | );\r | |
515 | }\r | |
516 | }\r | |
517 | } else {\r | |
518 | if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r | |
519 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
520 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
521 | &DriverBindingHandle,\r | |
522 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
523 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
524 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
525 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
526 | NULL\r | |
527 | );\r | |
528 | } else {\r | |
529 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
530 | &DriverBindingHandle,\r | |
531 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
532 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
533 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
534 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
535 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
536 | NULL\r | |
537 | );\r | |
538 | }\r | |
539 | } else {\r | |
540 | if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r | |
541 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
542 | &DriverBindingHandle,\r | |
543 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
544 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
545 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
546 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
547 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
548 | NULL\r | |
549 | );\r | |
550 | } else {\r | |
551 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
552 | &DriverBindingHandle,\r | |
553 | &gEfiDriverBindingProtocolGuid, DriverBinding,\r | |
554 | &gEfiComponentNameProtocolGuid, ComponentName,\r | |
555 | &gEfiComponentName2ProtocolGuid, ComponentName2,\r | |
556 | &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r | |
557 | &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r | |
558 | &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r | |
559 | NULL\r | |
560 | );\r | |
561 | }\r | |
562 | }\r | |
563 | }\r | |
564 | }\r | |
565 | }\r | |
566 | \r | |
567 | //\r | |
568 | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r | |
569 | //\r | |
570 | ASSERT_EFI_ERROR (Status);\r | |
571 | \r | |
572 | //\r | |
573 | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r | |
574 | //\r | |
575 | DriverBinding->ImageHandle = ImageHandle;\r | |
576 | DriverBinding->DriverBindingHandle = DriverBindingHandle;\r | |
577 | \r | |
578 | return Status;\r | |
579 | }\r | |
580 | \r | |
581 | \r |