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