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