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