/* Check sense key to find if hardware error happens. */
BOOLEAN ScsiDiskIsHardwareError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
/* Check sense key to find if hardware error happens. */
BOOLEAN ScsiDiskIsHardwareError(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
{
  EFI_SCSI_SENSE_DATA  *SensePtr;
  UINTN                Index;
  BOOLEAN              IsError;
  IsError  = FALSE;
  SensePtr = SenseData;
  for (Index = 0; Index < SenseCounts; Index++) {
    if (SensePtr->Sense_Key == EFI_SCSI_SK_HARDWARE_ERROR) {
      IsError = TRUE;
    }
    SensePtr++;
  }
  return IsError;
}