\r
Status = BdsLibConnectDevicePath (DevicePath);\r
if (!EFI_ERROR (Status)) {\r
+\r
//\r
- // If BdsLibConnectDevicePath () succeeded, *Handle must have a non-NULL\r
- // value. So ASSERT that this is the case.\r
+ // We connect all supplied console device paths, but only return the first\r
+ // one that connects successfully via *Handle/*Interface. Note that this\r
+ // may imply that *Handle/*Interface are not updated at all if they have\r
+ // been connected already, e.g., by the console splitter driver.\r
//\r
- gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, Handle);\r
- ASSERT (*Handle != NULL);\r
+ if (*Interface == NULL) {\r
+ //\r
+ // If BdsLibConnectDevicePath () succeeded, *Handle must have a non-NULL\r
+ // value. So ASSERT that this is the case.\r
+ //\r
+ gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, Handle);\r
+ ASSERT (*Handle != NULL);\r
+\r
+ gBS->HandleProtocol (*Handle, Protocol, Interface);\r
+ }\r
}\r
DEBUG_CODE_BEGIN();\r
if (EFI_ERROR(Status)) {\r
}\r
}\r
DEBUG_CODE_END();\r
-\r
- // If the console splitter driver is not supported by the platform then use the first Device Path\r
- // instance for the console interface.\r
- if (!EFI_ERROR(Status) && (*Interface == NULL)) {\r
- Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
- }\r
}\r
\r
// No Device Path has been defined for this console interface. We take the first protocol implementation\r