/* Find out the actual device address according to the requested device address from UsbBus. */
UINT8 XhcPeiBusDevAddrToSlotId(IN PEI_XHC_DEV *Xhc, IN UINT8 BusDevAddr)
/* Find out the actual device address according to the requested device address from UsbBus. */
UINT8 XhcPeiBusDevAddrToSlotId(IN PEI_XHC_DEV *Xhc, IN UINT8 BusDevAddr)
{
  UINT8  Index;
  for (Index = 0; Index < 255; Index++) {
    if (Xhc->UsbDevContext[Index + 1].Enabled &&
        (Xhc->UsbDevContext[Index + 1].SlotId != 0) &&
        (Xhc->UsbDevContext[Index + 1].BusDevAddr == BusDevAddr))
    {
      break;
    }
  }
  if (Index == 255) {
    return 0;
  }
  return Xhc->UsbDevContext[Index + 1].SlotId;
}