Deleted Added
full compact
aic7xxx.seq (19921) aic7xxx.seq (20117)
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,

--- 25 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
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,

--- 25 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 "$Id: aic7xxx.seq,v 1.50 1996/11/21 06:18:33 gibbs Exp $"
42VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.51 1996/11/22 08:25:20 gibbs Exp $"
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

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

79 * We assume that the kernel driver may reset us at any time, even in the
80 * middle of a DMA, so clear DFCNTRL too.
81 */
82reset:
83 clr DFCNTRL
84 clr SCSISIGO /* De-assert BSY */
85
86p_busfree:
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

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

79 * We assume that the kernel driver may reset us at any time, even in the
80 * middle of a DMA, so clear DFCNTRL too.
81 */
82reset:
83 clr DFCNTRL
84 clr SCSISIGO /* De-assert BSY */
85
86p_busfree:
87 mvi LASTPHASE, P_BUSFREE
88
89start:
90 and FLAGS,0x07 /* clear target specific flags */
91 mvi SCSISEQ,ENRSELI /* Always allow reselection */
92 clr SCSIRATE /*
93 * We don't know the target we will
94 * connect to, so default to narrow
95 * transfers to avoid parity problems.
96 */
87 mvi SCSISEQ,ENRSELI /* Always allow reselection */
88 clr SCSIRATE /*
89 * We don't know the target we will
90 * connect to, so default to narrow
91 * transfers to avoid parity problems.
92 */
93 mvi LASTPHASE, P_BUSFREE
94 and FLAGS,0x07 /* clear target specific flags */
97poll_for_work:
98 /*
99 * Are we a twin channel device?
100 * For fairness, we check the other bus first,
101 * since we just finished a transaction on the
102 * current channel.
103 */
104 test FLAGS,TWIN_BUS jz start2

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

545 */
546p_mesgout_loop:
547 test SSTAT0,SPIORDY jz p_mesgout_loop
548 test SSTAT1,PHASEMIS jnz p_mesgout_done
549/*
550 * If the next bus phase after ATN drops is a message out, it means
551 * that the target is requesting that the last message(s) be resent.
552 */
95poll_for_work:
96 /*
97 * Are we a twin channel device?
98 * For fairness, we check the other bus first,
99 * since we just finished a transaction on the
100 * current channel.
101 */
102 test FLAGS,TWIN_BUS jz start2

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

543 */
544p_mesgout_loop:
545 test SSTAT0,SPIORDY jz p_mesgout_loop
546 test SSTAT1,PHASEMIS jnz p_mesgout_done
547/*
548 * If the next bus phase after ATN drops is a message out, it means
549 * that the target is requesting that the last message(s) be resent.
550 */
553p_mesgout_dropatn:
554 cmp DINDEX,1 jne p_mesgout_testretry /* last byte? */
555 mvi CLRSINT1,CLRATNO /* drop ATN */
556p_mesgout_testretry:
551p_mesgout_testretry:
557 test DINDEX,0xff jnz p_mesgout_outb
552 test DINDEX,0xff jnz p_mesgout_dropatn
558 or SCSISIGO,ATNO /* turn on ATN for the retry */
559 jmp p_mesgout_start
553 or SCSISIGO,ATNO /* turn on ATN for the retry */
554 jmp p_mesgout_start
555p_mesgout_dropatn:
556 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */
557 mvi CLRSINT1,CLRATNO /* drop ATN */
560p_mesgout_outb:
561 dec DINDEX
562 mvi CLRSINT0, CLRSPIORDY
563 mov SCSIDATL,SINDIR
564 jmp p_mesgout_loop
565
566p_mesgout_done:
567 mvi CLRSINT1,CLRATNO /* Be sure to turn ATNO off */

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

772 * If we get one, we use the tag returned to switch to find the proper
773 * SCB. With SCB paging, this requires using findSCB for both tagged
774 * and non-tagged transactions since the SCB may exist in any slot.
775 * If we're not using SCB paging, we can use the tag as the direct
776 * index to the SCB.
777 */
778 mvi ARG_1,SCB_LIST_NULL /* Default to no-tag */
779snoop_tag_loop:
558p_mesgout_outb:
559 dec DINDEX
560 mvi CLRSINT0, CLRSPIORDY
561 mov SCSIDATL,SINDIR
562 jmp p_mesgout_loop
563
564p_mesgout_done:
565 mvi CLRSINT1,CLRATNO /* Be sure to turn ATNO off */

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

770 * If we get one, we use the tag returned to switch to find the proper
771 * SCB. With SCB paging, this requires using findSCB for both tagged
772 * and non-tagged transactions since the SCB may exist in any slot.
773 * If we're not using SCB paging, we can use the tag as the direct
774 * index to the SCB.
775 */
776 mvi ARG_1,SCB_LIST_NULL /* Default to no-tag */
777snoop_tag_loop:
780 test SSTAT0,SPIORDY jz snoop_tag_loop
778 test SSTAT1,REQINIT jz snoop_tag_loop
781 test SSTAT1,PHASEMIS jnz use_findSCB
782 mvi A call inb_first
783 cmp A,MSG_SIMPLE_Q_TAG jne use_findSCB
784get_tag:
785 or FLAGS, TAGGED_SCB
786 mvi ARG_1 call inb_next /* tag value */
787/*
788 * See if the tag is in range. The tag is < SCBCOUNT if we add

--- 361 unchanged lines hidden ---
779 test SSTAT1,PHASEMIS jnz use_findSCB
780 mvi A call inb_first
781 cmp A,MSG_SIMPLE_Q_TAG jne use_findSCB
782get_tag:
783 or FLAGS, TAGGED_SCB
784 mvi ARG_1 call inb_next /* tag value */
785/*
786 * See if the tag is in range. The tag is < SCBCOUNT if we add

--- 361 unchanged lines hidden ---