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