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