UINTN EntryCount;\r
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-\r
+ EFI_SERIAL_IO_PROTOCOL *SerialIo;\r
\r
//\r
// Get the list of ISA controllers in the system\r
// We want resource for legacy even if no 32-bit driver installed\r
//\r
for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) {\r
- SioSerial = &SioPtr->Serial[ResourceList->Device.UID];\r
- SioSerial->Address = (UINT16) IoResource->StartRange;\r
- SioSerial->Irq = (UINT8) InterruptResource->StartRange;\r
- SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;\r
+ if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+ Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].AgentHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo);\r
+ if (!EFI_ERROR (Status)) {\r
+ SioSerial = &SioPtr->Serial[ResourceList->Device.UID];\r
+ SioSerial->Address = (UINT16) IoResource->StartRange;\r
+ SioSerial->Irq = (UINT8) InterruptResource->StartRange;\r
+ SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF;\r
+ break;\r
+ }\r
+ }\r
}\r
\r
FreePool (OpenInfoBuffer);\r