Deleted Added
full compact
aic7xxx.seq (28169) aic7xxx.seq (29897)
1/*
2 * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
3 *
4 * Copyright (c) 1994-1997 Justin Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 21 unchanged lines hidden (view full) ---

30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
1/*
2 * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
3 *
4 * Copyright (c) 1994-1997 Justin Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 21 unchanged lines hidden (view full) ---

30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * $Id: aic7xxx.seq,v 1.74 1997/06/27 19:38:42 gibbs Exp $
38 * $Id: aic7xxx.seq,v 1.75 1997/08/13 17:02:28 gibbs Exp $
39 */
40
41#include <dev/aic7xxx/aic7xxx.reg>
42#include <scsi/scsi_message.h>
43
44/*
45 * A few words on the waiting SCB list:
46 * After starting the selection hardware, we check for reconnecting targets

--- 36 unchanged lines hidden (view full) ---

83 test SSTAT0,SELDO jnz select;
84 test SSTAT0,SELDI jnz reselect;
85 test SCSISEQ, ENSELO jnz poll_for_work;
86 xor SBLKCTL,SELBUSB; /* Toggle back */
87.endif
88 cmp WAITING_SCBH,SCB_LIST_NULL jne start_waiting;
89test_queue:
90 /* Has the driver posted any work for us? */
39 */
40
41#include <dev/aic7xxx/aic7xxx.reg>
42#include <scsi/scsi_message.h>
43
44/*
45 * A few words on the waiting SCB list:
46 * After starting the selection hardware, we check for reconnecting targets

--- 36 unchanged lines hidden (view full) ---

83 test SSTAT0,SELDO jnz select;
84 test SSTAT0,SELDI jnz reselect;
85 test SCSISEQ, ENSELO jnz poll_for_work;
86 xor SBLKCTL,SELBUSB; /* Toggle back */
87.endif
88 cmp WAITING_SCBH,SCB_LIST_NULL jne start_waiting;
89test_queue:
90 /* Has the driver posted any work for us? */
91 mov A, QCNTMASK;
92 test QINCNT,A jz poll_for_work;
91 test QINCNT,QCNTMASK jz poll_for_work;
93
94/*
95 * We have at least one queued SCB now and we don't have any
96 * SCBs in the list of SCBs awaiting selection. If we have
97 * any SCBs available for use, pull the tag from the QINFIFO
98 * and get to work on it.
99 */
100.if ( SCB_PAGING )

--- 461 unchanged lines hidden (view full) ---

562 clr MSG_LEN; /* no active msg */
563 jmp ITloop;
564
565/*
566 * Message in phase. Bytes are read using Automatic PIO mode.
567 */
568p_mesgin:
569 mvi ACCUM call inb_first; /* read the 1st message byte */
92
93/*
94 * We have at least one queued SCB now and we don't have any
95 * SCBs in the list of SCBs awaiting selection. If we have
96 * any SCBs available for use, pull the tag from the QINFIFO
97 * and get to work on it.
98 */
99.if ( SCB_PAGING )

--- 461 unchanged lines hidden (view full) ---

561 clr MSG_LEN; /* no active msg */
562 jmp ITloop;
563
564/*
565 * Message in phase. Bytes are read using Automatic PIO mode.
566 */
567p_mesgin:
568 mvi ACCUM call inb_first; /* read the 1st message byte */
570 mov REJBYTE,A; /* save it for the driver */
571
572 test A,MSG_IDENTIFYFLAG jnz mesgin_identify;
573 cmp A,MSG_DISCONNECT je mesgin_disconnect;
574 cmp A,MSG_SAVEDATAPOINTER je mesgin_sdptrs;
575 cmp ALLZEROS,A je mesgin_complete;
576 cmp A,MSG_RESTOREPOINTERS je mesgin_rdptrs;
577 cmp A,MSG_EXTENDED je mesgin_extended;
578 cmp A,MSG_MESSAGE_REJECT je mesgin_reject;

--- 64 unchanged lines hidden (view full) ---

643
644complete:
645 /* Post the SCB and issue an interrupt */
646.if ( SCB_PAGING )
647 /*
648 * Spin loop until there is space
649 * in the QOUTFIFO.
650 */
569
570 test A,MSG_IDENTIFYFLAG jnz mesgin_identify;
571 cmp A,MSG_DISCONNECT je mesgin_disconnect;
572 cmp A,MSG_SAVEDATAPOINTER je mesgin_sdptrs;
573 cmp ALLZEROS,A je mesgin_complete;
574 cmp A,MSG_RESTOREPOINTERS je mesgin_rdptrs;
575 cmp A,MSG_EXTENDED je mesgin_extended;
576 cmp A,MSG_MESSAGE_REJECT je mesgin_reject;

--- 64 unchanged lines hidden (view full) ---

641
642complete:
643 /* Post the SCB and issue an interrupt */
644.if ( SCB_PAGING )
645 /*
646 * Spin loop until there is space
647 * in the QOUTFIFO.
648 */
651 mov A, FIFODEPTH;
652 cmp CMDOUTCNT, A je .;
649 cmp CMDOUTCNT, FIFODEPTH je .;
653 inc CMDOUTCNT;
654.endif
655 mov QOUTFIFO,SCB_TAG;
656 mvi INTSTAT,CMDCMPLT;
657 test SCB_CONTROL, ABORT_SCB jz dma_next_scb;
658 mvi INTSTAT, ABORT_CMDCMPLT;
659
660dma_next_scb:

--- 136 unchanged lines hidden (view full) ---

797get_tag:
798 or SEQ_FLAGS, TAGGED_SCB;
799 mvi ARG_1 call inb_next; /* tag value */
800/*
801 * See if the tag is in range. The tag is < SCBCOUNT if we add
802 * the complement of SCBCOUNT to the incomming tag and there is
803 * no carry.
804 */
650 inc CMDOUTCNT;
651.endif
652 mov QOUTFIFO,SCB_TAG;
653 mvi INTSTAT,CMDCMPLT;
654 test SCB_CONTROL, ABORT_SCB jz dma_next_scb;
655 mvi INTSTAT, ABORT_CMDCMPLT;
656
657dma_next_scb:

--- 136 unchanged lines hidden (view full) ---

794get_tag:
795 or SEQ_FLAGS, TAGGED_SCB;
796 mvi ARG_1 call inb_next; /* tag value */
797/*
798 * See if the tag is in range. The tag is < SCBCOUNT if we add
799 * the complement of SCBCOUNT to the incomming tag and there is
800 * no carry.
801 */
805 mov A,COMP_SCBCOUNT;
806 add SINDEX,A,ARG_1;
802 add SINDEX,COMP_SCBCOUNT,ARG_1;
807 jc not_found;
808
809.if ! ( SCB_PAGING )
810index_by_tag:
811 mov SCBPTR,ARG_1;
812 mov A, SAVED_TCL;
813 cmp SCB_TCL,A jne not_found;
814 test SCB_CONTROL,TAG_ENB jz not_found;

--- 156 unchanged lines hidden (view full) ---

971 */
972findSCB:
973 mov SCBPTR,SINDEX; /* switch to next SCB */
974 mov A, ARG_1; /* Tag passed in ARG_1 */
975 cmp SCB_TAG,A jne findSCB_loop;
976 test SCB_CONTROL,DISCONNECTED jnz foundSCB;/*should be disconnected*/
977findSCB_loop:
978 inc SINDEX;
803 jc not_found;
804
805.if ! ( SCB_PAGING )
806index_by_tag:
807 mov SCBPTR,ARG_1;
808 mov A, SAVED_TCL;
809 cmp SCB_TCL,A jne not_found;
810 test SCB_CONTROL,TAG_ENB jz not_found;

--- 156 unchanged lines hidden (view full) ---

967 */
968findSCB:
969 mov SCBPTR,SINDEX; /* switch to next SCB */
970 mov A, ARG_1; /* Tag passed in ARG_1 */
971 cmp SCB_TAG,A jne findSCB_loop;
972 test SCB_CONTROL,DISCONNECTED jnz foundSCB;/*should be disconnected*/
973findSCB_loop:
974 inc SINDEX;
979 mov A,SCBCOUNT;
980 cmp SINDEX,A jne findSCB;
975 cmp SINDEX,SCBCOUNT jne findSCB;
981/*
982 * We didn't find it. If we're paging, pull an SCB and DMA down the
983 * one we want. If we aren't paging or the SCB we dma down has the
984 * abort flag set, return not found.
985 */
986 mov ALLZEROS call get_free_or_disc_scb;
987 mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
988 mov ARG_1 call dma_scb;

--- 168 unchanged lines hidden ---
976/*
977 * We didn't find it. If we're paging, pull an SCB and DMA down the
978 * one we want. If we aren't paging or the SCB we dma down has the
979 * abort flag set, return not found.
980 */
981 mov ALLZEROS call get_free_or_disc_scb;
982 mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
983 mov ARG_1 call dma_scb;

--- 168 unchanged lines hidden ---