/* Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and EFI_PCI_IO_PROTOCOL.Pci.Write(). */
EFI_STATUS EFIAPI PciCapPciIoDeviceInit(IN EFI_PCI_IO_PROTOCOL *PciIo, OUT PCI_CAP_DEV **PciDevice)
/* Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and EFI_PCI_IO_PROTOCOL.Pci.Write(). */
EFI_STATUS EFIAPI PciCapPciIoDeviceInit(IN EFI_PCI_IO_PROTOCOL *PciIo, OUT PCI_CAP_DEV **PciDevice)
{
  PROTO_DEV  *ProtoDev;
  ProtoDev = AllocatePool (sizeof *ProtoDev);
  if (ProtoDev == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  ProtoDev->Signature              = PROTO_DEV_SIG;
  ProtoDev->PciIo                  = PciIo;
  ProtoDev->BaseDevice.ReadConfig  = ProtoDevReadConfig;
  ProtoDev->BaseDevice.WriteConfig = ProtoDevWriteConfig;
  *PciDevice = &ProtoDev->BaseDevice;
  return EFI_SUCCESS;
}