/* Get Max Option Rom size on specified bridge. */
UINT32 GetMaxOptionRomSize(IN PCI_IO_DEVICE *Bridge)
/* Get Max Option Rom size on specified bridge. */
UINT32 GetMaxOptionRomSize(IN PCI_IO_DEVICE *Bridge)
{
  LIST_ENTRY     *CurrentLink;
  PCI_IO_DEVICE  *Temp;
  UINT32         MaxOptionRomSize;
  UINT32         TempOptionRomSize;
  MaxOptionRomSize = 0;
  CurrentLink = Bridge->ChildList.ForwardLink;
  while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) {
    Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
    if (!IsListEmpty (&Temp->ChildList)) {
      TempOptionRomSize = GetMaxOptionRomSize (Temp);
      if (Temp->RomSize > TempOptionRomSize) {
        TempOptionRomSize = Temp->RomSize;
      }
    } else {
      TempOptionRomSize = Temp->RomSize;
    }
    if (TempOptionRomSize > MaxOptionRomSize) {
      MaxOptionRomSize = TempOptionRomSize;
    }
    CurrentLink = CurrentLink->ForwardLink;
  }
  return MaxOptionRomSize;
}