/* Check if the Trb is a transaction of the URB. */
BOOLEAN IsTrbInTrsRing(IN TRANSFER_RING *Ring, IN TRB_TEMPLATE *Trb)
/* Check if the Trb is a transaction of the URB. */
BOOLEAN IsTrbInTrsRing(IN TRANSFER_RING *Ring, IN TRB_TEMPLATE *Trb)
{
  TRB_TEMPLATE  *CheckedTrb;
  UINTN         Index;
  CheckedTrb = (TRB_TEMPLATE *)(UINTN)Ring->RingSeg0;
  ASSERT (Ring->TrbNumber == TR_RING_TRB_NUMBER);
  for (Index = 0; Index < Ring->TrbNumber; Index++) {
    if (Trb == CheckedTrb) {
      return TRUE;
    }
    CheckedTrb++;
  }
  return FALSE;
}