/* Set door bell and wait it to be ACKed by host controller. This function is used to synchronize with the hardware. */
EFI_STATUS EhcSetAndWaitDoorBell(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
/* Set door bell and wait it to be ACKed by host controller. This function is used to synchronize with the hardware. */
EFI_STATUS EhcSetAndWaitDoorBell(IN USB2_HC_DEV *Ehc, IN UINT32 Timeout)
{
  EFI_STATUS  Status;
  UINT32      Data;
  EhcSetOpRegBit (Ehc, EHC_USBCMD_OFFSET, USBCMD_IAAD);
  Status = EhcWaitOpRegBit (Ehc, EHC_USBSTS_OFFSET, USBSTS_IAA, TRUE, Timeout);
  Data  = EhcReadOpReg (Ehc, EHC_USBSTS_OFFSET);
  Data &= ~USBSTS_INTACK_MASK;
  Data |= USBSTS_IAA;
  EhcWriteOpReg (Ehc, EHC_USBSTS_OFFSET, Data);
  return Status;
}