/* Retrieves this PCI controller's current PCI bus number, device number, and function number. */
STATIC EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
/* Retrieves this PCI controller's current PCI bus number, device number, and function number. */
STATIC EFI_STATUS EFIAPI PciIoGetLocation(IN EFI_PCI_IO_PROTOCOL *This, OUT UINTN *SegmentNumber, OUT UINTN *BusNumber, OUT UINTN *DeviceNumber, OUT UINTN *FunctionNumber)
{
  NON_DISCOVERABLE_PCI_DEVICE  *Dev;
  if ((SegmentNumber == NULL) ||
      (BusNumber == NULL) ||
      (DeviceNumber == NULL) ||
      (FunctionNumber == NULL))
  {
    return EFI_INVALID_PARAMETER;
  }
  Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
  *SegmentNumber  = 0xff;
  *BusNumber      = Dev->UniqueId >> 5;
  *DeviceNumber   = Dev->UniqueId & 0x1f;
  *FunctionNumber = 0;
  return EFI_SUCCESS;
}