/src/edk2/MdePkg/Library/UefiLib/UefiDriverModel.c
Line | Count | Source |
1 | | /** @file |
2 | | Library functions that abstract driver model protocols |
3 | | installation and uninstallation. |
4 | | |
5 | | Copyright (c) 2019, NVIDIA Corporation. All rights reserved. |
6 | | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> |
7 | | SPDX-License-Identifier: BSD-2-Clause-Patent |
8 | | |
9 | | **/ |
10 | | |
11 | | #include "UefiLibInternal.h" |
12 | | |
13 | | /** |
14 | | Installs and completes the initialization of a Driver Binding Protocol instance. |
15 | | |
16 | | Installs the Driver Binding Protocol specified by DriverBinding onto the handle |
17 | | specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding |
18 | | is installed onto a newly created handle. DriverBindingHandle is typically the same |
19 | | as the driver's ImageHandle, but it can be different if the driver produces multiple |
20 | | Driver Binding Protocols. |
21 | | If DriverBinding is NULL, then ASSERT(). |
22 | | If DriverBinding can not be installed onto a handle, then ASSERT(). |
23 | | |
24 | | @param ImageHandle The image handle of the driver. |
25 | | @param SystemTable The EFI System Table that was passed to the driver's entry point. |
26 | | @param DriverBinding A Driver Binding Protocol instance that this driver is producing. |
27 | | @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this |
28 | | parameter is NULL, then a new handle is created. |
29 | | |
30 | | @retval EFI_SUCCESS The protocol installation successfully completed. |
31 | | @retval EFI_OUT_OF_RESOURCES There was not enough system resources to install the protocol. |
32 | | @retval Others Status from gBS->InstallMultipleProtocolInterfaces(). |
33 | | |
34 | | **/ |
35 | | EFI_STATUS |
36 | | EFIAPI |
37 | | EfiLibInstallDriverBinding ( |
38 | | IN CONST EFI_HANDLE ImageHandle, |
39 | | IN CONST EFI_SYSTEM_TABLE *SystemTable, |
40 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
41 | | IN EFI_HANDLE DriverBindingHandle |
42 | | ) |
43 | 0 | { |
44 | 0 | EFI_STATUS Status; |
45 | |
|
46 | 0 | ASSERT (DriverBinding != NULL); |
47 | | |
48 | | // |
49 | | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol |
50 | | // |
51 | 0 | DriverBinding->ImageHandle = ImageHandle; |
52 | 0 | DriverBinding->DriverBindingHandle = DriverBindingHandle; |
53 | |
|
54 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
55 | 0 | &DriverBinding->DriverBindingHandle, |
56 | 0 | &gEfiDriverBindingProtocolGuid, |
57 | 0 | DriverBinding, |
58 | 0 | NULL |
59 | 0 | ); |
60 | | // |
61 | | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed |
62 | | // |
63 | 0 | ASSERT_EFI_ERROR (Status); |
64 | |
|
65 | 0 | return Status; |
66 | 0 | } |
67 | | |
68 | | /** |
69 | | Uninstalls a Driver Binding Protocol instance. |
70 | | |
71 | | If DriverBinding is NULL, then ASSERT(). |
72 | | If DriverBinding can not be uninstalled, then ASSERT(). |
73 | | |
74 | | @param DriverBinding A Driver Binding Protocol instance that this driver produced. |
75 | | |
76 | | @retval EFI_SUCCESS The protocol uninstallation successfully completed. |
77 | | @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). |
78 | | |
79 | | **/ |
80 | | EFI_STATUS |
81 | | EFIAPI |
82 | | EfiLibUninstallDriverBinding ( |
83 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding |
84 | | ) |
85 | 0 | { |
86 | 0 | EFI_STATUS Status; |
87 | |
|
88 | 0 | ASSERT (DriverBinding != NULL); |
89 | |
|
90 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
91 | 0 | DriverBinding->DriverBindingHandle, |
92 | 0 | &gEfiDriverBindingProtocolGuid, |
93 | 0 | DriverBinding, |
94 | 0 | NULL |
95 | 0 | ); |
96 | | // |
97 | | // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed |
98 | | // |
99 | 0 | ASSERT_EFI_ERROR (Status); |
100 | |
|
101 | 0 | return Status; |
102 | 0 | } |
103 | | |
104 | | /** |
105 | | Installs and completes the initialization of a Driver Binding Protocol instance and |
106 | | optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols. |
107 | | |
108 | | Initializes a driver by installing the Driver Binding Protocol together with the |
109 | | optional Component Name, optional Driver Configure and optional Driver Diagnostic |
110 | | Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL, |
111 | | then the protocols are installed onto a newly created handle. DriverBindingHandle |
112 | | is typically the same as the driver's ImageHandle, but it can be different if the |
113 | | driver produces multiple Driver Binding Protocols. |
114 | | If DriverBinding is NULL, then ASSERT(). |
115 | | If the installation fails, then ASSERT(). |
116 | | |
117 | | @param ImageHandle The image handle of the driver. |
118 | | @param SystemTable The EFI System Table that was passed to the driver's entry point. |
119 | | @param DriverBinding A Driver Binding Protocol instance that this driver is producing. |
120 | | @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this |
121 | | parameter is NULL, then a new handle is created. |
122 | | @param ComponentName A Component Name Protocol instance that this driver is producing. |
123 | | @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing. |
124 | | @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing. |
125 | | |
126 | | @retval EFI_SUCCESS The protocol installation successfully completed. |
127 | | @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols. |
128 | | |
129 | | **/ |
130 | | EFI_STATUS |
131 | | EFIAPI |
132 | | EfiLibInstallAllDriverProtocols ( |
133 | | IN CONST EFI_HANDLE ImageHandle, |
134 | | IN CONST EFI_SYSTEM_TABLE *SystemTable, |
135 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
136 | | IN EFI_HANDLE DriverBindingHandle, |
137 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
138 | | IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, |
139 | | IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL |
140 | | ) |
141 | 0 | { |
142 | 0 | EFI_STATUS Status; |
143 | |
|
144 | 0 | ASSERT (DriverBinding != NULL); |
145 | | |
146 | | // |
147 | | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol |
148 | | // |
149 | 0 | DriverBinding->ImageHandle = ImageHandle; |
150 | 0 | DriverBinding->DriverBindingHandle = DriverBindingHandle; |
151 | |
|
152 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
153 | 0 | if (DriverConfiguration == NULL) { |
154 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
155 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
156 | 0 | &DriverBinding->DriverBindingHandle, |
157 | 0 | &gEfiDriverBindingProtocolGuid, |
158 | 0 | DriverBinding, |
159 | 0 | NULL |
160 | 0 | ); |
161 | 0 | } else { |
162 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
163 | 0 | &DriverBinding->DriverBindingHandle, |
164 | 0 | &gEfiDriverBindingProtocolGuid, |
165 | 0 | DriverBinding, |
166 | 0 | &gEfiComponentNameProtocolGuid, |
167 | 0 | ComponentName, |
168 | 0 | NULL |
169 | 0 | ); |
170 | 0 | } |
171 | 0 | } else { |
172 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
173 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
174 | 0 | &DriverBinding->DriverBindingHandle, |
175 | 0 | &gEfiDriverBindingProtocolGuid, |
176 | 0 | DriverBinding, |
177 | 0 | &gEfiDriverConfigurationProtocolGuid, |
178 | 0 | DriverConfiguration, |
179 | 0 | NULL |
180 | 0 | ); |
181 | 0 | } else { |
182 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
183 | 0 | &DriverBinding->DriverBindingHandle, |
184 | 0 | &gEfiDriverBindingProtocolGuid, |
185 | 0 | DriverBinding, |
186 | 0 | &gEfiComponentNameProtocolGuid, |
187 | 0 | ComponentName, |
188 | 0 | &gEfiDriverConfigurationProtocolGuid, |
189 | 0 | DriverConfiguration, |
190 | 0 | NULL |
191 | 0 | ); |
192 | 0 | } |
193 | 0 | } |
194 | 0 | } else { |
195 | 0 | if (DriverConfiguration == NULL) { |
196 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
197 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
198 | 0 | &DriverBinding->DriverBindingHandle, |
199 | 0 | &gEfiDriverBindingProtocolGuid, |
200 | 0 | DriverBinding, |
201 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
202 | 0 | DriverDiagnostics, |
203 | 0 | NULL |
204 | 0 | ); |
205 | 0 | } else { |
206 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
207 | 0 | &DriverBinding->DriverBindingHandle, |
208 | 0 | &gEfiDriverBindingProtocolGuid, |
209 | 0 | DriverBinding, |
210 | 0 | &gEfiComponentNameProtocolGuid, |
211 | 0 | ComponentName, |
212 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
213 | 0 | DriverDiagnostics, |
214 | 0 | NULL |
215 | 0 | ); |
216 | 0 | } |
217 | 0 | } else { |
218 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
219 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
220 | 0 | &DriverBinding->DriverBindingHandle, |
221 | 0 | &gEfiDriverBindingProtocolGuid, |
222 | 0 | DriverBinding, |
223 | 0 | &gEfiDriverConfigurationProtocolGuid, |
224 | 0 | DriverConfiguration, |
225 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
226 | 0 | DriverDiagnostics, |
227 | 0 | NULL |
228 | 0 | ); |
229 | 0 | } else { |
230 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
231 | 0 | &DriverBinding->DriverBindingHandle, |
232 | 0 | &gEfiDriverBindingProtocolGuid, |
233 | 0 | DriverBinding, |
234 | 0 | &gEfiComponentNameProtocolGuid, |
235 | 0 | ComponentName, |
236 | 0 | &gEfiDriverConfigurationProtocolGuid, |
237 | 0 | DriverConfiguration, |
238 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
239 | 0 | DriverDiagnostics, |
240 | 0 | NULL |
241 | 0 | ); |
242 | 0 | } |
243 | 0 | } |
244 | 0 | } |
245 | | |
246 | | // |
247 | | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed |
248 | | // |
249 | 0 | ASSERT_EFI_ERROR (Status); |
250 | |
|
251 | 0 | return Status; |
252 | 0 | } |
253 | | |
254 | | /** |
255 | | Uninstalls a Driver Binding Protocol instance and optionally uninstalls the |
256 | | Component Name, Driver Configuration and Driver Diagnostics Protocols. |
257 | | |
258 | | If DriverBinding is NULL, then ASSERT(). |
259 | | If the uninstallation fails, then ASSERT(). |
260 | | |
261 | | @param DriverBinding A Driver Binding Protocol instance that this driver produced. |
262 | | @param ComponentName A Component Name Protocol instance that this driver produced. |
263 | | @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. |
264 | | @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. |
265 | | |
266 | | @retval EFI_SUCCESS The protocol uninstallation successfully completed. |
267 | | @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). |
268 | | |
269 | | **/ |
270 | | EFI_STATUS |
271 | | EFIAPI |
272 | | EfiLibUninstallAllDriverProtocols ( |
273 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
274 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
275 | | IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, |
276 | | IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL |
277 | | ) |
278 | 0 | { |
279 | 0 | EFI_STATUS Status; |
280 | |
|
281 | 0 | ASSERT (DriverBinding != NULL); |
282 | |
|
283 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
284 | 0 | if (DriverConfiguration == NULL) { |
285 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
286 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
287 | 0 | DriverBinding->DriverBindingHandle, |
288 | 0 | &gEfiDriverBindingProtocolGuid, |
289 | 0 | DriverBinding, |
290 | 0 | NULL |
291 | 0 | ); |
292 | 0 | } else { |
293 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
294 | 0 | DriverBinding->DriverBindingHandle, |
295 | 0 | &gEfiDriverBindingProtocolGuid, |
296 | 0 | DriverBinding, |
297 | 0 | &gEfiComponentNameProtocolGuid, |
298 | 0 | ComponentName, |
299 | 0 | NULL |
300 | 0 | ); |
301 | 0 | } |
302 | 0 | } else { |
303 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
304 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
305 | 0 | DriverBinding->DriverBindingHandle, |
306 | 0 | &gEfiDriverBindingProtocolGuid, |
307 | 0 | DriverBinding, |
308 | 0 | &gEfiDriverConfigurationProtocolGuid, |
309 | 0 | DriverConfiguration, |
310 | 0 | NULL |
311 | 0 | ); |
312 | 0 | } else { |
313 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
314 | 0 | DriverBinding->DriverBindingHandle, |
315 | 0 | &gEfiDriverBindingProtocolGuid, |
316 | 0 | DriverBinding, |
317 | 0 | &gEfiComponentNameProtocolGuid, |
318 | 0 | ComponentName, |
319 | 0 | &gEfiDriverConfigurationProtocolGuid, |
320 | 0 | DriverConfiguration, |
321 | 0 | NULL |
322 | 0 | ); |
323 | 0 | } |
324 | 0 | } |
325 | 0 | } else { |
326 | 0 | if (DriverConfiguration == NULL) { |
327 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
328 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
329 | 0 | DriverBinding->DriverBindingHandle, |
330 | 0 | &gEfiDriverBindingProtocolGuid, |
331 | 0 | DriverBinding, |
332 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
333 | 0 | DriverDiagnostics, |
334 | 0 | NULL |
335 | 0 | ); |
336 | 0 | } else { |
337 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
338 | 0 | DriverBinding->DriverBindingHandle, |
339 | 0 | &gEfiDriverBindingProtocolGuid, |
340 | 0 | DriverBinding, |
341 | 0 | &gEfiComponentNameProtocolGuid, |
342 | 0 | ComponentName, |
343 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
344 | 0 | DriverDiagnostics, |
345 | 0 | NULL |
346 | 0 | ); |
347 | 0 | } |
348 | 0 | } else { |
349 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
350 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
351 | 0 | DriverBinding->DriverBindingHandle, |
352 | 0 | &gEfiDriverBindingProtocolGuid, |
353 | 0 | DriverBinding, |
354 | 0 | &gEfiDriverConfigurationProtocolGuid, |
355 | 0 | DriverConfiguration, |
356 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
357 | 0 | DriverDiagnostics, |
358 | 0 | NULL |
359 | 0 | ); |
360 | 0 | } else { |
361 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
362 | 0 | DriverBinding->DriverBindingHandle, |
363 | 0 | &gEfiDriverBindingProtocolGuid, |
364 | 0 | DriverBinding, |
365 | 0 | &gEfiComponentNameProtocolGuid, |
366 | 0 | ComponentName, |
367 | 0 | &gEfiDriverConfigurationProtocolGuid, |
368 | 0 | DriverConfiguration, |
369 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
370 | 0 | DriverDiagnostics, |
371 | 0 | NULL |
372 | 0 | ); |
373 | 0 | } |
374 | 0 | } |
375 | 0 | } |
376 | | |
377 | | // |
378 | | // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed |
379 | | // |
380 | 0 | ASSERT_EFI_ERROR (Status); |
381 | |
|
382 | 0 | return Status; |
383 | 0 | } |
384 | | |
385 | | /** |
386 | | Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. |
387 | | |
388 | | Initializes a driver by installing the Driver Binding Protocol together with the |
389 | | optional Component Name and optional Component Name 2 protocols onto the driver's |
390 | | DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed |
391 | | onto a newly created handle. DriverBindingHandle is typically the same as the driver's |
392 | | ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. |
393 | | If DriverBinding is NULL, then ASSERT(). |
394 | | If the installation fails, then ASSERT(). |
395 | | |
396 | | @param ImageHandle The image handle of the driver. |
397 | | @param SystemTable The EFI System Table that was passed to the driver's entry point. |
398 | | @param DriverBinding A Driver Binding Protocol instance that this driver is producing. |
399 | | @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this |
400 | | parameter is NULL, then a new handle is created. |
401 | | @param ComponentName A Component Name Protocol instance that this driver is producing. |
402 | | @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing. |
403 | | |
404 | | @retval EFI_SUCCESS The protocol installation successfully completed. |
405 | | @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols. |
406 | | |
407 | | **/ |
408 | | EFI_STATUS |
409 | | EFIAPI |
410 | | EfiLibInstallDriverBindingComponentName2 ( |
411 | | IN CONST EFI_HANDLE ImageHandle, |
412 | | IN CONST EFI_SYSTEM_TABLE *SystemTable, |
413 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
414 | | IN EFI_HANDLE DriverBindingHandle, |
415 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
416 | | IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL |
417 | | ) |
418 | 0 | { |
419 | 0 | EFI_STATUS Status; |
420 | |
|
421 | 0 | ASSERT (DriverBinding != NULL); |
422 | | |
423 | | // |
424 | | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol |
425 | | // |
426 | 0 | DriverBinding->ImageHandle = ImageHandle; |
427 | 0 | DriverBinding->DriverBindingHandle = DriverBindingHandle; |
428 | |
|
429 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
430 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
431 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
432 | 0 | &DriverBinding->DriverBindingHandle, |
433 | 0 | &gEfiDriverBindingProtocolGuid, |
434 | 0 | DriverBinding, |
435 | 0 | NULL |
436 | 0 | ); |
437 | 0 | } else { |
438 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
439 | 0 | &DriverBinding->DriverBindingHandle, |
440 | 0 | &gEfiDriverBindingProtocolGuid, |
441 | 0 | DriverBinding, |
442 | 0 | &gEfiComponentName2ProtocolGuid, |
443 | 0 | ComponentName2, |
444 | 0 | NULL |
445 | 0 | ); |
446 | 0 | } |
447 | 0 | } else { |
448 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
449 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
450 | 0 | &DriverBinding->DriverBindingHandle, |
451 | 0 | &gEfiDriverBindingProtocolGuid, |
452 | 0 | DriverBinding, |
453 | 0 | &gEfiComponentNameProtocolGuid, |
454 | 0 | ComponentName, |
455 | 0 | NULL |
456 | 0 | ); |
457 | 0 | } else { |
458 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
459 | 0 | &DriverBinding->DriverBindingHandle, |
460 | 0 | &gEfiDriverBindingProtocolGuid, |
461 | 0 | DriverBinding, |
462 | 0 | &gEfiComponentNameProtocolGuid, |
463 | 0 | ComponentName, |
464 | 0 | &gEfiComponentName2ProtocolGuid, |
465 | 0 | ComponentName2, |
466 | 0 | NULL |
467 | 0 | ); |
468 | 0 | } |
469 | 0 | } |
470 | | |
471 | | // |
472 | | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed |
473 | | // |
474 | 0 | ASSERT_EFI_ERROR (Status); |
475 | |
|
476 | 0 | return Status; |
477 | 0 | } |
478 | | |
479 | | /** |
480 | | Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols. |
481 | | |
482 | | If DriverBinding is NULL, then ASSERT(). |
483 | | If the uninstallation fails, then ASSERT(). |
484 | | |
485 | | @param DriverBinding A Driver Binding Protocol instance that this driver produced. |
486 | | @param ComponentName A Component Name Protocol instance that this driver produced. |
487 | | @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. |
488 | | |
489 | | @retval EFI_SUCCESS The protocol installation successfully completed. |
490 | | @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). |
491 | | |
492 | | **/ |
493 | | EFI_STATUS |
494 | | EFIAPI |
495 | | EfiLibUninstallDriverBindingComponentName2 ( |
496 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
497 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
498 | | IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL |
499 | | ) |
500 | 0 | { |
501 | 0 | EFI_STATUS Status; |
502 | |
|
503 | 0 | ASSERT (DriverBinding != NULL); |
504 | |
|
505 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
506 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
507 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
508 | 0 | DriverBinding->DriverBindingHandle, |
509 | 0 | &gEfiDriverBindingProtocolGuid, |
510 | 0 | DriverBinding, |
511 | 0 | NULL |
512 | 0 | ); |
513 | 0 | } else { |
514 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
515 | 0 | DriverBinding->DriverBindingHandle, |
516 | 0 | &gEfiDriverBindingProtocolGuid, |
517 | 0 | DriverBinding, |
518 | 0 | &gEfiComponentName2ProtocolGuid, |
519 | 0 | ComponentName2, |
520 | 0 | NULL |
521 | 0 | ); |
522 | 0 | } |
523 | 0 | } else { |
524 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
525 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
526 | 0 | DriverBinding->DriverBindingHandle, |
527 | 0 | &gEfiDriverBindingProtocolGuid, |
528 | 0 | DriverBinding, |
529 | 0 | &gEfiComponentNameProtocolGuid, |
530 | 0 | ComponentName, |
531 | 0 | NULL |
532 | 0 | ); |
533 | 0 | } else { |
534 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
535 | 0 | DriverBinding->DriverBindingHandle, |
536 | 0 | &gEfiDriverBindingProtocolGuid, |
537 | 0 | DriverBinding, |
538 | 0 | &gEfiComponentNameProtocolGuid, |
539 | 0 | ComponentName, |
540 | 0 | &gEfiComponentName2ProtocolGuid, |
541 | 0 | ComponentName2, |
542 | 0 | NULL |
543 | 0 | ); |
544 | 0 | } |
545 | 0 | } |
546 | | |
547 | | // |
548 | | // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed |
549 | | // |
550 | 0 | ASSERT_EFI_ERROR (Status); |
551 | |
|
552 | 0 | return Status; |
553 | 0 | } |
554 | | |
555 | | /** |
556 | | Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver |
557 | | Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. |
558 | | |
559 | | Initializes a driver by installing the Driver Binding Protocol together with the optional |
560 | | Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2, |
561 | | optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle. |
562 | | DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver |
563 | | produces multiple Driver Binding Protocols. |
564 | | If DriverBinding is NULL, then ASSERT(). |
565 | | If the installation fails, then ASSERT(). |
566 | | |
567 | | |
568 | | @param ImageHandle The image handle of the driver. |
569 | | @param SystemTable The EFI System Table that was passed to the driver's entry point. |
570 | | @param DriverBinding A Driver Binding Protocol instance that this driver is producing. |
571 | | @param DriverBindingHandle The handle that DriverBinding is to be installed onto. If this |
572 | | parameter is NULL, then a new handle is created. |
573 | | @param ComponentName A Component Name Protocol instance that this driver is producing. |
574 | | @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing. |
575 | | @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing. |
576 | | @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver is producing. |
577 | | @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing. |
578 | | @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing. |
579 | | |
580 | | @retval EFI_SUCCESS The protocol installation successfully completed. |
581 | | @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols. |
582 | | |
583 | | **/ |
584 | | EFI_STATUS |
585 | | EFIAPI |
586 | | EfiLibInstallAllDriverProtocols2 ( |
587 | | IN CONST EFI_HANDLE ImageHandle, |
588 | | IN CONST EFI_SYSTEM_TABLE *SystemTable, |
589 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
590 | | IN EFI_HANDLE DriverBindingHandle, |
591 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
592 | | IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL, |
593 | | IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, |
594 | | IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2 OPTIONAL, |
595 | | IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL, |
596 | | IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL |
597 | | ) |
598 | 0 | { |
599 | 0 | EFI_STATUS Status; |
600 | |
|
601 | 0 | ASSERT (DriverBinding != NULL); |
602 | | |
603 | | // |
604 | | // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol |
605 | | // |
606 | 0 | DriverBinding->ImageHandle = ImageHandle; |
607 | 0 | DriverBinding->DriverBindingHandle = DriverBindingHandle; |
608 | |
|
609 | 0 | if (DriverConfiguration2 == NULL) { |
610 | 0 | if (DriverConfiguration == NULL) { |
611 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
612 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
613 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
614 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
615 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
616 | 0 | &DriverBinding->DriverBindingHandle, |
617 | 0 | &gEfiDriverBindingProtocolGuid, |
618 | 0 | DriverBinding, |
619 | 0 | NULL |
620 | 0 | ); |
621 | 0 | } else { |
622 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
623 | 0 | &DriverBinding->DriverBindingHandle, |
624 | 0 | &gEfiDriverBindingProtocolGuid, |
625 | 0 | DriverBinding, |
626 | 0 | &gEfiComponentName2ProtocolGuid, |
627 | 0 | ComponentName2, |
628 | 0 | NULL |
629 | 0 | ); |
630 | 0 | } |
631 | 0 | } else { |
632 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
633 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
634 | 0 | &DriverBinding->DriverBindingHandle, |
635 | 0 | &gEfiDriverBindingProtocolGuid, |
636 | 0 | DriverBinding, |
637 | 0 | &gEfiComponentNameProtocolGuid, |
638 | 0 | ComponentName, |
639 | 0 | NULL |
640 | 0 | ); |
641 | 0 | } else { |
642 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
643 | 0 | &DriverBinding->DriverBindingHandle, |
644 | 0 | &gEfiDriverBindingProtocolGuid, |
645 | 0 | DriverBinding, |
646 | 0 | &gEfiComponentNameProtocolGuid, |
647 | 0 | ComponentName, |
648 | 0 | &gEfiComponentName2ProtocolGuid, |
649 | 0 | ComponentName2, |
650 | 0 | NULL |
651 | 0 | ); |
652 | 0 | } |
653 | 0 | } |
654 | 0 | } else { |
655 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
656 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
657 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
658 | 0 | &DriverBinding->DriverBindingHandle, |
659 | 0 | &gEfiDriverBindingProtocolGuid, |
660 | 0 | DriverBinding, |
661 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
662 | 0 | DriverDiagnostics2, |
663 | 0 | NULL |
664 | 0 | ); |
665 | 0 | } else { |
666 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
667 | 0 | &DriverBinding->DriverBindingHandle, |
668 | 0 | &gEfiDriverBindingProtocolGuid, |
669 | 0 | DriverBinding, |
670 | 0 | &gEfiComponentName2ProtocolGuid, |
671 | 0 | ComponentName2, |
672 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
673 | 0 | DriverDiagnostics2, |
674 | 0 | NULL |
675 | 0 | ); |
676 | 0 | } |
677 | 0 | } else { |
678 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
679 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
680 | 0 | &DriverBinding->DriverBindingHandle, |
681 | 0 | &gEfiDriverBindingProtocolGuid, |
682 | 0 | DriverBinding, |
683 | 0 | &gEfiComponentNameProtocolGuid, |
684 | 0 | ComponentName, |
685 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
686 | 0 | DriverDiagnostics2, |
687 | 0 | NULL |
688 | 0 | ); |
689 | 0 | } else { |
690 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
691 | 0 | &DriverBinding->DriverBindingHandle, |
692 | 0 | &gEfiDriverBindingProtocolGuid, |
693 | 0 | DriverBinding, |
694 | 0 | &gEfiComponentNameProtocolGuid, |
695 | 0 | ComponentName, |
696 | 0 | &gEfiComponentName2ProtocolGuid, |
697 | 0 | ComponentName2, |
698 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
699 | 0 | DriverDiagnostics2, |
700 | 0 | NULL |
701 | 0 | ); |
702 | 0 | } |
703 | 0 | } |
704 | 0 | } |
705 | 0 | } else { |
706 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
707 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
708 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
709 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
710 | 0 | &DriverBinding->DriverBindingHandle, |
711 | 0 | &gEfiDriverBindingProtocolGuid, |
712 | 0 | DriverBinding, |
713 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
714 | 0 | DriverDiagnostics, |
715 | 0 | NULL |
716 | 0 | ); |
717 | 0 | } else { |
718 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
719 | 0 | &DriverBinding->DriverBindingHandle, |
720 | 0 | &gEfiDriverBindingProtocolGuid, |
721 | 0 | DriverBinding, |
722 | 0 | &gEfiComponentName2ProtocolGuid, |
723 | 0 | ComponentName2, |
724 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
725 | 0 | DriverDiagnostics, |
726 | 0 | NULL |
727 | 0 | ); |
728 | 0 | } |
729 | 0 | } else { |
730 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
731 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
732 | 0 | &DriverBinding->DriverBindingHandle, |
733 | 0 | &gEfiDriverBindingProtocolGuid, |
734 | 0 | DriverBinding, |
735 | 0 | &gEfiComponentNameProtocolGuid, |
736 | 0 | ComponentName, |
737 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
738 | 0 | DriverDiagnostics, |
739 | 0 | NULL |
740 | 0 | ); |
741 | 0 | } else { |
742 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
743 | 0 | &DriverBinding->DriverBindingHandle, |
744 | 0 | &gEfiDriverBindingProtocolGuid, |
745 | 0 | DriverBinding, |
746 | 0 | &gEfiComponentNameProtocolGuid, |
747 | 0 | ComponentName, |
748 | 0 | &gEfiComponentName2ProtocolGuid, |
749 | 0 | ComponentName2, |
750 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
751 | 0 | DriverDiagnostics, |
752 | 0 | NULL |
753 | 0 | ); |
754 | 0 | } |
755 | 0 | } |
756 | 0 | } else { |
757 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
758 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
759 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
760 | 0 | &DriverBinding->DriverBindingHandle, |
761 | 0 | &gEfiDriverBindingProtocolGuid, |
762 | 0 | DriverBinding, |
763 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
764 | 0 | DriverDiagnostics, |
765 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
766 | 0 | DriverDiagnostics2, |
767 | 0 | NULL |
768 | 0 | ); |
769 | 0 | } else { |
770 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
771 | 0 | &DriverBinding->DriverBindingHandle, |
772 | 0 | &gEfiDriverBindingProtocolGuid, |
773 | 0 | DriverBinding, |
774 | 0 | &gEfiComponentName2ProtocolGuid, |
775 | 0 | ComponentName2, |
776 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
777 | 0 | DriverDiagnostics, |
778 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
779 | 0 | DriverDiagnostics2, |
780 | 0 | NULL |
781 | 0 | ); |
782 | 0 | } |
783 | 0 | } else { |
784 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
785 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
786 | 0 | &DriverBinding->DriverBindingHandle, |
787 | 0 | &gEfiDriverBindingProtocolGuid, |
788 | 0 | DriverBinding, |
789 | 0 | &gEfiComponentNameProtocolGuid, |
790 | 0 | ComponentName, |
791 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
792 | 0 | DriverDiagnostics, |
793 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
794 | 0 | DriverDiagnostics2, |
795 | 0 | NULL |
796 | 0 | ); |
797 | 0 | } else { |
798 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
799 | 0 | &DriverBinding->DriverBindingHandle, |
800 | 0 | &gEfiDriverBindingProtocolGuid, |
801 | 0 | DriverBinding, |
802 | 0 | &gEfiComponentNameProtocolGuid, |
803 | 0 | ComponentName, |
804 | 0 | &gEfiComponentName2ProtocolGuid, |
805 | 0 | ComponentName2, |
806 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
807 | 0 | DriverDiagnostics, |
808 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
809 | 0 | DriverDiagnostics2, |
810 | 0 | NULL |
811 | 0 | ); |
812 | 0 | } |
813 | 0 | } |
814 | 0 | } |
815 | 0 | } |
816 | 0 | } else { |
817 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
818 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
819 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
820 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
821 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
822 | 0 | &DriverBinding->DriverBindingHandle, |
823 | 0 | &gEfiDriverBindingProtocolGuid, |
824 | 0 | DriverBinding, |
825 | 0 | &gEfiDriverConfigurationProtocolGuid, |
826 | 0 | DriverConfiguration, |
827 | 0 | NULL |
828 | 0 | ); |
829 | 0 | } else { |
830 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
831 | 0 | &DriverBinding->DriverBindingHandle, |
832 | 0 | &gEfiDriverBindingProtocolGuid, |
833 | 0 | DriverBinding, |
834 | 0 | &gEfiComponentName2ProtocolGuid, |
835 | 0 | ComponentName2, |
836 | 0 | &gEfiDriverConfigurationProtocolGuid, |
837 | 0 | DriverConfiguration, |
838 | 0 | NULL |
839 | 0 | ); |
840 | 0 | } |
841 | 0 | } else { |
842 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
843 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
844 | 0 | &DriverBinding->DriverBindingHandle, |
845 | 0 | &gEfiDriverBindingProtocolGuid, |
846 | 0 | DriverBinding, |
847 | 0 | &gEfiComponentNameProtocolGuid, |
848 | 0 | ComponentName, |
849 | 0 | &gEfiDriverConfigurationProtocolGuid, |
850 | 0 | DriverConfiguration, |
851 | 0 | NULL |
852 | 0 | ); |
853 | 0 | } else { |
854 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
855 | 0 | &DriverBinding->DriverBindingHandle, |
856 | 0 | &gEfiDriverBindingProtocolGuid, |
857 | 0 | DriverBinding, |
858 | 0 | &gEfiComponentNameProtocolGuid, |
859 | 0 | ComponentName, |
860 | 0 | &gEfiComponentName2ProtocolGuid, |
861 | 0 | ComponentName2, |
862 | 0 | &gEfiDriverConfigurationProtocolGuid, |
863 | 0 | DriverConfiguration, |
864 | 0 | NULL |
865 | 0 | ); |
866 | 0 | } |
867 | 0 | } |
868 | 0 | } else { |
869 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
870 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
871 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
872 | 0 | &DriverBinding->DriverBindingHandle, |
873 | 0 | &gEfiDriverBindingProtocolGuid, |
874 | 0 | DriverBinding, |
875 | 0 | &gEfiDriverConfigurationProtocolGuid, |
876 | 0 | DriverConfiguration, |
877 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
878 | 0 | DriverDiagnostics2, |
879 | 0 | NULL |
880 | 0 | ); |
881 | 0 | } else { |
882 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
883 | 0 | &DriverBinding->DriverBindingHandle, |
884 | 0 | &gEfiDriverBindingProtocolGuid, |
885 | 0 | DriverBinding, |
886 | 0 | &gEfiComponentName2ProtocolGuid, |
887 | 0 | ComponentName2, |
888 | 0 | &gEfiDriverConfigurationProtocolGuid, |
889 | 0 | DriverConfiguration, |
890 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
891 | 0 | DriverDiagnostics2, |
892 | 0 | NULL |
893 | 0 | ); |
894 | 0 | } |
895 | 0 | } else { |
896 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
897 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
898 | 0 | &DriverBinding->DriverBindingHandle, |
899 | 0 | &gEfiDriverBindingProtocolGuid, |
900 | 0 | DriverBinding, |
901 | 0 | &gEfiComponentNameProtocolGuid, |
902 | 0 | ComponentName, |
903 | 0 | &gEfiDriverConfigurationProtocolGuid, |
904 | 0 | DriverConfiguration, |
905 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
906 | 0 | DriverDiagnostics2, |
907 | 0 | NULL |
908 | 0 | ); |
909 | 0 | } else { |
910 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
911 | 0 | &DriverBinding->DriverBindingHandle, |
912 | 0 | &gEfiDriverBindingProtocolGuid, |
913 | 0 | DriverBinding, |
914 | 0 | &gEfiComponentNameProtocolGuid, |
915 | 0 | ComponentName, |
916 | 0 | &gEfiComponentName2ProtocolGuid, |
917 | 0 | ComponentName2, |
918 | 0 | &gEfiDriverConfigurationProtocolGuid, |
919 | 0 | DriverConfiguration, |
920 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
921 | 0 | DriverDiagnostics2, |
922 | 0 | NULL |
923 | 0 | ); |
924 | 0 | } |
925 | 0 | } |
926 | 0 | } |
927 | 0 | } else { |
928 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
929 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
930 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
931 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
932 | 0 | &DriverBinding->DriverBindingHandle, |
933 | 0 | &gEfiDriverBindingProtocolGuid, |
934 | 0 | DriverBinding, |
935 | 0 | &gEfiDriverConfigurationProtocolGuid, |
936 | 0 | DriverConfiguration, |
937 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
938 | 0 | DriverDiagnostics, |
939 | 0 | NULL |
940 | 0 | ); |
941 | 0 | } else { |
942 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
943 | 0 | &DriverBinding->DriverBindingHandle, |
944 | 0 | &gEfiDriverBindingProtocolGuid, |
945 | 0 | DriverBinding, |
946 | 0 | &gEfiComponentName2ProtocolGuid, |
947 | 0 | ComponentName2, |
948 | 0 | &gEfiDriverConfigurationProtocolGuid, |
949 | 0 | DriverConfiguration, |
950 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
951 | 0 | DriverDiagnostics, |
952 | 0 | NULL |
953 | 0 | ); |
954 | 0 | } |
955 | 0 | } else { |
956 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
957 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
958 | 0 | &DriverBinding->DriverBindingHandle, |
959 | 0 | &gEfiDriverBindingProtocolGuid, |
960 | 0 | DriverBinding, |
961 | 0 | &gEfiComponentNameProtocolGuid, |
962 | 0 | ComponentName, |
963 | 0 | &gEfiDriverConfigurationProtocolGuid, |
964 | 0 | DriverConfiguration, |
965 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
966 | 0 | DriverDiagnostics, |
967 | 0 | NULL |
968 | 0 | ); |
969 | 0 | } else { |
970 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
971 | 0 | &DriverBinding->DriverBindingHandle, |
972 | 0 | &gEfiDriverBindingProtocolGuid, |
973 | 0 | DriverBinding, |
974 | 0 | &gEfiComponentNameProtocolGuid, |
975 | 0 | ComponentName, |
976 | 0 | &gEfiComponentName2ProtocolGuid, |
977 | 0 | ComponentName2, |
978 | 0 | &gEfiDriverConfigurationProtocolGuid, |
979 | 0 | DriverConfiguration, |
980 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
981 | 0 | DriverDiagnostics, |
982 | 0 | NULL |
983 | 0 | ); |
984 | 0 | } |
985 | 0 | } |
986 | 0 | } else { |
987 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
988 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
989 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
990 | 0 | &DriverBinding->DriverBindingHandle, |
991 | 0 | &gEfiDriverBindingProtocolGuid, |
992 | 0 | DriverBinding, |
993 | 0 | &gEfiDriverConfigurationProtocolGuid, |
994 | 0 | DriverConfiguration, |
995 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
996 | 0 | DriverDiagnostics, |
997 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
998 | 0 | DriverDiagnostics2, |
999 | 0 | NULL |
1000 | 0 | ); |
1001 | 0 | } else { |
1002 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1003 | 0 | &DriverBinding->DriverBindingHandle, |
1004 | 0 | &gEfiDriverBindingProtocolGuid, |
1005 | 0 | DriverBinding, |
1006 | 0 | &gEfiComponentName2ProtocolGuid, |
1007 | 0 | ComponentName2, |
1008 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1009 | 0 | DriverConfiguration, |
1010 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1011 | 0 | DriverDiagnostics, |
1012 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1013 | 0 | DriverDiagnostics2, |
1014 | 0 | NULL |
1015 | 0 | ); |
1016 | 0 | } |
1017 | 0 | } else { |
1018 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1019 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1020 | 0 | &DriverBinding->DriverBindingHandle, |
1021 | 0 | &gEfiDriverBindingProtocolGuid, |
1022 | 0 | DriverBinding, |
1023 | 0 | &gEfiComponentNameProtocolGuid, |
1024 | 0 | ComponentName, |
1025 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1026 | 0 | DriverConfiguration, |
1027 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1028 | 0 | DriverDiagnostics, |
1029 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1030 | 0 | DriverDiagnostics2, |
1031 | 0 | NULL |
1032 | 0 | ); |
1033 | 0 | } else { |
1034 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1035 | 0 | &DriverBinding->DriverBindingHandle, |
1036 | 0 | &gEfiDriverBindingProtocolGuid, |
1037 | 0 | DriverBinding, |
1038 | 0 | &gEfiComponentNameProtocolGuid, |
1039 | 0 | ComponentName, |
1040 | 0 | &gEfiComponentName2ProtocolGuid, |
1041 | 0 | ComponentName2, |
1042 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1043 | 0 | DriverConfiguration, |
1044 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1045 | 0 | DriverDiagnostics, |
1046 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1047 | 0 | DriverDiagnostics2, |
1048 | 0 | NULL |
1049 | 0 | ); |
1050 | 0 | } |
1051 | 0 | } |
1052 | 0 | } |
1053 | 0 | } |
1054 | 0 | } |
1055 | 0 | } else { |
1056 | 0 | if (DriverConfiguration == NULL) { |
1057 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
1058 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1059 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1060 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1061 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1062 | 0 | &DriverBinding->DriverBindingHandle, |
1063 | 0 | &gEfiDriverBindingProtocolGuid, |
1064 | 0 | DriverBinding, |
1065 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1066 | 0 | DriverConfiguration2, |
1067 | 0 | NULL |
1068 | 0 | ); |
1069 | 0 | } else { |
1070 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1071 | 0 | &DriverBinding->DriverBindingHandle, |
1072 | 0 | &gEfiDriverBindingProtocolGuid, |
1073 | 0 | DriverBinding, |
1074 | 0 | &gEfiComponentName2ProtocolGuid, |
1075 | 0 | ComponentName2, |
1076 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1077 | 0 | DriverConfiguration2, |
1078 | 0 | NULL |
1079 | 0 | ); |
1080 | 0 | } |
1081 | 0 | } else { |
1082 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1083 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1084 | 0 | &DriverBinding->DriverBindingHandle, |
1085 | 0 | &gEfiDriverBindingProtocolGuid, |
1086 | 0 | DriverBinding, |
1087 | 0 | &gEfiComponentNameProtocolGuid, |
1088 | 0 | ComponentName, |
1089 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1090 | 0 | DriverConfiguration2, |
1091 | 0 | NULL |
1092 | 0 | ); |
1093 | 0 | } else { |
1094 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1095 | 0 | &DriverBinding->DriverBindingHandle, |
1096 | 0 | &gEfiDriverBindingProtocolGuid, |
1097 | 0 | DriverBinding, |
1098 | 0 | &gEfiComponentNameProtocolGuid, |
1099 | 0 | ComponentName, |
1100 | 0 | &gEfiComponentName2ProtocolGuid, |
1101 | 0 | ComponentName2, |
1102 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1103 | 0 | DriverConfiguration2, |
1104 | 0 | NULL |
1105 | 0 | ); |
1106 | 0 | } |
1107 | 0 | } |
1108 | 0 | } else { |
1109 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1110 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1111 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1112 | 0 | &DriverBinding->DriverBindingHandle, |
1113 | 0 | &gEfiDriverBindingProtocolGuid, |
1114 | 0 | DriverBinding, |
1115 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1116 | 0 | DriverDiagnostics2, |
1117 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1118 | 0 | DriverConfiguration2, |
1119 | 0 | NULL |
1120 | 0 | ); |
1121 | 0 | } else { |
1122 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1123 | 0 | &DriverBinding->DriverBindingHandle, |
1124 | 0 | &gEfiDriverBindingProtocolGuid, |
1125 | 0 | DriverBinding, |
1126 | 0 | &gEfiComponentName2ProtocolGuid, |
1127 | 0 | ComponentName2, |
1128 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1129 | 0 | DriverConfiguration2, |
1130 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1131 | 0 | DriverDiagnostics2, |
1132 | 0 | NULL |
1133 | 0 | ); |
1134 | 0 | } |
1135 | 0 | } else { |
1136 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1137 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1138 | 0 | &DriverBinding->DriverBindingHandle, |
1139 | 0 | &gEfiDriverBindingProtocolGuid, |
1140 | 0 | DriverBinding, |
1141 | 0 | &gEfiComponentNameProtocolGuid, |
1142 | 0 | ComponentName, |
1143 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1144 | 0 | DriverConfiguration2, |
1145 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1146 | 0 | DriverDiagnostics2, |
1147 | 0 | NULL |
1148 | 0 | ); |
1149 | 0 | } else { |
1150 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1151 | 0 | &DriverBinding->DriverBindingHandle, |
1152 | 0 | &gEfiDriverBindingProtocolGuid, |
1153 | 0 | DriverBinding, |
1154 | 0 | &gEfiComponentNameProtocolGuid, |
1155 | 0 | ComponentName, |
1156 | 0 | &gEfiComponentName2ProtocolGuid, |
1157 | 0 | ComponentName2, |
1158 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1159 | 0 | DriverConfiguration2, |
1160 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1161 | 0 | DriverDiagnostics2, |
1162 | 0 | NULL |
1163 | 0 | ); |
1164 | 0 | } |
1165 | 0 | } |
1166 | 0 | } |
1167 | 0 | } else { |
1168 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1169 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1170 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1171 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1172 | 0 | &DriverBinding->DriverBindingHandle, |
1173 | 0 | &gEfiDriverBindingProtocolGuid, |
1174 | 0 | DriverBinding, |
1175 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1176 | 0 | DriverDiagnostics, |
1177 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1178 | 0 | DriverConfiguration2, |
1179 | 0 | NULL |
1180 | 0 | ); |
1181 | 0 | } else { |
1182 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1183 | 0 | &DriverBinding->DriverBindingHandle, |
1184 | 0 | &gEfiDriverBindingProtocolGuid, |
1185 | 0 | DriverBinding, |
1186 | 0 | &gEfiComponentName2ProtocolGuid, |
1187 | 0 | ComponentName2, |
1188 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1189 | 0 | DriverConfiguration2, |
1190 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1191 | 0 | DriverDiagnostics, |
1192 | 0 | NULL |
1193 | 0 | ); |
1194 | 0 | } |
1195 | 0 | } else { |
1196 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1197 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1198 | 0 | &DriverBinding->DriverBindingHandle, |
1199 | 0 | &gEfiDriverBindingProtocolGuid, |
1200 | 0 | DriverBinding, |
1201 | 0 | &gEfiComponentNameProtocolGuid, |
1202 | 0 | ComponentName, |
1203 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1204 | 0 | DriverDiagnostics, |
1205 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1206 | 0 | DriverConfiguration2, |
1207 | 0 | NULL |
1208 | 0 | ); |
1209 | 0 | } else { |
1210 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1211 | 0 | &DriverBinding->DriverBindingHandle, |
1212 | 0 | &gEfiDriverBindingProtocolGuid, |
1213 | 0 | DriverBinding, |
1214 | 0 | &gEfiComponentNameProtocolGuid, |
1215 | 0 | ComponentName, |
1216 | 0 | &gEfiComponentName2ProtocolGuid, |
1217 | 0 | ComponentName2, |
1218 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1219 | 0 | DriverConfiguration2, |
1220 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1221 | 0 | DriverDiagnostics, |
1222 | 0 | NULL |
1223 | 0 | ); |
1224 | 0 | } |
1225 | 0 | } |
1226 | 0 | } else { |
1227 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1228 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1229 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1230 | 0 | &DriverBinding->DriverBindingHandle, |
1231 | 0 | &gEfiDriverBindingProtocolGuid, |
1232 | 0 | DriverBinding, |
1233 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1234 | 0 | DriverConfiguration2, |
1235 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1236 | 0 | DriverDiagnostics, |
1237 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1238 | 0 | DriverDiagnostics2, |
1239 | 0 | NULL |
1240 | 0 | ); |
1241 | 0 | } else { |
1242 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1243 | 0 | &DriverBinding->DriverBindingHandle, |
1244 | 0 | &gEfiDriverBindingProtocolGuid, |
1245 | 0 | DriverBinding, |
1246 | 0 | &gEfiComponentName2ProtocolGuid, |
1247 | 0 | ComponentName2, |
1248 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1249 | 0 | DriverConfiguration2, |
1250 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1251 | 0 | DriverDiagnostics, |
1252 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1253 | 0 | DriverDiagnostics2, |
1254 | 0 | NULL |
1255 | 0 | ); |
1256 | 0 | } |
1257 | 0 | } else { |
1258 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1259 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1260 | 0 | &DriverBinding->DriverBindingHandle, |
1261 | 0 | &gEfiDriverBindingProtocolGuid, |
1262 | 0 | DriverBinding, |
1263 | 0 | &gEfiComponentNameProtocolGuid, |
1264 | 0 | ComponentName, |
1265 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1266 | 0 | DriverConfiguration2, |
1267 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1268 | 0 | DriverDiagnostics, |
1269 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1270 | 0 | DriverDiagnostics2, |
1271 | 0 | NULL |
1272 | 0 | ); |
1273 | 0 | } else { |
1274 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1275 | 0 | &DriverBinding->DriverBindingHandle, |
1276 | 0 | &gEfiDriverBindingProtocolGuid, |
1277 | 0 | DriverBinding, |
1278 | 0 | &gEfiComponentNameProtocolGuid, |
1279 | 0 | ComponentName, |
1280 | 0 | &gEfiComponentName2ProtocolGuid, |
1281 | 0 | ComponentName2, |
1282 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1283 | 0 | DriverConfiguration2, |
1284 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1285 | 0 | DriverDiagnostics, |
1286 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1287 | 0 | DriverDiagnostics2, |
1288 | 0 | NULL |
1289 | 0 | ); |
1290 | 0 | } |
1291 | 0 | } |
1292 | 0 | } |
1293 | 0 | } |
1294 | 0 | } else { |
1295 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
1296 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1297 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1298 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1299 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1300 | 0 | &DriverBinding->DriverBindingHandle, |
1301 | 0 | &gEfiDriverBindingProtocolGuid, |
1302 | 0 | DriverBinding, |
1303 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1304 | 0 | DriverConfiguration, |
1305 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1306 | 0 | DriverConfiguration2, |
1307 | 0 | NULL |
1308 | 0 | ); |
1309 | 0 | } else { |
1310 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1311 | 0 | &DriverBinding->DriverBindingHandle, |
1312 | 0 | &gEfiDriverBindingProtocolGuid, |
1313 | 0 | DriverBinding, |
1314 | 0 | &gEfiComponentName2ProtocolGuid, |
1315 | 0 | ComponentName2, |
1316 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1317 | 0 | DriverConfiguration, |
1318 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1319 | 0 | DriverConfiguration2, |
1320 | 0 | NULL |
1321 | 0 | ); |
1322 | 0 | } |
1323 | 0 | } else { |
1324 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1325 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1326 | 0 | &DriverBinding->DriverBindingHandle, |
1327 | 0 | &gEfiDriverBindingProtocolGuid, |
1328 | 0 | DriverBinding, |
1329 | 0 | &gEfiComponentNameProtocolGuid, |
1330 | 0 | ComponentName, |
1331 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1332 | 0 | DriverConfiguration, |
1333 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1334 | 0 | DriverConfiguration2, |
1335 | 0 | NULL |
1336 | 0 | ); |
1337 | 0 | } else { |
1338 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1339 | 0 | &DriverBinding->DriverBindingHandle, |
1340 | 0 | &gEfiDriverBindingProtocolGuid, |
1341 | 0 | DriverBinding, |
1342 | 0 | &gEfiComponentNameProtocolGuid, |
1343 | 0 | ComponentName, |
1344 | 0 | &gEfiComponentName2ProtocolGuid, |
1345 | 0 | ComponentName2, |
1346 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1347 | 0 | DriverConfiguration, |
1348 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1349 | 0 | DriverConfiguration2, |
1350 | 0 | NULL |
1351 | 0 | ); |
1352 | 0 | } |
1353 | 0 | } |
1354 | 0 | } else { |
1355 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1356 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1357 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1358 | 0 | &DriverBinding->DriverBindingHandle, |
1359 | 0 | &gEfiDriverBindingProtocolGuid, |
1360 | 0 | DriverBinding, |
1361 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1362 | 0 | DriverConfiguration, |
1363 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1364 | 0 | DriverConfiguration2, |
1365 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1366 | 0 | DriverDiagnostics2, |
1367 | 0 | NULL |
1368 | 0 | ); |
1369 | 0 | } else { |
1370 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1371 | 0 | &DriverBinding->DriverBindingHandle, |
1372 | 0 | &gEfiDriverBindingProtocolGuid, |
1373 | 0 | DriverBinding, |
1374 | 0 | &gEfiComponentName2ProtocolGuid, |
1375 | 0 | ComponentName2, |
1376 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1377 | 0 | DriverConfiguration, |
1378 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1379 | 0 | DriverConfiguration2, |
1380 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1381 | 0 | DriverDiagnostics2, |
1382 | 0 | NULL |
1383 | 0 | ); |
1384 | 0 | } |
1385 | 0 | } else { |
1386 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1387 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1388 | 0 | &DriverBinding->DriverBindingHandle, |
1389 | 0 | &gEfiDriverBindingProtocolGuid, |
1390 | 0 | DriverBinding, |
1391 | 0 | &gEfiComponentNameProtocolGuid, |
1392 | 0 | ComponentName, |
1393 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1394 | 0 | DriverConfiguration, |
1395 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1396 | 0 | DriverConfiguration2, |
1397 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1398 | 0 | DriverDiagnostics2, |
1399 | 0 | NULL |
1400 | 0 | ); |
1401 | 0 | } else { |
1402 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1403 | 0 | &DriverBinding->DriverBindingHandle, |
1404 | 0 | &gEfiDriverBindingProtocolGuid, |
1405 | 0 | DriverBinding, |
1406 | 0 | &gEfiComponentNameProtocolGuid, |
1407 | 0 | ComponentName, |
1408 | 0 | &gEfiComponentName2ProtocolGuid, |
1409 | 0 | ComponentName2, |
1410 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1411 | 0 | DriverConfiguration, |
1412 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1413 | 0 | DriverConfiguration2, |
1414 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1415 | 0 | DriverDiagnostics2, |
1416 | 0 | NULL |
1417 | 0 | ); |
1418 | 0 | } |
1419 | 0 | } |
1420 | 0 | } |
1421 | 0 | } else { |
1422 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1423 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1424 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1425 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1426 | 0 | &DriverBinding->DriverBindingHandle, |
1427 | 0 | &gEfiDriverBindingProtocolGuid, |
1428 | 0 | DriverBinding, |
1429 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1430 | 0 | DriverConfiguration, |
1431 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1432 | 0 | DriverConfiguration2, |
1433 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1434 | 0 | DriverDiagnostics, |
1435 | 0 | NULL |
1436 | 0 | ); |
1437 | 0 | } else { |
1438 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1439 | 0 | &DriverBinding->DriverBindingHandle, |
1440 | 0 | &gEfiDriverBindingProtocolGuid, |
1441 | 0 | DriverBinding, |
1442 | 0 | &gEfiComponentName2ProtocolGuid, |
1443 | 0 | ComponentName2, |
1444 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1445 | 0 | DriverConfiguration, |
1446 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1447 | 0 | DriverConfiguration2, |
1448 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1449 | 0 | DriverDiagnostics, |
1450 | 0 | NULL |
1451 | 0 | ); |
1452 | 0 | } |
1453 | 0 | } else { |
1454 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1455 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1456 | 0 | &DriverBinding->DriverBindingHandle, |
1457 | 0 | &gEfiDriverBindingProtocolGuid, |
1458 | 0 | DriverBinding, |
1459 | 0 | &gEfiComponentNameProtocolGuid, |
1460 | 0 | ComponentName, |
1461 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1462 | 0 | DriverConfiguration, |
1463 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1464 | 0 | DriverConfiguration2, |
1465 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1466 | 0 | DriverDiagnostics, |
1467 | 0 | NULL |
1468 | 0 | ); |
1469 | 0 | } else { |
1470 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1471 | 0 | &DriverBinding->DriverBindingHandle, |
1472 | 0 | &gEfiDriverBindingProtocolGuid, |
1473 | 0 | DriverBinding, |
1474 | 0 | &gEfiComponentNameProtocolGuid, |
1475 | 0 | ComponentName, |
1476 | 0 | &gEfiComponentName2ProtocolGuid, |
1477 | 0 | ComponentName2, |
1478 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1479 | 0 | DriverConfiguration, |
1480 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1481 | 0 | DriverConfiguration2, |
1482 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1483 | 0 | DriverDiagnostics, |
1484 | 0 | NULL |
1485 | 0 | ); |
1486 | 0 | } |
1487 | 0 | } |
1488 | 0 | } else { |
1489 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1490 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1491 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1492 | 0 | &DriverBinding->DriverBindingHandle, |
1493 | 0 | &gEfiDriverBindingProtocolGuid, |
1494 | 0 | DriverBinding, |
1495 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1496 | 0 | DriverConfiguration, |
1497 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1498 | 0 | DriverConfiguration2, |
1499 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1500 | 0 | DriverDiagnostics, |
1501 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1502 | 0 | DriverDiagnostics2, |
1503 | 0 | NULL |
1504 | 0 | ); |
1505 | 0 | } else { |
1506 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1507 | 0 | &DriverBinding->DriverBindingHandle, |
1508 | 0 | &gEfiDriverBindingProtocolGuid, |
1509 | 0 | DriverBinding, |
1510 | 0 | &gEfiComponentName2ProtocolGuid, |
1511 | 0 | ComponentName2, |
1512 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1513 | 0 | DriverConfiguration, |
1514 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1515 | 0 | DriverConfiguration2, |
1516 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1517 | 0 | DriverDiagnostics, |
1518 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1519 | 0 | DriverDiagnostics2, |
1520 | 0 | NULL |
1521 | 0 | ); |
1522 | 0 | } |
1523 | 0 | } else { |
1524 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1525 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1526 | 0 | &DriverBinding->DriverBindingHandle, |
1527 | 0 | &gEfiDriverBindingProtocolGuid, |
1528 | 0 | DriverBinding, |
1529 | 0 | &gEfiComponentNameProtocolGuid, |
1530 | 0 | ComponentName, |
1531 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1532 | 0 | DriverConfiguration, |
1533 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1534 | 0 | DriverConfiguration2, |
1535 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1536 | 0 | DriverDiagnostics, |
1537 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1538 | 0 | DriverDiagnostics2, |
1539 | 0 | NULL |
1540 | 0 | ); |
1541 | 0 | } else { |
1542 | 0 | Status = gBS->InstallMultipleProtocolInterfaces ( |
1543 | 0 | &DriverBinding->DriverBindingHandle, |
1544 | 0 | &gEfiDriverBindingProtocolGuid, |
1545 | 0 | DriverBinding, |
1546 | 0 | &gEfiComponentNameProtocolGuid, |
1547 | 0 | ComponentName, |
1548 | 0 | &gEfiComponentName2ProtocolGuid, |
1549 | 0 | ComponentName2, |
1550 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1551 | 0 | DriverConfiguration, |
1552 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
1553 | 0 | DriverConfiguration2, |
1554 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1555 | 0 | DriverDiagnostics, |
1556 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1557 | 0 | DriverDiagnostics2, |
1558 | 0 | NULL |
1559 | 0 | ); |
1560 | 0 | } |
1561 | 0 | } |
1562 | 0 | } |
1563 | 0 | } |
1564 | 0 | } |
1565 | 0 | } |
1566 | | |
1567 | | // |
1568 | | // ASSERT if the call to InstallMultipleProtocolInterfaces() failed |
1569 | | // |
1570 | 0 | ASSERT_EFI_ERROR (Status); |
1571 | |
|
1572 | 0 | return Status; |
1573 | 0 | } |
1574 | | |
1575 | | /** |
1576 | | Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver |
1577 | | Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols. |
1578 | | |
1579 | | If DriverBinding is NULL, then ASSERT(). |
1580 | | If the installation fails, then ASSERT(). |
1581 | | |
1582 | | |
1583 | | @param DriverBinding A Driver Binding Protocol instance that this driver produced. |
1584 | | @param ComponentName A Component Name Protocol instance that this driver produced. |
1585 | | @param ComponentName2 A Component Name 2 Protocol instance that this driver produced. |
1586 | | @param DriverConfiguration A Driver Configuration Protocol instance that this driver produced. |
1587 | | @param DriverConfiguration2 A Driver Configuration Protocol 2 instance that this driver produced. |
1588 | | @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver produced. |
1589 | | @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver produced. |
1590 | | |
1591 | | @retval EFI_SUCCESS The protocol uninstallation successfully completed. |
1592 | | @retval Others Status from gBS->UninstallMultipleProtocolInterfaces(). |
1593 | | |
1594 | | **/ |
1595 | | EFI_STATUS |
1596 | | EFIAPI |
1597 | | EfiLibUninstallAllDriverProtocols2 ( |
1598 | | IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, |
1599 | | IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, |
1600 | | IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL, |
1601 | | IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, |
1602 | | IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2 OPTIONAL, |
1603 | | IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL, |
1604 | | IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL |
1605 | | ) |
1606 | 0 | { |
1607 | 0 | EFI_STATUS Status; |
1608 | |
|
1609 | 0 | ASSERT (DriverBinding != NULL); |
1610 | |
|
1611 | 0 | if (DriverConfiguration2 == NULL) { |
1612 | 0 | if (DriverConfiguration == NULL) { |
1613 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
1614 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1615 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1616 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1617 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1618 | 0 | DriverBinding->DriverBindingHandle, |
1619 | 0 | &gEfiDriverBindingProtocolGuid, |
1620 | 0 | DriverBinding, |
1621 | 0 | NULL |
1622 | 0 | ); |
1623 | 0 | } else { |
1624 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1625 | 0 | DriverBinding->DriverBindingHandle, |
1626 | 0 | &gEfiDriverBindingProtocolGuid, |
1627 | 0 | DriverBinding, |
1628 | 0 | &gEfiComponentName2ProtocolGuid, |
1629 | 0 | ComponentName2, |
1630 | 0 | NULL |
1631 | 0 | ); |
1632 | 0 | } |
1633 | 0 | } else { |
1634 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1635 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1636 | 0 | DriverBinding->DriverBindingHandle, |
1637 | 0 | &gEfiDriverBindingProtocolGuid, |
1638 | 0 | DriverBinding, |
1639 | 0 | &gEfiComponentNameProtocolGuid, |
1640 | 0 | ComponentName, |
1641 | 0 | NULL |
1642 | 0 | ); |
1643 | 0 | } else { |
1644 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1645 | 0 | DriverBinding->DriverBindingHandle, |
1646 | 0 | &gEfiDriverBindingProtocolGuid, |
1647 | 0 | DriverBinding, |
1648 | 0 | &gEfiComponentNameProtocolGuid, |
1649 | 0 | ComponentName, |
1650 | 0 | &gEfiComponentName2ProtocolGuid, |
1651 | 0 | ComponentName2, |
1652 | 0 | NULL |
1653 | 0 | ); |
1654 | 0 | } |
1655 | 0 | } |
1656 | 0 | } else { |
1657 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1658 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1659 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1660 | 0 | DriverBinding->DriverBindingHandle, |
1661 | 0 | &gEfiDriverBindingProtocolGuid, |
1662 | 0 | DriverBinding, |
1663 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1664 | 0 | DriverDiagnostics2, |
1665 | 0 | NULL |
1666 | 0 | ); |
1667 | 0 | } else { |
1668 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1669 | 0 | DriverBinding->DriverBindingHandle, |
1670 | 0 | &gEfiDriverBindingProtocolGuid, |
1671 | 0 | DriverBinding, |
1672 | 0 | &gEfiComponentName2ProtocolGuid, |
1673 | 0 | ComponentName2, |
1674 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1675 | 0 | DriverDiagnostics2, |
1676 | 0 | NULL |
1677 | 0 | ); |
1678 | 0 | } |
1679 | 0 | } else { |
1680 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1681 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1682 | 0 | DriverBinding->DriverBindingHandle, |
1683 | 0 | &gEfiDriverBindingProtocolGuid, |
1684 | 0 | DriverBinding, |
1685 | 0 | &gEfiComponentNameProtocolGuid, |
1686 | 0 | ComponentName, |
1687 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1688 | 0 | DriverDiagnostics2, |
1689 | 0 | NULL |
1690 | 0 | ); |
1691 | 0 | } else { |
1692 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1693 | 0 | DriverBinding->DriverBindingHandle, |
1694 | 0 | &gEfiDriverBindingProtocolGuid, |
1695 | 0 | DriverBinding, |
1696 | 0 | &gEfiComponentNameProtocolGuid, |
1697 | 0 | ComponentName, |
1698 | 0 | &gEfiComponentName2ProtocolGuid, |
1699 | 0 | ComponentName2, |
1700 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1701 | 0 | DriverDiagnostics2, |
1702 | 0 | NULL |
1703 | 0 | ); |
1704 | 0 | } |
1705 | 0 | } |
1706 | 0 | } |
1707 | 0 | } else { |
1708 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1709 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1710 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1711 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1712 | 0 | DriverBinding->DriverBindingHandle, |
1713 | 0 | &gEfiDriverBindingProtocolGuid, |
1714 | 0 | DriverBinding, |
1715 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1716 | 0 | DriverDiagnostics, |
1717 | 0 | NULL |
1718 | 0 | ); |
1719 | 0 | } else { |
1720 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1721 | 0 | DriverBinding->DriverBindingHandle, |
1722 | 0 | &gEfiDriverBindingProtocolGuid, |
1723 | 0 | DriverBinding, |
1724 | 0 | &gEfiComponentName2ProtocolGuid, |
1725 | 0 | ComponentName2, |
1726 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1727 | 0 | DriverDiagnostics, |
1728 | 0 | NULL |
1729 | 0 | ); |
1730 | 0 | } |
1731 | 0 | } else { |
1732 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1733 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1734 | 0 | DriverBinding->DriverBindingHandle, |
1735 | 0 | &gEfiDriverBindingProtocolGuid, |
1736 | 0 | DriverBinding, |
1737 | 0 | &gEfiComponentNameProtocolGuid, |
1738 | 0 | ComponentName, |
1739 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1740 | 0 | DriverDiagnostics, |
1741 | 0 | NULL |
1742 | 0 | ); |
1743 | 0 | } else { |
1744 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1745 | 0 | DriverBinding->DriverBindingHandle, |
1746 | 0 | &gEfiDriverBindingProtocolGuid, |
1747 | 0 | DriverBinding, |
1748 | 0 | &gEfiComponentNameProtocolGuid, |
1749 | 0 | ComponentName, |
1750 | 0 | &gEfiComponentName2ProtocolGuid, |
1751 | 0 | ComponentName2, |
1752 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1753 | 0 | DriverDiagnostics, |
1754 | 0 | NULL |
1755 | 0 | ); |
1756 | 0 | } |
1757 | 0 | } |
1758 | 0 | } else { |
1759 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1760 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1761 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1762 | 0 | DriverBinding->DriverBindingHandle, |
1763 | 0 | &gEfiDriverBindingProtocolGuid, |
1764 | 0 | DriverBinding, |
1765 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1766 | 0 | DriverDiagnostics, |
1767 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1768 | 0 | DriverDiagnostics2, |
1769 | 0 | NULL |
1770 | 0 | ); |
1771 | 0 | } else { |
1772 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1773 | 0 | DriverBinding->DriverBindingHandle, |
1774 | 0 | &gEfiDriverBindingProtocolGuid, |
1775 | 0 | DriverBinding, |
1776 | 0 | &gEfiComponentName2ProtocolGuid, |
1777 | 0 | ComponentName2, |
1778 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1779 | 0 | DriverDiagnostics, |
1780 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1781 | 0 | DriverDiagnostics2, |
1782 | 0 | NULL |
1783 | 0 | ); |
1784 | 0 | } |
1785 | 0 | } else { |
1786 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1787 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1788 | 0 | DriverBinding->DriverBindingHandle, |
1789 | 0 | &gEfiDriverBindingProtocolGuid, |
1790 | 0 | DriverBinding, |
1791 | 0 | &gEfiComponentNameProtocolGuid, |
1792 | 0 | ComponentName, |
1793 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1794 | 0 | DriverDiagnostics, |
1795 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1796 | 0 | DriverDiagnostics2, |
1797 | 0 | NULL |
1798 | 0 | ); |
1799 | 0 | } else { |
1800 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1801 | 0 | DriverBinding->DriverBindingHandle, |
1802 | 0 | &gEfiDriverBindingProtocolGuid, |
1803 | 0 | DriverBinding, |
1804 | 0 | &gEfiComponentNameProtocolGuid, |
1805 | 0 | ComponentName, |
1806 | 0 | &gEfiComponentName2ProtocolGuid, |
1807 | 0 | ComponentName2, |
1808 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1809 | 0 | DriverDiagnostics, |
1810 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1811 | 0 | DriverDiagnostics2, |
1812 | 0 | NULL |
1813 | 0 | ); |
1814 | 0 | } |
1815 | 0 | } |
1816 | 0 | } |
1817 | 0 | } |
1818 | 0 | } else { |
1819 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
1820 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1821 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1822 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1823 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1824 | 0 | DriverBinding->DriverBindingHandle, |
1825 | 0 | &gEfiDriverBindingProtocolGuid, |
1826 | 0 | DriverBinding, |
1827 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1828 | 0 | DriverConfiguration, |
1829 | 0 | NULL |
1830 | 0 | ); |
1831 | 0 | } else { |
1832 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1833 | 0 | DriverBinding->DriverBindingHandle, |
1834 | 0 | &gEfiDriverBindingProtocolGuid, |
1835 | 0 | DriverBinding, |
1836 | 0 | &gEfiComponentName2ProtocolGuid, |
1837 | 0 | ComponentName2, |
1838 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1839 | 0 | DriverConfiguration, |
1840 | 0 | NULL |
1841 | 0 | ); |
1842 | 0 | } |
1843 | 0 | } else { |
1844 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1845 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1846 | 0 | DriverBinding->DriverBindingHandle, |
1847 | 0 | &gEfiDriverBindingProtocolGuid, |
1848 | 0 | DriverBinding, |
1849 | 0 | &gEfiComponentNameProtocolGuid, |
1850 | 0 | ComponentName, |
1851 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1852 | 0 | DriverConfiguration, |
1853 | 0 | NULL |
1854 | 0 | ); |
1855 | 0 | } else { |
1856 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1857 | 0 | DriverBinding->DriverBindingHandle, |
1858 | 0 | &gEfiDriverBindingProtocolGuid, |
1859 | 0 | DriverBinding, |
1860 | 0 | &gEfiComponentNameProtocolGuid, |
1861 | 0 | ComponentName, |
1862 | 0 | &gEfiComponentName2ProtocolGuid, |
1863 | 0 | ComponentName2, |
1864 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1865 | 0 | DriverConfiguration, |
1866 | 0 | NULL |
1867 | 0 | ); |
1868 | 0 | } |
1869 | 0 | } |
1870 | 0 | } else { |
1871 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1872 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1873 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1874 | 0 | DriverBinding->DriverBindingHandle, |
1875 | 0 | &gEfiDriverBindingProtocolGuid, |
1876 | 0 | DriverBinding, |
1877 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1878 | 0 | DriverConfiguration, |
1879 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1880 | 0 | DriverDiagnostics2, |
1881 | 0 | NULL |
1882 | 0 | ); |
1883 | 0 | } else { |
1884 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1885 | 0 | DriverBinding->DriverBindingHandle, |
1886 | 0 | &gEfiDriverBindingProtocolGuid, |
1887 | 0 | DriverBinding, |
1888 | 0 | &gEfiComponentName2ProtocolGuid, |
1889 | 0 | ComponentName2, |
1890 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1891 | 0 | DriverConfiguration, |
1892 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1893 | 0 | DriverDiagnostics2, |
1894 | 0 | NULL |
1895 | 0 | ); |
1896 | 0 | } |
1897 | 0 | } else { |
1898 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1899 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1900 | 0 | DriverBinding->DriverBindingHandle, |
1901 | 0 | &gEfiDriverBindingProtocolGuid, |
1902 | 0 | DriverBinding, |
1903 | 0 | &gEfiComponentNameProtocolGuid, |
1904 | 0 | ComponentName, |
1905 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1906 | 0 | DriverConfiguration, |
1907 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1908 | 0 | DriverDiagnostics2, |
1909 | 0 | NULL |
1910 | 0 | ); |
1911 | 0 | } else { |
1912 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1913 | 0 | DriverBinding->DriverBindingHandle, |
1914 | 0 | &gEfiDriverBindingProtocolGuid, |
1915 | 0 | DriverBinding, |
1916 | 0 | &gEfiComponentNameProtocolGuid, |
1917 | 0 | ComponentName, |
1918 | 0 | &gEfiComponentName2ProtocolGuid, |
1919 | 0 | ComponentName2, |
1920 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1921 | 0 | DriverConfiguration, |
1922 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
1923 | 0 | DriverDiagnostics2, |
1924 | 0 | NULL |
1925 | 0 | ); |
1926 | 0 | } |
1927 | 0 | } |
1928 | 0 | } |
1929 | 0 | } else { |
1930 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
1931 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1932 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1933 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1934 | 0 | DriverBinding->DriverBindingHandle, |
1935 | 0 | &gEfiDriverBindingProtocolGuid, |
1936 | 0 | DriverBinding, |
1937 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1938 | 0 | DriverConfiguration, |
1939 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1940 | 0 | DriverDiagnostics, |
1941 | 0 | NULL |
1942 | 0 | ); |
1943 | 0 | } else { |
1944 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1945 | 0 | DriverBinding->DriverBindingHandle, |
1946 | 0 | &gEfiDriverBindingProtocolGuid, |
1947 | 0 | DriverBinding, |
1948 | 0 | &gEfiComponentName2ProtocolGuid, |
1949 | 0 | ComponentName2, |
1950 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1951 | 0 | DriverConfiguration, |
1952 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1953 | 0 | DriverDiagnostics, |
1954 | 0 | NULL |
1955 | 0 | ); |
1956 | 0 | } |
1957 | 0 | } else { |
1958 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1959 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1960 | 0 | DriverBinding->DriverBindingHandle, |
1961 | 0 | &gEfiDriverBindingProtocolGuid, |
1962 | 0 | DriverBinding, |
1963 | 0 | &gEfiComponentNameProtocolGuid, |
1964 | 0 | ComponentName, |
1965 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1966 | 0 | DriverConfiguration, |
1967 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1968 | 0 | DriverDiagnostics, |
1969 | 0 | NULL |
1970 | 0 | ); |
1971 | 0 | } else { |
1972 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1973 | 0 | DriverBinding->DriverBindingHandle, |
1974 | 0 | &gEfiDriverBindingProtocolGuid, |
1975 | 0 | DriverBinding, |
1976 | 0 | &gEfiComponentNameProtocolGuid, |
1977 | 0 | ComponentName, |
1978 | 0 | &gEfiComponentName2ProtocolGuid, |
1979 | 0 | ComponentName2, |
1980 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1981 | 0 | DriverConfiguration, |
1982 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1983 | 0 | DriverDiagnostics, |
1984 | 0 | NULL |
1985 | 0 | ); |
1986 | 0 | } |
1987 | 0 | } |
1988 | 0 | } else { |
1989 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
1990 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
1991 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
1992 | 0 | DriverBinding->DriverBindingHandle, |
1993 | 0 | &gEfiDriverBindingProtocolGuid, |
1994 | 0 | DriverBinding, |
1995 | 0 | &gEfiDriverConfigurationProtocolGuid, |
1996 | 0 | DriverConfiguration, |
1997 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
1998 | 0 | DriverDiagnostics, |
1999 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2000 | 0 | DriverDiagnostics2, |
2001 | 0 | NULL |
2002 | 0 | ); |
2003 | 0 | } else { |
2004 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2005 | 0 | DriverBinding->DriverBindingHandle, |
2006 | 0 | &gEfiDriverBindingProtocolGuid, |
2007 | 0 | DriverBinding, |
2008 | 0 | &gEfiComponentName2ProtocolGuid, |
2009 | 0 | ComponentName2, |
2010 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2011 | 0 | DriverConfiguration, |
2012 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2013 | 0 | DriverDiagnostics, |
2014 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2015 | 0 | DriverDiagnostics2, |
2016 | 0 | NULL |
2017 | 0 | ); |
2018 | 0 | } |
2019 | 0 | } else { |
2020 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2021 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2022 | 0 | DriverBinding->DriverBindingHandle, |
2023 | 0 | &gEfiDriverBindingProtocolGuid, |
2024 | 0 | DriverBinding, |
2025 | 0 | &gEfiComponentNameProtocolGuid, |
2026 | 0 | ComponentName, |
2027 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2028 | 0 | DriverConfiguration, |
2029 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2030 | 0 | DriverDiagnostics, |
2031 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2032 | 0 | DriverDiagnostics2, |
2033 | 0 | NULL |
2034 | 0 | ); |
2035 | 0 | } else { |
2036 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2037 | 0 | DriverBinding->DriverBindingHandle, |
2038 | 0 | &gEfiDriverBindingProtocolGuid, |
2039 | 0 | DriverBinding, |
2040 | 0 | &gEfiComponentNameProtocolGuid, |
2041 | 0 | ComponentName, |
2042 | 0 | &gEfiComponentName2ProtocolGuid, |
2043 | 0 | ComponentName2, |
2044 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2045 | 0 | DriverConfiguration, |
2046 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2047 | 0 | DriverDiagnostics, |
2048 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2049 | 0 | DriverDiagnostics2, |
2050 | 0 | NULL |
2051 | 0 | ); |
2052 | 0 | } |
2053 | 0 | } |
2054 | 0 | } |
2055 | 0 | } |
2056 | 0 | } |
2057 | 0 | } else { |
2058 | 0 | if (DriverConfiguration == NULL) { |
2059 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
2060 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
2061 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2062 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2063 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2064 | 0 | DriverBinding->DriverBindingHandle, |
2065 | 0 | &gEfiDriverBindingProtocolGuid, |
2066 | 0 | DriverBinding, |
2067 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2068 | 0 | DriverConfiguration2, |
2069 | 0 | NULL |
2070 | 0 | ); |
2071 | 0 | } else { |
2072 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2073 | 0 | DriverBinding->DriverBindingHandle, |
2074 | 0 | &gEfiDriverBindingProtocolGuid, |
2075 | 0 | DriverBinding, |
2076 | 0 | &gEfiComponentName2ProtocolGuid, |
2077 | 0 | ComponentName2, |
2078 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2079 | 0 | DriverConfiguration2, |
2080 | 0 | NULL |
2081 | 0 | ); |
2082 | 0 | } |
2083 | 0 | } else { |
2084 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2085 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2086 | 0 | DriverBinding->DriverBindingHandle, |
2087 | 0 | &gEfiDriverBindingProtocolGuid, |
2088 | 0 | DriverBinding, |
2089 | 0 | &gEfiComponentNameProtocolGuid, |
2090 | 0 | ComponentName, |
2091 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2092 | 0 | DriverConfiguration2, |
2093 | 0 | NULL |
2094 | 0 | ); |
2095 | 0 | } else { |
2096 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2097 | 0 | DriverBinding->DriverBindingHandle, |
2098 | 0 | &gEfiDriverBindingProtocolGuid, |
2099 | 0 | DriverBinding, |
2100 | 0 | &gEfiComponentNameProtocolGuid, |
2101 | 0 | ComponentName, |
2102 | 0 | &gEfiComponentName2ProtocolGuid, |
2103 | 0 | ComponentName2, |
2104 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2105 | 0 | DriverConfiguration2, |
2106 | 0 | NULL |
2107 | 0 | ); |
2108 | 0 | } |
2109 | 0 | } |
2110 | 0 | } else { |
2111 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2112 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2113 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2114 | 0 | DriverBinding->DriverBindingHandle, |
2115 | 0 | &gEfiDriverBindingProtocolGuid, |
2116 | 0 | DriverBinding, |
2117 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2118 | 0 | DriverDiagnostics2, |
2119 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2120 | 0 | DriverConfiguration2, |
2121 | 0 | NULL |
2122 | 0 | ); |
2123 | 0 | } else { |
2124 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2125 | 0 | DriverBinding->DriverBindingHandle, |
2126 | 0 | &gEfiDriverBindingProtocolGuid, |
2127 | 0 | DriverBinding, |
2128 | 0 | &gEfiComponentName2ProtocolGuid, |
2129 | 0 | ComponentName2, |
2130 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2131 | 0 | DriverConfiguration2, |
2132 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2133 | 0 | DriverDiagnostics2, |
2134 | 0 | NULL |
2135 | 0 | ); |
2136 | 0 | } |
2137 | 0 | } else { |
2138 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2139 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2140 | 0 | DriverBinding->DriverBindingHandle, |
2141 | 0 | &gEfiDriverBindingProtocolGuid, |
2142 | 0 | DriverBinding, |
2143 | 0 | &gEfiComponentNameProtocolGuid, |
2144 | 0 | ComponentName, |
2145 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2146 | 0 | DriverConfiguration2, |
2147 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2148 | 0 | DriverDiagnostics2, |
2149 | 0 | NULL |
2150 | 0 | ); |
2151 | 0 | } else { |
2152 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2153 | 0 | DriverBinding->DriverBindingHandle, |
2154 | 0 | &gEfiDriverBindingProtocolGuid, |
2155 | 0 | DriverBinding, |
2156 | 0 | &gEfiComponentNameProtocolGuid, |
2157 | 0 | ComponentName, |
2158 | 0 | &gEfiComponentName2ProtocolGuid, |
2159 | 0 | ComponentName2, |
2160 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2161 | 0 | DriverConfiguration2, |
2162 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2163 | 0 | DriverDiagnostics2, |
2164 | 0 | NULL |
2165 | 0 | ); |
2166 | 0 | } |
2167 | 0 | } |
2168 | 0 | } |
2169 | 0 | } else { |
2170 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
2171 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2172 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2173 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2174 | 0 | DriverBinding->DriverBindingHandle, |
2175 | 0 | &gEfiDriverBindingProtocolGuid, |
2176 | 0 | DriverBinding, |
2177 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2178 | 0 | DriverDiagnostics, |
2179 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2180 | 0 | DriverConfiguration2, |
2181 | 0 | NULL |
2182 | 0 | ); |
2183 | 0 | } else { |
2184 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2185 | 0 | DriverBinding->DriverBindingHandle, |
2186 | 0 | &gEfiDriverBindingProtocolGuid, |
2187 | 0 | DriverBinding, |
2188 | 0 | &gEfiComponentName2ProtocolGuid, |
2189 | 0 | ComponentName2, |
2190 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2191 | 0 | DriverConfiguration2, |
2192 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2193 | 0 | DriverDiagnostics, |
2194 | 0 | NULL |
2195 | 0 | ); |
2196 | 0 | } |
2197 | 0 | } else { |
2198 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2199 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2200 | 0 | DriverBinding->DriverBindingHandle, |
2201 | 0 | &gEfiDriverBindingProtocolGuid, |
2202 | 0 | DriverBinding, |
2203 | 0 | &gEfiComponentNameProtocolGuid, |
2204 | 0 | ComponentName, |
2205 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2206 | 0 | DriverDiagnostics, |
2207 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2208 | 0 | DriverConfiguration2, |
2209 | 0 | NULL |
2210 | 0 | ); |
2211 | 0 | } else { |
2212 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2213 | 0 | DriverBinding->DriverBindingHandle, |
2214 | 0 | &gEfiDriverBindingProtocolGuid, |
2215 | 0 | DriverBinding, |
2216 | 0 | &gEfiComponentNameProtocolGuid, |
2217 | 0 | ComponentName, |
2218 | 0 | &gEfiComponentName2ProtocolGuid, |
2219 | 0 | ComponentName2, |
2220 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2221 | 0 | DriverConfiguration2, |
2222 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2223 | 0 | DriverDiagnostics, |
2224 | 0 | NULL |
2225 | 0 | ); |
2226 | 0 | } |
2227 | 0 | } |
2228 | 0 | } else { |
2229 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2230 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2231 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2232 | 0 | DriverBinding->DriverBindingHandle, |
2233 | 0 | &gEfiDriverBindingProtocolGuid, |
2234 | 0 | DriverBinding, |
2235 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2236 | 0 | DriverConfiguration2, |
2237 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2238 | 0 | DriverDiagnostics, |
2239 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2240 | 0 | DriverDiagnostics2, |
2241 | 0 | NULL |
2242 | 0 | ); |
2243 | 0 | } else { |
2244 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2245 | 0 | DriverBinding->DriverBindingHandle, |
2246 | 0 | &gEfiDriverBindingProtocolGuid, |
2247 | 0 | DriverBinding, |
2248 | 0 | &gEfiComponentName2ProtocolGuid, |
2249 | 0 | ComponentName2, |
2250 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2251 | 0 | DriverConfiguration2, |
2252 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2253 | 0 | DriverDiagnostics, |
2254 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2255 | 0 | DriverDiagnostics2, |
2256 | 0 | NULL |
2257 | 0 | ); |
2258 | 0 | } |
2259 | 0 | } else { |
2260 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2261 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2262 | 0 | DriverBinding->DriverBindingHandle, |
2263 | 0 | &gEfiDriverBindingProtocolGuid, |
2264 | 0 | DriverBinding, |
2265 | 0 | &gEfiComponentNameProtocolGuid, |
2266 | 0 | ComponentName, |
2267 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2268 | 0 | DriverConfiguration2, |
2269 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2270 | 0 | DriverDiagnostics, |
2271 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2272 | 0 | DriverDiagnostics2, |
2273 | 0 | NULL |
2274 | 0 | ); |
2275 | 0 | } else { |
2276 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2277 | 0 | DriverBinding->DriverBindingHandle, |
2278 | 0 | &gEfiDriverBindingProtocolGuid, |
2279 | 0 | DriverBinding, |
2280 | 0 | &gEfiComponentNameProtocolGuid, |
2281 | 0 | ComponentName, |
2282 | 0 | &gEfiComponentName2ProtocolGuid, |
2283 | 0 | ComponentName2, |
2284 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2285 | 0 | DriverConfiguration2, |
2286 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2287 | 0 | DriverDiagnostics, |
2288 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2289 | 0 | DriverDiagnostics2, |
2290 | 0 | NULL |
2291 | 0 | ); |
2292 | 0 | } |
2293 | 0 | } |
2294 | 0 | } |
2295 | 0 | } |
2296 | 0 | } else { |
2297 | 0 | if ((DriverDiagnostics == NULL) || FeaturePcdGet (PcdDriverDiagnosticsDisable)) { |
2298 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
2299 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2300 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2301 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2302 | 0 | DriverBinding->DriverBindingHandle, |
2303 | 0 | &gEfiDriverBindingProtocolGuid, |
2304 | 0 | DriverBinding, |
2305 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2306 | 0 | DriverConfiguration, |
2307 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2308 | 0 | DriverConfiguration2, |
2309 | 0 | NULL |
2310 | 0 | ); |
2311 | 0 | } else { |
2312 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2313 | 0 | DriverBinding->DriverBindingHandle, |
2314 | 0 | &gEfiDriverBindingProtocolGuid, |
2315 | 0 | DriverBinding, |
2316 | 0 | &gEfiComponentName2ProtocolGuid, |
2317 | 0 | ComponentName2, |
2318 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2319 | 0 | DriverConfiguration, |
2320 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2321 | 0 | DriverConfiguration2, |
2322 | 0 | NULL |
2323 | 0 | ); |
2324 | 0 | } |
2325 | 0 | } else { |
2326 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2327 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2328 | 0 | DriverBinding->DriverBindingHandle, |
2329 | 0 | &gEfiDriverBindingProtocolGuid, |
2330 | 0 | DriverBinding, |
2331 | 0 | &gEfiComponentNameProtocolGuid, |
2332 | 0 | ComponentName, |
2333 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2334 | 0 | DriverConfiguration, |
2335 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2336 | 0 | DriverConfiguration2, |
2337 | 0 | NULL |
2338 | 0 | ); |
2339 | 0 | } else { |
2340 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2341 | 0 | DriverBinding->DriverBindingHandle, |
2342 | 0 | &gEfiDriverBindingProtocolGuid, |
2343 | 0 | DriverBinding, |
2344 | 0 | &gEfiComponentNameProtocolGuid, |
2345 | 0 | ComponentName, |
2346 | 0 | &gEfiComponentName2ProtocolGuid, |
2347 | 0 | ComponentName2, |
2348 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2349 | 0 | DriverConfiguration, |
2350 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2351 | 0 | DriverConfiguration2, |
2352 | 0 | NULL |
2353 | 0 | ); |
2354 | 0 | } |
2355 | 0 | } |
2356 | 0 | } else { |
2357 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2358 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2359 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2360 | 0 | DriverBinding->DriverBindingHandle, |
2361 | 0 | &gEfiDriverBindingProtocolGuid, |
2362 | 0 | DriverBinding, |
2363 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2364 | 0 | DriverConfiguration, |
2365 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2366 | 0 | DriverConfiguration2, |
2367 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2368 | 0 | DriverDiagnostics2, |
2369 | 0 | NULL |
2370 | 0 | ); |
2371 | 0 | } else { |
2372 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2373 | 0 | DriverBinding->DriverBindingHandle, |
2374 | 0 | &gEfiDriverBindingProtocolGuid, |
2375 | 0 | DriverBinding, |
2376 | 0 | &gEfiComponentName2ProtocolGuid, |
2377 | 0 | ComponentName2, |
2378 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2379 | 0 | DriverConfiguration, |
2380 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2381 | 0 | DriverConfiguration2, |
2382 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2383 | 0 | DriverDiagnostics2, |
2384 | 0 | NULL |
2385 | 0 | ); |
2386 | 0 | } |
2387 | 0 | } else { |
2388 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2389 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2390 | 0 | DriverBinding->DriverBindingHandle, |
2391 | 0 | &gEfiDriverBindingProtocolGuid, |
2392 | 0 | DriverBinding, |
2393 | 0 | &gEfiComponentNameProtocolGuid, |
2394 | 0 | ComponentName, |
2395 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2396 | 0 | DriverConfiguration, |
2397 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2398 | 0 | DriverConfiguration2, |
2399 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2400 | 0 | DriverDiagnostics2, |
2401 | 0 | NULL |
2402 | 0 | ); |
2403 | 0 | } else { |
2404 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2405 | 0 | DriverBinding->DriverBindingHandle, |
2406 | 0 | &gEfiDriverBindingProtocolGuid, |
2407 | 0 | DriverBinding, |
2408 | 0 | &gEfiComponentNameProtocolGuid, |
2409 | 0 | ComponentName, |
2410 | 0 | &gEfiComponentName2ProtocolGuid, |
2411 | 0 | ComponentName2, |
2412 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2413 | 0 | DriverConfiguration, |
2414 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2415 | 0 | DriverConfiguration2, |
2416 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2417 | 0 | DriverDiagnostics2, |
2418 | 0 | NULL |
2419 | 0 | ); |
2420 | 0 | } |
2421 | 0 | } |
2422 | 0 | } |
2423 | 0 | } else { |
2424 | 0 | if ((DriverDiagnostics2 == NULL) || FeaturePcdGet (PcdDriverDiagnostics2Disable)) { |
2425 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2426 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2427 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2428 | 0 | DriverBinding->DriverBindingHandle, |
2429 | 0 | &gEfiDriverBindingProtocolGuid, |
2430 | 0 | DriverBinding, |
2431 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2432 | 0 | DriverConfiguration, |
2433 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2434 | 0 | DriverConfiguration2, |
2435 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2436 | 0 | DriverDiagnostics, |
2437 | 0 | NULL |
2438 | 0 | ); |
2439 | 0 | } else { |
2440 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2441 | 0 | DriverBinding->DriverBindingHandle, |
2442 | 0 | &gEfiDriverBindingProtocolGuid, |
2443 | 0 | DriverBinding, |
2444 | 0 | &gEfiComponentName2ProtocolGuid, |
2445 | 0 | ComponentName2, |
2446 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2447 | 0 | DriverConfiguration, |
2448 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2449 | 0 | DriverConfiguration2, |
2450 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2451 | 0 | DriverDiagnostics, |
2452 | 0 | NULL |
2453 | 0 | ); |
2454 | 0 | } |
2455 | 0 | } else { |
2456 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2457 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2458 | 0 | DriverBinding->DriverBindingHandle, |
2459 | 0 | &gEfiDriverBindingProtocolGuid, |
2460 | 0 | DriverBinding, |
2461 | 0 | &gEfiComponentNameProtocolGuid, |
2462 | 0 | ComponentName, |
2463 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2464 | 0 | DriverConfiguration, |
2465 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2466 | 0 | DriverConfiguration2, |
2467 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2468 | 0 | DriverDiagnostics, |
2469 | 0 | NULL |
2470 | 0 | ); |
2471 | 0 | } else { |
2472 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2473 | 0 | DriverBinding->DriverBindingHandle, |
2474 | 0 | &gEfiDriverBindingProtocolGuid, |
2475 | 0 | DriverBinding, |
2476 | 0 | &gEfiComponentNameProtocolGuid, |
2477 | 0 | ComponentName, |
2478 | 0 | &gEfiComponentName2ProtocolGuid, |
2479 | 0 | ComponentName2, |
2480 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2481 | 0 | DriverConfiguration, |
2482 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2483 | 0 | DriverConfiguration2, |
2484 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2485 | 0 | DriverDiagnostics, |
2486 | 0 | NULL |
2487 | 0 | ); |
2488 | 0 | } |
2489 | 0 | } |
2490 | 0 | } else { |
2491 | 0 | if ((ComponentName == NULL) || FeaturePcdGet (PcdComponentNameDisable)) { |
2492 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2493 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2494 | 0 | DriverBinding->DriverBindingHandle, |
2495 | 0 | &gEfiDriverBindingProtocolGuid, |
2496 | 0 | DriverBinding, |
2497 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2498 | 0 | DriverConfiguration, |
2499 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2500 | 0 | DriverConfiguration2, |
2501 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2502 | 0 | DriverDiagnostics, |
2503 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2504 | 0 | DriverDiagnostics2, |
2505 | 0 | NULL |
2506 | 0 | ); |
2507 | 0 | } else { |
2508 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2509 | 0 | DriverBinding->DriverBindingHandle, |
2510 | 0 | &gEfiDriverBindingProtocolGuid, |
2511 | 0 | DriverBinding, |
2512 | 0 | &gEfiComponentName2ProtocolGuid, |
2513 | 0 | ComponentName2, |
2514 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2515 | 0 | DriverConfiguration, |
2516 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2517 | 0 | DriverConfiguration2, |
2518 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2519 | 0 | DriverDiagnostics, |
2520 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2521 | 0 | DriverDiagnostics2, |
2522 | 0 | NULL |
2523 | 0 | ); |
2524 | 0 | } |
2525 | 0 | } else { |
2526 | 0 | if ((ComponentName2 == NULL) || FeaturePcdGet (PcdComponentName2Disable)) { |
2527 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2528 | 0 | DriverBinding->DriverBindingHandle, |
2529 | 0 | &gEfiDriverBindingProtocolGuid, |
2530 | 0 | DriverBinding, |
2531 | 0 | &gEfiComponentNameProtocolGuid, |
2532 | 0 | ComponentName, |
2533 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2534 | 0 | DriverConfiguration, |
2535 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2536 | 0 | DriverConfiguration2, |
2537 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2538 | 0 | DriverDiagnostics, |
2539 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2540 | 0 | DriverDiagnostics2, |
2541 | 0 | NULL |
2542 | 0 | ); |
2543 | 0 | } else { |
2544 | 0 | Status = gBS->UninstallMultipleProtocolInterfaces ( |
2545 | 0 | DriverBinding->DriverBindingHandle, |
2546 | 0 | &gEfiDriverBindingProtocolGuid, |
2547 | 0 | DriverBinding, |
2548 | 0 | &gEfiComponentNameProtocolGuid, |
2549 | 0 | ComponentName, |
2550 | 0 | &gEfiComponentName2ProtocolGuid, |
2551 | 0 | ComponentName2, |
2552 | 0 | &gEfiDriverConfigurationProtocolGuid, |
2553 | 0 | DriverConfiguration, |
2554 | 0 | &gEfiDriverConfiguration2ProtocolGuid, |
2555 | 0 | DriverConfiguration2, |
2556 | 0 | &gEfiDriverDiagnosticsProtocolGuid, |
2557 | 0 | DriverDiagnostics, |
2558 | 0 | &gEfiDriverDiagnostics2ProtocolGuid, |
2559 | 0 | DriverDiagnostics2, |
2560 | 0 | NULL |
2561 | 0 | ); |
2562 | 0 | } |
2563 | 0 | } |
2564 | 0 | } |
2565 | 0 | } |
2566 | 0 | } |
2567 | 0 | } |
2568 | | |
2569 | | // |
2570 | | // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed |
2571 | | // |
2572 | 0 | ASSERT_EFI_ERROR (Status); |
2573 | |
|
2574 | 0 | return Status; |
2575 | 0 | } |