drivers/scsi/aic7xxx/aic79xx.seq

Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aic79xx.seq

File Facts

System
Linux kernel
Corpus path
drivers/scsi/aic7xxx/aic79xx.seq
Extension
.seq
Size
72734 bytes
Lines
2291
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: drivers/scsi
Status
atlas-only

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#120 $"
PATCH_ARG_LIST = "struct ahd_softc *ahd"
PREFIX = "ahd_"

#include "aic79xx.reg"
#include "scsi_message.h"

restart:
if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
	test	SEQINTCODE, 0xFF jz idle_loop;
	SET_SEQINTCODE(NO_SEQINT)
}

idle_loop:

	if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
		/*
		 * Convert ERROR status into a sequencer
		 * interrupt to handle the case of an
		 * interrupt collision on the hardware
		 * setting of HWERR.
		 */
		test	ERROR, 0xFF jz no_error_set;
		SET_SEQINTCODE(SAW_HWERR)
no_error_set:
	}
	SET_MODE(M_SCSI, M_SCSI)
	test	SCSISEQ0, ENSELO|ENARBO jnz idle_loop_checkbus;
	test	SEQ_FLAGS2, SELECTOUT_QFROZEN jz check_waiting_list;
	/*
	 * If the kernel has caught up with us, thaw the queue.
	 */
	mov	A, KERNEL_QFREEZE_COUNT;
	cmp	QFREEZE_COUNT, A jne check_frozen_completions;
	mov	A, KERNEL_QFREEZE_COUNT[1];
	cmp	QFREEZE_COUNT[1], A jne check_frozen_completions;
	and	SEQ_FLAGS2, ~SELECTOUT_QFROZEN;
	jmp	check_waiting_list;
check_frozen_completions:
	test	SSTAT0, SELDO|SELINGO jnz idle_loop_checkbus;
BEGIN_CRITICAL;
	/*
	 * If we have completions stalled waiting for the qfreeze
	 * to take effect, move them over to the complete_scb list
	 * now that no selections are pending.
	 */
	cmp	COMPLETE_ON_QFREEZE_HEAD[1],SCB_LIST_NULL je idle_loop_checkbus;
	/*
	 * Find the end of the qfreeze list.  The first element has
	 * to be treated specially.
	 */
	bmov	SCBPTR, COMPLETE_ON_QFREEZE_HEAD, 2;
	cmp 	SCB_NEXT_COMPLETE[1], SCB_LIST_NULL je join_lists;
	/*
	 * Now the normal loop.
	 */
	bmov	SCBPTR, SCB_NEXT_COMPLETE, 2;
	cmp 	SCB_NEXT_COMPLETE[1], SCB_LIST_NULL jne . - 1;
join_lists:
	bmov	SCB_NEXT_COMPLETE, COMPLETE_SCB_HEAD, 2;
	bmov	COMPLETE_SCB_HEAD, COMPLETE_ON_QFREEZE_HEAD, 2;
	mvi	COMPLETE_ON_QFREEZE_HEAD[1], SCB_LIST_NULL;
	jmp	idle_loop_checkbus;
check_waiting_list:
	cmp	WAITING_TID_HEAD[1], SCB_LIST_NULL je idle_loop_checkbus;
	/*
	 * ENSELO is cleared by a SELDO, so we must test for SELDO
	 * one last time.
	 */
	test	SSTAT0, SELDO jnz select_out;

Annotation

Implementation Notes