/* Check the target status and re-interpret it in EFI_STATUS. */
EFI_STATUS CheckTargetStatus(IN UINT8 TargetStatus)
/* Check the target status and re-interpret it in EFI_STATUS. */
EFI_STATUS CheckTargetStatus(IN UINT8 TargetStatus)
{
  switch (TargetStatus) {
    case EFI_EXT_SCSI_STATUS_TARGET_GOOD:
    case EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION:
    case EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET:
      return EFI_SUCCESS;
    case EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE:
    case EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET:
    case EFI_EXT_SCSI_STATUS_TARGET_BUSY:
    case EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL:
      return EFI_NOT_READY;
    case EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT:
      return EFI_DEVICE_ERROR;
    default:
      return EFI_SUCCESS;
  }
}