Deleted Added
full compact
aic7xxx.seq (21982) aic7xxx.seq (22078)
1/*+M***********************************************************************
2 *Adaptec 274x/284x/294x device driver for Linux and FreeBSD.
3 *
4 *Copyright (c) 1994 John Aycock
5 * The University of Calgary Department of Computer Science.
6 * All rights reserved.
7 *
8 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing,
9 *SCB paging and other optimizations:
1/*+M***********************************************************************
2 *Adaptec 274x/284x/294x device driver for Linux and FreeBSD.
3 *
4 *Copyright (c) 1994 John Aycock
5 * The University of Calgary Department of Computer Science.
6 * All rights reserved.
7 *
8 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing,
9 *SCB paging and other optimizations:
10 *Copyright (c) 1994, 1995, 1996 Justin Gibbs. All rights reserved.
10 *Copyright (c) 1994, 1995, 1996, 1997 Justin Gibbs. All rights reserved.
11 *
12 *Redistribution and use in source and binary forms, with or without
13 *modification, are permitted provided that the following conditions
14 *are met:
15 *1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer.
17 *2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the

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

34 *OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 *HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 *SUCH DAMAGE.
39 *
40 *-M************************************************************************/
41
11 *
12 *Redistribution and use in source and binary forms, with or without
13 *modification, are permitted provided that the following conditions
14 *are met:
15 *1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer.
17 *2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the

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

34 *OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 *HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 *SUCH DAMAGE.
39 *
40 *-M************************************************************************/
41
42VERSION AIC7XXX_SEQ_VER "$FreeBSD: head/sys/dev/aic7xxx/aic7xxx.seq 21982 1997-01-24 21:57:47Z gibbs $"
42VERSION AIC7XXX_SEQ_VER "$FreeBSD: head/sys/dev/aic7xxx/aic7xxx.seq 22078 1997-01-29 05:19:46Z gibbs $"
43
44#if defined(__NetBSD__)
45#include "../../../../dev/ic/aic7xxxreg.h"
46#include "../../../../scsi/scsi_message.h"
47#elif defined(__FreeBSD__)
48#include "../../dev/aic7xxx/aic7xxx_reg.h"
49#include "../../scsi/scsi_message.h"
50#endif

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

147 * is not ideal for devices that have multiple luns active at the same
148 * time, it is faster than looping through all SCB's looking for active
149 * commands. We also don't have enough spare SCB space for us to store the
150 * SCBID of the currently busy transaction for each target/lun making it
151 * impossible to link up the SCBs.
152 */
153test_busy:
154 test SCB_CONTROL, TAG_ENB jnz start_scb
43
44#if defined(__NetBSD__)
45#include "../../../../dev/ic/aic7xxxreg.h"
46#include "../../../../scsi/scsi_message.h"
47#elif defined(__FreeBSD__)
48#include "../../dev/aic7xxx/aic7xxx_reg.h"
49#include "../../scsi/scsi_message.h"
50#endif

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

147 * is not ideal for devices that have multiple luns active at the same
148 * time, it is faster than looping through all SCB's looking for active
149 * commands. We also don't have enough spare SCB space for us to store the
150 * SCBID of the currently busy transaction for each target/lun making it
151 * impossible to link up the SCBs.
152 */
153test_busy:
154 test SCB_CONTROL, TAG_ENB jnz start_scb
155 mvi SEQCTL,0x50 /* PAUSEDIS|FASTMODE */
155 mov SAVED_SCBPTR, SCBPTR
156 mov SCB_TCL call index_untagged_scb
156 mov SAVED_SCBPTR, SCBPTR
157 mov SCB_TCL call index_untagged_scb
157 mvi SEQCTL,0x50 /* PAUSEDIS|FASTMODE */
158 mov ARG_1, SINDIR /*
159 * ARG_1 should
160 * now have the SCB ID of
161 * any active, non-tagged,
162 * command for this target.
163 */
164 cmp ARG_1, SCB_LIST_NULL je make_busy
165 test FLAGS, PAGESCBS jz simple_busy_link

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

186 mvi SEQCTL,0x10 /* FASTMODE */
187 jmp poll_for_work
188simple_busy_link:
189 mov SCBPTR, ARG_1
190 mov SCB_LINKED_NEXT, CUR_SCBID
191 mvi SEQCTL,0x10 /* FASTMODE */
192 jmp poll_for_work
193make_busy:
158 mov ARG_1, SINDIR /*
159 * ARG_1 should
160 * now have the SCB ID of
161 * any active, non-tagged,
162 * command for this target.
163 */
164 cmp ARG_1, SCB_LIST_NULL je make_busy
165 test FLAGS, PAGESCBS jz simple_busy_link

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

186 mvi SEQCTL,0x10 /* FASTMODE */
187 jmp poll_for_work
188simple_busy_link:
189 mov SCBPTR, ARG_1
190 mov SCB_LINKED_NEXT, CUR_SCBID
191 mvi SEQCTL,0x10 /* FASTMODE */
192 jmp poll_for_work
193make_busy:
194 mvi SEQCTL,0x10 /* FASTMODE */
195 mov DINDIR, CUR_SCBID
196 mov SCBPTR, SAVED_SCBPTR
194 mov DINDIR, CUR_SCBID
195 mov SCBPTR, SAVED_SCBPTR
196 mvi SEQCTL,0x10 /* FASTMODE */
197
198start_scb:
199 /*
200 * Place us on the waiting list in case our selection
201 * doesn't win during bus arbitration.
202 */
203 mov SCB_NEXT,WAITING_SCBH
204 mov WAITING_SCBH, SCBPTR

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

500 */
501 mvi DINDEX, HADDR0
502 mvi SCB_CMDPTR call bcopy_5
503 clr HCNT1
504 clr HCNT2
505
506 call set_stcnt_from_hcnt
507
197
198start_scb:
199 /*
200 * Place us on the waiting list in case our selection
201 * doesn't win during bus arbitration.
202 */
203 mov SCB_NEXT,WAITING_SCBH
204 mov WAITING_SCBH, SCBPTR

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

500 */
501 mvi DINDEX, HADDR0
502 mvi SCB_CMDPTR call bcopy_5
503 clr HCNT1
504 clr HCNT2
505
506 call set_stcnt_from_hcnt
507
508 mvi DFCNTRL, 0x3d /* SCSIEN|SDMAEN|HDMAEN
508 mvi 0x3d call dma /* SCSIEN|SDMAEN|HDMAEN
509 * |DIRECTION|FIFORESET
510 */
509 * |DIRECTION|FIFORESET
510 */
511p_command_dma:
512 test SSTAT0, SDONE jnz p_command_dma_done
513 test SSTAT1, PHASEMIS jz p_command_dma
514 test SSTAT0, SDONE jnz p_command_dma_done
515 clr DFCNTRL
516 jmp ITloop
511 jmp ITloop
517p_command_dma_done:
518 and DFCNTRL, 0xc7 /* ~(SCSIEN|SDMAEN|HDMAEN) */
519p_command_dma_clear:
520 test DFCNTRL, 0x38 jnz p_command_dma_clear
521 jmp ITloop
522
523/*
524 * Status phase. Wait for the data byte to appear, then read it
525 * and store it into the SCB.
526 */
527p_status:
528 call assert
529

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

940 * actually off first lest we get an ILLSADDR.
941 */
942dma5:
943 /* Don't clobber an inprogress host data transfer */
944 test DFSTATUS, MREQPEND jnz dma5
945 /* disable DMA */
946 and DFCNTRL, 0xc7 /* ~(SCSIEN|SDMAEN|HDMAEN|DIRECTION) */
947dma6:
512
513/*
514 * Status phase. Wait for the data byte to appear, then read it
515 * and store it into the SCB.
516 */
517p_status:
518 call assert
519

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

930 * actually off first lest we get an ILLSADDR.
931 */
932dma5:
933 /* Don't clobber an inprogress host data transfer */
934 test DFSTATUS, MREQPEND jnz dma5
935 /* disable DMA */
936 and DFCNTRL, 0xc7 /* ~(SCSIEN|SDMAEN|HDMAEN|DIRECTION) */
937dma6:
948 test DFCNTRL, HDMAENACK jnz dma6
938 test DFCNTRL, 0x38 jnz dma6 /* (SCSIEN|SDMAEN|HDMAEN|DIRECTION) */
949return:
950 ret
951
952/*
953 * Common SCSI initialization for selection and reselection. Expects
954 * the target SCSI ID to be in the upper four bits of SINDEX, and A's
955 * contents are stomped on return.
956 */

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

996 mov ALLZEROS call get_free_or_disc_scb
997 cmp ARG_1, SCB_LIST_NULL jne find_dma_scb
998 mov SAVED_TCL call index_untagged_scb
999 mov ARG_1, SINDIR /* SCBID of SCB to fetch */
1000find_dma_scb:
1001 mvi DMAPARAMS, 0xd /* HDMAEN|DIRECTION|FIFORESET */
1002 mov ARG_1 call dma_scb
1003 test SCB_CONTROL, ABORT_SCB jz return
939return:
940 ret
941
942/*
943 * Common SCSI initialization for selection and reselection. Expects
944 * the target SCSI ID to be in the upper four bits of SINDEX, and A's
945 * contents are stomped on return.
946 */

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

986 mov ALLZEROS call get_free_or_disc_scb
987 cmp ARG_1, SCB_LIST_NULL jne find_dma_scb
988 mov SAVED_TCL call index_untagged_scb
989 mov ARG_1, SINDIR /* SCBID of SCB to fetch */
990find_dma_scb:
991 mvi DMAPARAMS, 0xd /* HDMAEN|DIRECTION|FIFORESET */
992 mov ARG_1 call dma_scb
993 test SCB_CONTROL, ABORT_SCB jz return
994 call add_scb_to_free_list
1004find_error:
1005 mvi SINDEX, SCB_LIST_NULL ret
1006findBySCBID:
1007 mov A, ARG_1 /* Tag passed in ARG_1 */
1008 cmp SCB_TAG,A jne findSCB1 /* Found it? */
1009foundSCB:
1010 test SCB_CONTROL, ABORT_SCB jnz find_error
1011 test FLAGS,PAGESCBS jz return

--- 155 unchanged lines hidden ---
995find_error:
996 mvi SINDEX, SCB_LIST_NULL ret
997findBySCBID:
998 mov A, ARG_1 /* Tag passed in ARG_1 */
999 cmp SCB_TAG,A jne findSCB1 /* Found it? */
1000foundSCB:
1001 test SCB_CONTROL, ABORT_SCB jnz find_error
1002 test FLAGS,PAGESCBS jz return

--- 155 unchanged lines hidden ---