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