When not using SCB paging, we can always directly index the SCB of interest

either by looking it up in the array of pending, per target, untagged
transactions, or by using the tag value passed in during the identify.  The
old code only direct indexed for tagged transactions.  This makes the
"findSCB" routine only necessary when SCB paging is enabled, so appropriately
conditionalize it.  This greatly simplifies the non SCB paging code flow.
This commit is contained in:
Justin T. Gibbs 1997-04-04 04:09:29 +00:00
parent 1e97ca0116
commit 5ea0ae111d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24608
2 changed files with 24 additions and 28 deletions

View File

@ -757,8 +757,15 @@ mesgin_identify:
or SAVED_TCL,A; /* SAVED_TCL should be complete now */
mov SAVED_TCL call index_untagged_scb;
mov ARG_1, SINDIR;
/* XXX Directly index in the non paging case */
.if ( SCB_PAGING )
cmp ARG_1,SCB_LIST_NULL jne use_findSCB;
.else
cmp ARG_1,SCB_LIST_NULL je snoop_tag;
/* Directly index the SCB */
mov SCBPTR,ARG_1;
test SCB_CONTROL,DISCONNECTED jz not_found;
jmp setup_SCB;
.endif
/*
* Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
* If we get one, we use the tag returned to find the proper
@ -767,6 +774,7 @@ mesgin_identify:
* If we're not using SCB paging, we can use the tag as the direct
* index to the SCB.
*/
snoop_tag:
mov NONE,SCSIDATL; /* ACK Identify MSG */
snoop_tag_loop:
test SSTAT1,REQINIT jz snoop_tag_loop;
@ -786,8 +794,13 @@ get_tag:
jc not_found;
.if ! ( SCB_PAGING )
jmp index_by_tag;
.endif
index_by_tag:
mov SCBPTR,ARG_1;
mov A, SAVED_TCL;
cmp SCB_TCL,A jne not_found;
test SCB_CONTROL,TAG_ENB jz not_found;
test SCB_CONTROL,DISCONNECTED jz not_found;
.else
/*
* Ensure that the SCB the tag points to is for an SCB transaction
* to the reconnecting target.
@ -795,17 +808,11 @@ get_tag:
use_findSCB:
mov ALLZEROS call findSCB; /* Have to search */
cmp SINDEX, SCB_LIST_NULL je not_found;
.endif
setup_SCB:
and SCB_CONTROL,~DISCONNECTED;
or SEQ_FLAGS,IDENTIFY_SEEN; /* make note of IDENTIFY */
jmp mesgin_done;
index_by_tag:
mov SCBPTR,ARG_1;
mov A, SAVED_TCL;
cmp SCB_TCL,A jne not_found;
test SCB_CONTROL,TAG_ENB jz not_found;
test SCB_CONTROL,DISCONNECTED jz not_found;
jmp setup_SCB;
not_found:
mvi INTSTAT, NO_MATCH;
@ -952,6 +959,7 @@ assert:
mvi INTSTAT,NO_IDENT ret; /* no - tell the kernel */
.if ( SCB_PAGING )
/*
* Locate a disconnected SCB either by SAVED_TCL (ARG_1 is SCB_LIST_NULL)
* or by the SCBIDn ARG_1. The search begins at the SCB index passed in
@ -972,17 +980,14 @@ findSCB_loop:
* one we want. If we aren't paging or the SCB we dma down has the
* abort flag set, return not found.
*/
.if ( SCB_PAGING )
mov ALLZEROS call get_free_or_disc_scb;
mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
mov ARG_1 call dma_scb;
test SCB_CONTROL, ABORT_SCB jz return;
.endif
find_error:
mvi SINDEX, SCB_LIST_NULL ret;
foundSCB:
test SCB_CONTROL, ABORT_SCB jnz find_error;
.if ( SCB_PAGING )
rem_scb_from_disc_list:
/* Remove this SCB from the disconnection list */
cmp SCB_NEXT,SCB_LIST_NULL je unlink_prev;

View File

@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: aic7xxx.c,v 1.108 1997/03/24 05:05:18 gibbs Exp $
* $Id: aic7xxx.c,v 1.109 1997/03/24 17:42:25 gibbs Exp $
*/
/*
* TODO:
@ -1647,12 +1647,13 @@ ahc_handle_scsiint(ahc, intstat)
next_scb, links);
next_scb->flags |= SCB_WAITINGQ;
}
scb->xs->error = XS_DRIVER_STUFFUP;
scb->xs->error = XS_TIMEOUT;
sc_print_addr(scb->xs->sc_link);
ahc_done(ahc, scb);
scb = NULL;
} else
} else {
printf("%s: ", ahc_name(ahc));
}
printf("Unexpected busfree. LASTPHASE == 0x%x\n"
"SEQADDR == 0x%x\n",
lastphase, (ahc_inb(ahc, SEQADDR1) << 8)
@ -2935,17 +2936,7 @@ ahc_timeout(arg)
* Some other SCB has started a recovery operation
* and is still working on cleaning things up.
*/
if (scb->flags & SCB_TIMEDOUT) {
/*
* This SCB has been here before and is not the
* recovery SCB. Cut our losses and panic. Its
* better to do this than trash a filesystem.
*/
sc_print_addr(scb->xs->sc_link);
panic("%s: Timed-out command times out "
"again. SCB = 0x%x\n", ahc_name(ahc),
scb->hscb->tag);
} else if ((scb->flags & SCB_RECOVERY_SCB) == 0) {
if ((scb->flags & SCB_RECOVERY_SCB) == 0) {
/*
* This is not the SCB that started this timeout
* processing. Give this scb another lifetime so
@ -3039,7 +3030,7 @@ bus_reset:
SELBUSB : 0)));
scb->flags |= SCB_SENTORDEREDTAG|SCB_RECOVERY_SCB;
ahc->orderedtag |= mask;
timeout(ahc_timeout, (caddr_t)scb, (1 * hz));
timeout(ahc_timeout, (caddr_t)scb, (5 * hz));
unpause_sequencer(ahc, /*unpause_always*/TRUE);
printf("Ordered Tag queued\n");
} else {