/* Resets the SCSI Controller that the device handle specifies. */
EFI_STATUS EFIAPI ScsiResetDevice(IN EFI_SCSI_IO_PROTOCOL *This)
/* Resets the SCSI Controller that the device handle specifies. */
EFI_STATUS EFIAPI ScsiResetDevice(IN EFI_SCSI_IO_PROTOCOL *This)
{
  SCSI_IO_DEV  *ScsiIoDevice;
  UINT8        Target[TARGET_MAX_BYTES];
  ScsiIoDevice = SCSI_IO_DEV_FROM_THIS (This);
  REPORT_STATUS_CODE_WITH_DEVICE_PATH (
    EFI_PROGRESS_CODE,
    (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_RESET),
    ScsiIoDevice->ScsiBusDeviceData->DevicePath
    );
  CopyMem (Target, &ScsiIoDevice->Pun, TARGET_MAX_BYTES);
  if (ScsiIoDevice->ExtScsiSupport) {
    return ScsiIoDevice->ExtScsiPassThru->ResetTargetLun (
                                            ScsiIoDevice->ExtScsiPassThru,
                                            Target,
                                            ScsiIoDevice->Lun
                                            );
  } else {
    return ScsiIoDevice->ScsiPassThru->ResetTarget (
                                         ScsiIoDevice->ScsiPassThru,
                                         ScsiIoDevice->Pun.ScsiId.Scsi,
                                         ScsiIoDevice->Lun
                                         );
  }
}