/* Calculate the device context index by endpoint address and direction. */
UINT8 XhcEndpointToDci(IN UINT8 EpAddr, IN UINT8 Direction)
/* Calculate the device context index by endpoint address and direction. */
UINT8 XhcEndpointToDci(IN UINT8 EpAddr, IN UINT8 Direction)
{
  UINT8  Index;
  if (EpAddr == 0) {
    return 1;
  } else {
    Index = (UINT8)(2 * EpAddr);
    if (Direction == EfiUsbDataIn) {
      Index += 1;
    }
    return Index;
  }
}