aic7xxx.seq (7532) | aic7xxx.seq (7562) |
---|---|
1# @(#)aic7xxx.seq 1.32 94/11/29 jda 2# 3# Adaptec 274x/284x/294x device driver for Linux and FreeBSD. 4# Copyright (c) 1994 The University of Calgary Department of Computer Science. 5# 6# This program is free software; you can redistribute it and/or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 2 of the License, or --- 8 unchanged lines hidden (view full) --- 17# along with this program; if not, write to the Free Software 18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19# 20 21# FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other 22# optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org) 23# 24 | 1# @(#)aic7xxx.seq 1.32 94/11/29 jda 2# 3# Adaptec 274x/284x/294x device driver for Linux and FreeBSD. 4# Copyright (c) 1994 The University of Calgary Department of Computer Science. 5# 6# This program is free software; you can redistribute it and/or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 2 of the License, or --- 8 unchanged lines hidden (view full) --- 17# along with this program; if not, write to the Free Software 18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19# 20 21# FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other 22# optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org) 23# 24 |
25VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.10 1995/03/17 23:54:17 gibbs Exp $" | 25VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.11 1995/03/31 14:06:02 gibbs Exp $" |
26 27SCBMASK = 0x1f 28 29SCSISEQ = 0x00 30SXFRCTL0 = 0x01 31SXFRCTL1 = 0x02 32SCSISIGI = 0x03 33SCSISIGO = 0x03 --- 91 unchanged lines hidden (view full) --- 125SEND_REJECT = 0x11 # sending a message reject 126NO_IDENT = 0x21 # no IDENTIFY after reconnect 127NO_MATCH = 0x31 # no cmd match for reconnect 128MSG_SDTR = 0x41 # SDTR message recieved 129MSG_WDTR = 0x51 # WDTR message recieved 130MSG_REJECT = 0x61 # Reject message recieved 131BAD_STATUS = 0x71 # Bad status from target 132RESIDUAL = 0x81 # Residual byte count != 0 | 26 27SCBMASK = 0x1f 28 29SCSISEQ = 0x00 30SXFRCTL0 = 0x01 31SXFRCTL1 = 0x02 32SCSISIGI = 0x03 33SCSISIGO = 0x03 --- 91 unchanged lines hidden (view full) --- 125SEND_REJECT = 0x11 # sending a message reject 126NO_IDENT = 0x21 # no IDENTIFY after reconnect 127NO_MATCH = 0x31 # no cmd match for reconnect 128MSG_SDTR = 0x41 # SDTR message recieved 129MSG_WDTR = 0x51 # WDTR message recieved 130MSG_REJECT = 0x61 # Reject message recieved 131BAD_STATUS = 0x71 # Bad status from target 132RESIDUAL = 0x81 # Residual byte count != 0 |
133ABORT_TAG = 0x91 # Sent an ABORT_TAG message |
|
133 134# The host adapter card (at least the BIOS) uses 20-2f for SCSI 135# device information, 32-33 and 5a-5f as well. As it turns out, the 136# BIOS trashes 20-2f, writing the synchronous negotiation results 137# on top of the BIOS values, so we re-use those for our per-target 138# scratchspace (actually a value that can be copied directly into 139# SCSIRATE). The kernel driver will enable synchronous negotiation 140# for all targets that have a value other than 0 in the lower four --- 26 unchanged lines hidden (view full) --- 167 168MSG_LEN = 0x34 169MSG_START+0 = 0x35 170MSG_START+1 = 0x36 171MSG_START+2 = 0x37 172MSG_START+3 = 0x38 173MSG_START+4 = 0x39 174MSG_START+5 = 0x3a | 134 135# The host adapter card (at least the BIOS) uses 20-2f for SCSI 136# device information, 32-33 and 5a-5f as well. As it turns out, the 137# BIOS trashes 20-2f, writing the synchronous negotiation results 138# on top of the BIOS values, so we re-use those for our per-target 139# scratchspace (actually a value that can be copied directly into 140# SCSIRATE). The kernel driver will enable synchronous negotiation 141# for all targets that have a value other than 0 in the lower four --- 26 unchanged lines hidden (view full) --- 168 169MSG_LEN = 0x34 170MSG_START+0 = 0x35 171MSG_START+1 = 0x36 172MSG_START+2 = 0x37 173MSG_START+3 = 0x38 174MSG_START+4 = 0x39 175MSG_START+5 = 0x3a |
175-MSG_START+0 = 0xcc # 2's complement of MSG_START+0 | 176-MSG_START+0 = 0xcb # 2's complement of MSG_START+0 |
176 177ARG_1 = 0x4a # sdtr conversion args & return 178BUS_16_BIT = 0x01 179RETURN_1 = 0x4a 180 181SIGSTATE = 0x4b # value written to SCSISIGO 182 183# Linux users should use 0xc (12) for SG_SIZEOF --- 581 unchanged lines hidden (view full) --- 765use_findSCB: 766 mov ALLZEROS call findSCB # Have to search 767 768# If a active message is present after calling findSCB, then either it 769# or the driver is trying to abort the command. Either way, something 770# untoward has happened and we should just leave it alone. 771# 772setup_SCB: | 177 178ARG_1 = 0x4a # sdtr conversion args & return 179BUS_16_BIT = 0x01 180RETURN_1 = 0x4a 181 182SIGSTATE = 0x4b # value written to SCSISIGO 183 184# Linux users should use 0xc (12) for SG_SIZEOF --- 581 unchanged lines hidden (view full) --- 766use_findSCB: 767 mov ALLZEROS call findSCB # Have to search 768 769# If a active message is present after calling findSCB, then either it 770# or the driver is trying to abort the command. Either way, something 771# untoward has happened and we should just leave it alone. 772# 773setup_SCB: |
773 test FLAGS,ACTIVE_MSG jnz p_mesgin_done 774 | |
775 and SCBARRAY+0,0xfb # clear disconnect bit in SCB 776 or FLAGS,0xc0 # make note of IDENTIFY 777 778 call sg_scb2ram # implied restore pointers 779 # required on reselect 780 jmp ITloop 781 782get_tag: 783 mvi A call inb_next 784 test A,0xf0 jnz abort_tag # Tag in range? 785 mov SCBPTR,A 786 mov A,SAVED_TCL 787 cmp SCBARRAY+1,A jne abort_tag 788 test SCBARRAY+0,TAG_ENB jz abort_tag | 774 and SCBARRAY+0,0xfb # clear disconnect bit in SCB 775 or FLAGS,0xc0 # make note of IDENTIFY 776 777 call sg_scb2ram # implied restore pointers 778 # required on reselect 779 jmp ITloop 780 781get_tag: 782 mvi A call inb_next 783 test A,0xf0 jnz abort_tag # Tag in range? 784 mov SCBPTR,A 785 mov A,SAVED_TCL 786 cmp SCBARRAY+1,A jne abort_tag 787 test SCBARRAY+0,TAG_ENB jz abort_tag |
789 call inb_last | 788 call inb_last # ACK |
790 jmp setup_SCB 791 792# Message reject? Let the kernel driver handle this. If we have an 793# outstanding WDTR or SDTR negotiation, assume that it's a response from 794# the target selecting 8bit or asynchronous transfer, otherwise just ignore 795# it since we have no clue what it pertains to. 796# 797p_mesgin6: --- 22 unchanged lines hidden (view full) --- 820 821p_mesgin_done: 822 call inb_last # ack & turn auto PIO back on 823 jmp ITloop 824 825abort_tag: 826 or SINDEX,0x10,SIGSTATE # turn on ATNO 827 call scsisig | 789 jmp setup_SCB 790 791# Message reject? Let the kernel driver handle this. If we have an 792# outstanding WDTR or SDTR negotiation, assume that it's a response from 793# the target selecting 8bit or asynchronous transfer, otherwise just ignore 794# it since we have no clue what it pertains to. 795# 796p_mesgin6: --- 22 unchanged lines hidden (view full) --- 819 820p_mesgin_done: 821 call inb_last # ack & turn auto PIO back on 822 jmp ITloop 823 824abort_tag: 825 or SINDEX,0x10,SIGSTATE # turn on ATNO 826 call scsisig |
828# mvi INTSTAT,ABORT_TAG # let driver know | 827 mvi INTSTAT,ABORT_TAG # let driver know |
829 mvi 0xd call mk_mesg # ABORT TAG message 830 jmp p_mesgin_done 831 832# Bus free phase. It might be useful to interrupt the device 833# driver if we aren't expecting this. For now, make sure that 834# ATN isn't being asserted and look for a new command. 835# 836p_busfree: --- 447 unchanged lines hidden --- | 828 mvi 0xd call mk_mesg # ABORT TAG message 829 jmp p_mesgin_done 830 831# Bus free phase. It might be useful to interrupt the device 832# driver if we aren't expecting this. For now, make sure that 833# ATN isn't being asserted and look for a new command. 834# 835p_busfree: --- 447 unchanged lines hidden --- |