]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/UefiLib/UefiDriverModel.c
Minor grammatical work--mostly adding periods. Items with ONLY period added did...
[mirror_edk2.git] / MdePkg / Library / UefiLib / UefiDriverModel.c
... / ...
CommitLineData
1/** @file\r
2 Library functions that abstract driver model protocols\r
3 installation.\r
4\r
5 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
6 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 "UefiLibInternal.h"\r
18\r
19/**\r
20 Installs and completes the initialization of a Driver Binding Protocol instance.\r
21 \r
22 Installs the Driver Binding Protocol specified by DriverBinding onto the handle\r
23 specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding\r
24 is installed onto a newly created handle. DriverBindingHandle is typically the same\r
25 as the driver's ImageHandle, but it can be different if the driver produces multiple\r
26 Driver Binding Protocols. \r
27 If DriverBinding is NULL, then ASSERT(). \r
28 If DriverBinding can not be installed onto a handle, then ASSERT().\r
29\r
30 @param ImageHandle The image handle of the driver.\r
31 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
32 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
33 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
34 parameter is NULL, then a new handle is created.\r
35\r
36 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
37 @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol.\r
38 @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
39\r
40**/\r
41EFI_STATUS\r
42EFIAPI\r
43EfiLibInstallDriverBinding (\r
44 IN CONST EFI_HANDLE ImageHandle,\r
45 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
46 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
47 IN EFI_HANDLE DriverBindingHandle\r
48 )\r
49{\r
50 EFI_STATUS Status;\r
51\r
52 ASSERT (DriverBinding != NULL);\r
53\r
54 Status = gBS->InstallMultipleProtocolInterfaces (\r
55 &DriverBindingHandle,\r
56 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
57 NULL\r
58 );\r
59 //\r
60 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
61 //\r
62 ASSERT_EFI_ERROR (Status);\r
63\r
64 //\r
65 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
66 //\r
67 DriverBinding->ImageHandle = ImageHandle;\r
68 DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
69\r
70 return Status;\r
71}\r
72\r
73\r
74/**\r
75 Installs and completes the initialization of a Driver Binding Protocol instance and\r
76 optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.\r
77\r
78 Initializes a driver by installing the Driver Binding Protocol together with the\r
79 optional Component Name, optional Driver Configure and optional Driver Diagnostic\r
80 Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL,\r
81 then the protocols are installed onto a newly created handle. DriverBindingHandle\r
82 is typically the same as the driver's ImageHandle, but it can be different if the\r
83 driver produces multiple Driver Binding Protocols. \r
84 If DriverBinding is NULL, then ASSERT(). \r
85 If the installation fails, then ASSERT().\r
86 \r
87 @param ImageHandle The image handle of the driver.\r
88 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
89 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
90 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
91 parameter is NULL, then a new handle is created.\r
92 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
93 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
94 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
95\r
96 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
97 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
98\r
99**/\r
100EFI_STATUS\r
101EFIAPI\r
102EfiLibInstallAllDriverProtocols (\r
103 IN CONST EFI_HANDLE ImageHandle,\r
104 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
105 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
106 IN EFI_HANDLE DriverBindingHandle,\r
107 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
108 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
109 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL\r
110 )\r
111{\r
112 EFI_STATUS Status;\r
113\r
114 ASSERT (DriverBinding != NULL);\r
115\r
116 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
117 if (DriverConfiguration == NULL) {\r
118 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
119 Status = gBS->InstallMultipleProtocolInterfaces (\r
120 &DriverBindingHandle,\r
121 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
122 NULL\r
123 );\r
124 } else {\r
125 Status = gBS->InstallMultipleProtocolInterfaces (\r
126 &DriverBindingHandle,\r
127 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
128 &gEfiComponentNameProtocolGuid, ComponentName,\r
129 NULL\r
130 );\r
131 }\r
132 } else {\r
133 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
134 Status = gBS->InstallMultipleProtocolInterfaces (\r
135 &DriverBindingHandle,\r
136 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
137 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
138 NULL\r
139 );\r
140 } else {\r
141 Status = gBS->InstallMultipleProtocolInterfaces (\r
142 &DriverBindingHandle,\r
143 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
144 &gEfiComponentNameProtocolGuid, ComponentName,\r
145 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
146 NULL\r
147 );\r
148 }\r
149 }\r
150 } else {\r
151 if (DriverConfiguration == NULL) {\r
152 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
153 Status = gBS->InstallMultipleProtocolInterfaces (\r
154 &DriverBindingHandle,\r
155 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
156 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
157 NULL\r
158 );\r
159 } else {\r
160 Status = gBS->InstallMultipleProtocolInterfaces (\r
161 &DriverBindingHandle,\r
162 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
163 &gEfiComponentNameProtocolGuid, ComponentName,\r
164 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
165 NULL\r
166 );\r
167 }\r
168 } else {\r
169 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
170 Status = gBS->InstallMultipleProtocolInterfaces (\r
171 &DriverBindingHandle,\r
172 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
173 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
174 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
175 NULL\r
176 );\r
177 } else {\r
178 Status = gBS->InstallMultipleProtocolInterfaces (\r
179 &DriverBindingHandle,\r
180 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
181 &gEfiComponentNameProtocolGuid, ComponentName,\r
182 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
183 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
184 NULL\r
185 );\r
186 }\r
187 }\r
188 }\r
189\r
190 //\r
191 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
192 //\r
193 ASSERT_EFI_ERROR (Status);\r
194\r
195 //\r
196 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
197 //\r
198 DriverBinding->ImageHandle = ImageHandle;\r
199 DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
200\r
201 return Status;\r
202}\r
203\r
204\r
205\r
206/**\r
207 Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.\r
208\r
209 Initializes a driver by installing the Driver Binding Protocol together with the\r
210 optional Component Name and optional Component Name 2 protocols onto the driver's\r
211 DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed\r
212 onto a newly created handle. DriverBindingHandle is typically the same as the driver's\r
213 ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. \r
214 If DriverBinding is NULL, then ASSERT(). \r
215 If the installation fails, then ASSERT().\r
216\r
217 @param ImageHandle The image handle of the driver.\r
218 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
219 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
220 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
221 parameter is NULL, then a new handle is created.\r
222 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
223 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
224\r
225 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
226 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
227\r
228**/\r
229EFI_STATUS\r
230EFIAPI\r
231EfiLibInstallDriverBindingComponentName2 (\r
232 IN CONST EFI_HANDLE ImageHandle,\r
233 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
234 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
235 IN EFI_HANDLE DriverBindingHandle,\r
236 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
237 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL\r
238 )\r
239{\r
240 EFI_STATUS Status;\r
241\r
242 ASSERT (DriverBinding != NULL);\r
243\r
244 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
245 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
246 Status = gBS->InstallMultipleProtocolInterfaces (\r
247 &DriverBindingHandle,\r
248 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
249 NULL\r
250 );\r
251 } else {\r
252 Status = gBS->InstallMultipleProtocolInterfaces (\r
253 &DriverBindingHandle,\r
254 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
255 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
256 NULL\r
257 );\r
258 }\r
259 } else {\r
260 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
261 Status = gBS->InstallMultipleProtocolInterfaces (\r
262 &DriverBindingHandle,\r
263 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
264 &gEfiComponentNameProtocolGuid, ComponentName,\r
265 NULL\r
266 );\r
267 } else {\r
268 Status = gBS->InstallMultipleProtocolInterfaces (\r
269 &DriverBindingHandle,\r
270 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
271 &gEfiComponentNameProtocolGuid, ComponentName,\r
272 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
273 NULL\r
274 );\r
275 }\r
276 }\r
277 //\r
278 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
279 //\r
280 ASSERT_EFI_ERROR (Status);\r
281\r
282 //\r
283 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
284 //\r
285 DriverBinding->ImageHandle = ImageHandle;\r
286 DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
287\r
288 return Status;\r
289}\r
290\r
291\r
292\r
293/**\r
294 Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver\r
295 Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.\r
296\r
297 Initializes a driver by installing the Driver Binding Protocol together with the optional\r
298 Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2,\r
299 optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle.\r
300 DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver\r
301 produces multiple Driver Binding Protocols. \r
302 If DriverBinding is NULL, then ASSERT(). \r
303 If the installation fails, then ASSERT().\r
304\r
305\r
306 @param ImageHandle The image handle of the driver.\r
307 @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
308 @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
309 @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this\r
310 parameter is NULL, then a new handle is created.\r
311 @param ComponentName A Component Name Protocol instance that this driver is producing.\r
312 @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
313 @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
314 @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing.\r
315 @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
316 @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
317\r
318 @retval EFI_SUCCESS The protocol installation is completed successfully.\r
319 @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
320\r
321**/\r
322EFI_STATUS\r
323EFIAPI\r
324EfiLibInstallAllDriverProtocols2 (\r
325 IN CONST EFI_HANDLE ImageHandle,\r
326 IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
327 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
328 IN EFI_HANDLE DriverBindingHandle,\r
329 IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
330 IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL\r
331 IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
332 IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL\r
333 IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL\r
334 IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL\r
335 )\r
336{\r
337 EFI_STATUS Status;\r
338\r
339 ASSERT (DriverBinding != NULL); \r
340\r
341 if (DriverConfiguration2 == NULL) {\r
342 if (DriverConfiguration == NULL) {\r
343 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
344 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
345 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
346 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
347 Status = gBS->InstallMultipleProtocolInterfaces (\r
348 &DriverBindingHandle,\r
349 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
350 NULL\r
351 );\r
352 } else {\r
353 Status = gBS->InstallMultipleProtocolInterfaces (\r
354 &DriverBindingHandle,\r
355 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
356 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
357 NULL\r
358 );\r
359 }\r
360 } else {\r
361 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
362 Status = gBS->InstallMultipleProtocolInterfaces (\r
363 &DriverBindingHandle,\r
364 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
365 &gEfiComponentNameProtocolGuid, ComponentName,\r
366 NULL\r
367 );\r
368 } else {\r
369 Status = gBS->InstallMultipleProtocolInterfaces (\r
370 &DriverBindingHandle,\r
371 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
372 &gEfiComponentNameProtocolGuid, ComponentName,\r
373 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
374 NULL\r
375 );\r
376 }\r
377 }\r
378 } else {\r
379 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
380 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
381 Status = gBS->InstallMultipleProtocolInterfaces (\r
382 &DriverBindingHandle,\r
383 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
384 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
385 NULL\r
386 );\r
387 } else {\r
388 Status = gBS->InstallMultipleProtocolInterfaces (\r
389 &DriverBindingHandle,\r
390 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
391 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
392 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
393 NULL\r
394 );\r
395 }\r
396 } else {\r
397 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
398 Status = gBS->InstallMultipleProtocolInterfaces (\r
399 &DriverBindingHandle,\r
400 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
401 &gEfiComponentNameProtocolGuid, ComponentName,\r
402 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
403 NULL\r
404 );\r
405 } else {\r
406 Status = gBS->InstallMultipleProtocolInterfaces (\r
407 &DriverBindingHandle,\r
408 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
409 &gEfiComponentNameProtocolGuid, ComponentName,\r
410 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
411 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
412 NULL\r
413 );\r
414 }\r
415 }\r
416 }\r
417 } else {\r
418 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
419 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
420 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
421 Status = gBS->InstallMultipleProtocolInterfaces (\r
422 &DriverBindingHandle,\r
423 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
424 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
425 NULL\r
426 );\r
427 } else {\r
428 Status = gBS->InstallMultipleProtocolInterfaces (\r
429 &DriverBindingHandle,\r
430 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
431 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
432 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
433 NULL\r
434 );\r
435 }\r
436 } else {\r
437 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
438 Status = gBS->InstallMultipleProtocolInterfaces (\r
439 &DriverBindingHandle,\r
440 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
441 &gEfiComponentNameProtocolGuid, ComponentName,\r
442 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
443 NULL\r
444 );\r
445 } else {\r
446 Status = gBS->InstallMultipleProtocolInterfaces (\r
447 &DriverBindingHandle,\r
448 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
449 &gEfiComponentNameProtocolGuid, ComponentName,\r
450 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
451 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
452 NULL\r
453 );\r
454 }\r
455 }\r
456 } else {\r
457 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
458 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
459 Status = gBS->InstallMultipleProtocolInterfaces (\r
460 &DriverBindingHandle,\r
461 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
462 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
463 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
464 NULL\r
465 );\r
466 } else {\r
467 Status = gBS->InstallMultipleProtocolInterfaces (\r
468 &DriverBindingHandle,\r
469 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
470 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
471 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
472 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
473 NULL\r
474 );\r
475 }\r
476 } else {\r
477 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
478 Status = gBS->InstallMultipleProtocolInterfaces (\r
479 &DriverBindingHandle,\r
480 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
481 &gEfiComponentNameProtocolGuid, ComponentName,\r
482 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
483 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
484 NULL\r
485 );\r
486 } else {\r
487 Status = gBS->InstallMultipleProtocolInterfaces (\r
488 &DriverBindingHandle,\r
489 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
490 &gEfiComponentNameProtocolGuid, ComponentName,\r
491 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
492 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
493 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
494 NULL\r
495 );\r
496 }\r
497 }\r
498 }\r
499 }\r
500 } else {\r
501 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
502 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
503 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
504 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
505 Status = gBS->InstallMultipleProtocolInterfaces (\r
506 &DriverBindingHandle,\r
507 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
508 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
509 NULL\r
510 );\r
511 } else {\r
512 Status = gBS->InstallMultipleProtocolInterfaces (\r
513 &DriverBindingHandle,\r
514 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
515 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
516 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
517 NULL\r
518 );\r
519 }\r
520 } else {\r
521 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
522 Status = gBS->InstallMultipleProtocolInterfaces (\r
523 &DriverBindingHandle,\r
524 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
525 &gEfiComponentNameProtocolGuid, ComponentName,\r
526 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
527 NULL\r
528 );\r
529 } else {\r
530 Status = gBS->InstallMultipleProtocolInterfaces (\r
531 &DriverBindingHandle,\r
532 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
533 &gEfiComponentNameProtocolGuid, ComponentName,\r
534 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
535 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
536 NULL\r
537 );\r
538 }\r
539 }\r
540 } else {\r
541 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
542 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
543 Status = gBS->InstallMultipleProtocolInterfaces (\r
544 &DriverBindingHandle,\r
545 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
546 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\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 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
555 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
556 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
557 NULL\r
558 );\r
559 }\r
560 } else {\r
561 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
562 Status = gBS->InstallMultipleProtocolInterfaces (\r
563 &DriverBindingHandle,\r
564 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
565 &gEfiComponentNameProtocolGuid, ComponentName,\r
566 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
567 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
568 NULL\r
569 );\r
570 } else {\r
571 Status = gBS->InstallMultipleProtocolInterfaces (\r
572 &DriverBindingHandle,\r
573 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
574 &gEfiComponentNameProtocolGuid, ComponentName,\r
575 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
576 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
577 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
578 NULL\r
579 );\r
580 }\r
581 }\r
582 }\r
583 } else {\r
584 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
585 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
586 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
587 Status = gBS->InstallMultipleProtocolInterfaces (\r
588 &DriverBindingHandle,\r
589 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
590 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
591 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
592 NULL\r
593 );\r
594 } else {\r
595 Status = gBS->InstallMultipleProtocolInterfaces (\r
596 &DriverBindingHandle,\r
597 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
598 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
599 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
600 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
601 NULL\r
602 );\r
603 }\r
604 } else {\r
605 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
606 Status = gBS->InstallMultipleProtocolInterfaces (\r
607 &DriverBindingHandle,\r
608 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
609 &gEfiComponentNameProtocolGuid, ComponentName,\r
610 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
611 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
612 NULL\r
613 );\r
614 } else {\r
615 Status = gBS->InstallMultipleProtocolInterfaces (\r
616 &DriverBindingHandle,\r
617 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
618 &gEfiComponentNameProtocolGuid, ComponentName,\r
619 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
620 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
621 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
622 NULL\r
623 );\r
624 }\r
625 }\r
626 } else {\r
627 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
628 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
629 Status = gBS->InstallMultipleProtocolInterfaces (\r
630 &DriverBindingHandle,\r
631 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
632 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
633 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
634 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
635 NULL\r
636 );\r
637 } else {\r
638 Status = gBS->InstallMultipleProtocolInterfaces (\r
639 &DriverBindingHandle,\r
640 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
641 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
642 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
643 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
644 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
645 NULL\r
646 );\r
647 }\r
648 } else {\r
649 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
650 Status = gBS->InstallMultipleProtocolInterfaces (\r
651 &DriverBindingHandle,\r
652 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
653 &gEfiComponentNameProtocolGuid, ComponentName,\r
654 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
655 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
656 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
657 NULL\r
658 );\r
659 } else {\r
660 Status = gBS->InstallMultipleProtocolInterfaces (\r
661 &DriverBindingHandle,\r
662 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
663 &gEfiComponentNameProtocolGuid, ComponentName,\r
664 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
665 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
666 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
667 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
668 NULL\r
669 );\r
670 }\r
671 }\r
672 }\r
673 }\r
674 }\r
675 } else {\r
676 if (DriverConfiguration == NULL) {\r
677 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
678 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
679 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
680 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
681 Status = gBS->InstallMultipleProtocolInterfaces (\r
682 &DriverBindingHandle,\r
683 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
684 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
685 NULL\r
686 );\r
687 } else {\r
688 Status = gBS->InstallMultipleProtocolInterfaces (\r
689 &DriverBindingHandle,\r
690 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
691 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
692 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
693 NULL\r
694 );\r
695 }\r
696 } else {\r
697 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
698 Status = gBS->InstallMultipleProtocolInterfaces (\r
699 &DriverBindingHandle,\r
700 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
701 &gEfiComponentNameProtocolGuid, ComponentName,\r
702 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
703 NULL\r
704 );\r
705 } else {\r
706 Status = gBS->InstallMultipleProtocolInterfaces (\r
707 &DriverBindingHandle,\r
708 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
709 &gEfiComponentNameProtocolGuid, ComponentName,\r
710 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
711 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
712 NULL\r
713 );\r
714 }\r
715 }\r
716 } else {\r
717 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
718 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
719 Status = gBS->InstallMultipleProtocolInterfaces (\r
720 &DriverBindingHandle,\r
721 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
722 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
723 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
724 NULL\r
725 );\r
726 } else {\r
727 Status = gBS->InstallMultipleProtocolInterfaces (\r
728 &DriverBindingHandle,\r
729 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
730 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
731 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
732 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
733 NULL\r
734 );\r
735 }\r
736 } else {\r
737 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
738 Status = gBS->InstallMultipleProtocolInterfaces (\r
739 &DriverBindingHandle,\r
740 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
741 &gEfiComponentNameProtocolGuid, ComponentName,\r
742 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
743 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
744 NULL\r
745 );\r
746 } else {\r
747 Status = gBS->InstallMultipleProtocolInterfaces (\r
748 &DriverBindingHandle,\r
749 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
750 &gEfiComponentNameProtocolGuid, ComponentName,\r
751 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
752 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
753 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
754 NULL\r
755 );\r
756 }\r
757 }\r
758 }\r
759 } else {\r
760 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
761 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
762 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
763 Status = gBS->InstallMultipleProtocolInterfaces (\r
764 &DriverBindingHandle,\r
765 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
766 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
767 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
768 NULL\r
769 );\r
770 } else {\r
771 Status = gBS->InstallMultipleProtocolInterfaces (\r
772 &DriverBindingHandle,\r
773 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
774 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
775 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
776 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
777 NULL\r
778 );\r
779 }\r
780 } else {\r
781 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
782 Status = gBS->InstallMultipleProtocolInterfaces (\r
783 &DriverBindingHandle,\r
784 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
785 &gEfiComponentNameProtocolGuid, ComponentName,\r
786 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
787 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
788 NULL\r
789 );\r
790 } else {\r
791 Status = gBS->InstallMultipleProtocolInterfaces (\r
792 &DriverBindingHandle,\r
793 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
794 &gEfiComponentNameProtocolGuid, ComponentName,\r
795 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
796 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
797 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
798 NULL\r
799 );\r
800 }\r
801 }\r
802 } else {\r
803 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
804 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
805 Status = gBS->InstallMultipleProtocolInterfaces (\r
806 &DriverBindingHandle,\r
807 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
808 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
809 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
810 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
811 NULL\r
812 );\r
813 } else {\r
814 Status = gBS->InstallMultipleProtocolInterfaces (\r
815 &DriverBindingHandle,\r
816 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
817 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
818 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
819 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
820 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
821 NULL\r
822 );\r
823 }\r
824 } else {\r
825 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
826 Status = gBS->InstallMultipleProtocolInterfaces (\r
827 &DriverBindingHandle,\r
828 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
829 &gEfiComponentNameProtocolGuid, ComponentName,\r
830 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
831 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
832 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
833 NULL\r
834 );\r
835 } else {\r
836 Status = gBS->InstallMultipleProtocolInterfaces (\r
837 &DriverBindingHandle,\r
838 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
839 &gEfiComponentNameProtocolGuid, ComponentName,\r
840 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
841 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
842 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
843 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
844 NULL\r
845 );\r
846 }\r
847 }\r
848 }\r
849 }\r
850 } else {\r
851 if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
852 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
853 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
854 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
855 Status = gBS->InstallMultipleProtocolInterfaces (\r
856 &DriverBindingHandle,\r
857 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
858 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
859 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
860 NULL\r
861 );\r
862 } else {\r
863 Status = gBS->InstallMultipleProtocolInterfaces (\r
864 &DriverBindingHandle,\r
865 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
866 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
867 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
868 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
869 NULL\r
870 );\r
871 }\r
872 } else {\r
873 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
874 Status = gBS->InstallMultipleProtocolInterfaces (\r
875 &DriverBindingHandle,\r
876 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
877 &gEfiComponentNameProtocolGuid, ComponentName,\r
878 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
879 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
880 NULL\r
881 );\r
882 } else {\r
883 Status = gBS->InstallMultipleProtocolInterfaces (\r
884 &DriverBindingHandle,\r
885 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
886 &gEfiComponentNameProtocolGuid, ComponentName,\r
887 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
888 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
889 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
890 NULL\r
891 );\r
892 }\r
893 }\r
894 } else {\r
895 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
896 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
897 Status = gBS->InstallMultipleProtocolInterfaces (\r
898 &DriverBindingHandle,\r
899 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
900 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
901 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
902 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
903 NULL\r
904 );\r
905 } else {\r
906 Status = gBS->InstallMultipleProtocolInterfaces (\r
907 &DriverBindingHandle,\r
908 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
909 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
910 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
911 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
912 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
913 NULL\r
914 );\r
915 }\r
916 } else {\r
917 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
918 Status = gBS->InstallMultipleProtocolInterfaces (\r
919 &DriverBindingHandle,\r
920 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
921 &gEfiComponentNameProtocolGuid, ComponentName,\r
922 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
923 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
924 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
925 NULL\r
926 );\r
927 } else {\r
928 Status = gBS->InstallMultipleProtocolInterfaces (\r
929 &DriverBindingHandle,\r
930 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
931 &gEfiComponentNameProtocolGuid, ComponentName,\r
932 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
933 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
934 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
935 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
936 NULL\r
937 );\r
938 }\r
939 }\r
940 }\r
941 } else {\r
942 if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
943 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
944 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
945 Status = gBS->InstallMultipleProtocolInterfaces (\r
946 &DriverBindingHandle,\r
947 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
948 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
949 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
950 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
951 NULL\r
952 );\r
953 } else {\r
954 Status = gBS->InstallMultipleProtocolInterfaces (\r
955 &DriverBindingHandle,\r
956 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
957 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
958 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
959 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
960 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
961 NULL\r
962 );\r
963 }\r
964 } else {\r
965 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
966 Status = gBS->InstallMultipleProtocolInterfaces (\r
967 &DriverBindingHandle,\r
968 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
969 &gEfiComponentNameProtocolGuid, ComponentName,\r
970 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
971 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
972 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
973 NULL\r
974 );\r
975 } else {\r
976 Status = gBS->InstallMultipleProtocolInterfaces (\r
977 &DriverBindingHandle,\r
978 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
979 &gEfiComponentNameProtocolGuid, ComponentName,\r
980 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
981 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
982 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
983 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
984 NULL\r
985 );\r
986 }\r
987 }\r
988 } else {\r
989 if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
990 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
991 Status = gBS->InstallMultipleProtocolInterfaces (\r
992 &DriverBindingHandle,\r
993 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
994 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
995 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
996 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
997 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
998 NULL\r
999 );\r
1000 } else {\r
1001 Status = gBS->InstallMultipleProtocolInterfaces (\r
1002 &DriverBindingHandle,\r
1003 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
1004 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
1005 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
1006 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
1007 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
1008 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
1009 NULL\r
1010 );\r
1011 }\r
1012 } else {\r
1013 if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
1014 Status = gBS->InstallMultipleProtocolInterfaces (\r
1015 &DriverBindingHandle,\r
1016 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
1017 &gEfiComponentNameProtocolGuid, ComponentName,\r
1018 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
1019 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
1020 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
1021 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
1022 NULL\r
1023 );\r
1024 } else {\r
1025 Status = gBS->InstallMultipleProtocolInterfaces (\r
1026 &DriverBindingHandle,\r
1027 &gEfiDriverBindingProtocolGuid, DriverBinding,\r
1028 &gEfiComponentNameProtocolGuid, ComponentName,\r
1029 &gEfiComponentName2ProtocolGuid, ComponentName2,\r
1030 &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
1031 &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,\r
1032 &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
1033 &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
1034 NULL\r
1035 );\r
1036 }\r
1037 }\r
1038 }\r
1039 }\r
1040 }\r
1041 }\r
1042\r
1043\r
1044 //\r
1045 // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
1046 //\r
1047 ASSERT_EFI_ERROR (Status);\r
1048\r
1049 //\r
1050 // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
1051 //\r
1052 DriverBinding->ImageHandle = ImageHandle;\r
1053 DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
1054\r
1055 return Status;\r
1056}\r
1057\r
1058\r