+ if (RemainingDevicePath == NULL || IsDevicePathEnd (RemainingDevicePath)) {\r
+ //\r
+ // If RemainingDevicePath is NULL or is the End of Device Path Node\r
+ //\r
+ return EFI_SUCCESS;\r
+ }\r
+ //\r
+ // When the driver has produced device path with flow control node but RemainingDevicePath only contains UART node,\r
+ // return unsupported, and vice versa.\r
+ //\r
+ Status = gBS->OpenProtocolInformation (\r
+ Handle,\r
+ &gEfiUnixIoProtocolGuid,\r
+ &OpenInfoBuffer,\r
+ &EntryCount\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ //\r
+ // See if RemainingDevicePath has a Flow Control device path node\r
+ //\r
+ RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath);\r
+\r
+ for (Index = 0; Index < EntryCount; Index++) {\r
+ if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+ Status = gBS->OpenProtocol (\r
+ OpenInfoBuffer[Index].ControllerHandle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ (VOID **) &DevicePath,\r
+ This->DriverBindingHandle,\r
+ Handle,\r
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) {\r
+ Status = EFI_UNSUPPORTED;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ FreePool (OpenInfoBuffer);\r
+ return Status;\r