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