/* Check sense key to find if reset happens. */
BOOLEAN ScsiDiskIsResetBefore(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
/* Check sense key to find if reset happens. */
BOOLEAN ScsiDiskIsResetBefore(IN EFI_SCSI_SENSE_DATA *SenseData, IN UINTN SenseCounts)
{
  EFI_SCSI_SENSE_DATA  *SensePtr;
  UINTN                Index;
  BOOLEAN              IsResetBefore;
  IsResetBefore = FALSE;
  SensePtr      = SenseData;
  for (Index = 0; Index < SenseCounts; Index++) {
    if ((SensePtr->Sense_Key == EFI_SCSI_SK_UNIT_ATTENTION) &&
        (SensePtr->Addnl_Sense_Code == EFI_SCSI_ASC_RESET))
    {
      IsResetBefore = TRUE;
    }
    SensePtr++;
  }
  return IsResetBefore;
}