Skip to content
atari_NCR5380.c 91.7 KiB
Newer Older
	do_reset(instance);

	/* reset NCR registers */
	NCR5380_write(MODE_REG, MR_BASE);
	NCR5380_write(TARGET_COMMAND_REG, 0);
	NCR5380_write(SELECT_ENABLE_REG, 0);

	/* After the reset, there are no more connected or disconnected commands
	 * and no busy units; so clear the low-level status here to avoid
	 * conflicts when the mid-level code tries to wake up the affected
	 * commands!
	 */

	if (hostdata->issue_queue)
		dprintk(NDEBUG_ABORT, "scsi%d: reset aborted issued command(s)\n", H_NO(cmd));
	if (hostdata->connected)
		dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd));
	if (hostdata->disconnected_queue)
		dprintk(NDEBUG_ABORT, "scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd));

	hostdata->issue_queue = NULL;
	hostdata->connected = NULL;
	hostdata->disconnected_queue = NULL;
Linus Torvalds's avatar
Linus Torvalds committed
#ifdef SUPPORT_TAGS
	free_all_tags(hostdata);
Linus Torvalds's avatar
Linus Torvalds committed
#endif
	for (i = 0; i < 8; ++i)
		hostdata->busy[i] = 0;
Linus Torvalds's avatar
Linus Torvalds committed
#ifdef REAL_DMA
	hostdata->dma_len = 0;
Linus Torvalds's avatar
Linus Torvalds committed
#endif

	maybe_release_dma_irq(instance);
	local_irq_restore(flags);
Linus Torvalds's avatar
Linus Torvalds committed

Linus Torvalds's avatar
Linus Torvalds committed
}