/* Retrieves this PCI controller's current PCI bus number, device number, and function number. */
EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *Segment, OUT UINTN *Bus, OUT UINTN *Device, OUT UINTN *Function)
/* Retrieves this PCI controller's current PCI bus number, device number, and function number. */
EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *Segment, OUT UINTN *Bus, OUT UINTN *Device, OUT UINTN *Function)
{
  PCI_IO_DEVICE  *PciIoDevice;
  PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);
  if ((Segment == NULL) || (Bus == NULL) || (Device == NULL) || (Function == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  *Segment  = PciIoDevice->PciRootBridgeIo->SegmentNumber;
  *Bus      = PciIoDevice->BusNumber;
  *Device   = PciIoDevice->DeviceNumber;
  *Function = PciIoDevice->FunctionNumber;
  return EFI_SUCCESS;
}