aic7xxx.seq (19623) | aic7xxx.seq (19803) |
---|---|
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.47 1996/11/05 07:51:29 gibbs Exp $" | 42VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.48 1996/11/11 05:16:36 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 --- 452 unchanged lines hidden (view full) --- 503 # DIRECTION|FIFORESET 504 jmp ITloop 505 506/* 507 * Status phase. Wait for the data byte to appear, then read it 508 * and store it into the SCB. 509 */ 510p_status: | 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 --- 452 unchanged lines hidden (view full) --- 503 # DIRECTION|FIFORESET 504 jmp ITloop 505 506/* 507 * Status phase. Wait for the data byte to appear, then read it 508 * and store it into the SCB. 509 */ 510p_status: |
511 call assert 512 |
|
511 mvi SCB_TARGET_STATUS call inb_first 512 jmp mesgin_done 513 514/* 515 * Message out phase. If there is not an active message, but the target 516 * took us into this phase anyway, build a no-op message and send it. 517 */ 518p_mesgout: --- 15 unchanged lines hidden (view full) --- 534 * a MESSAGE REJECT. 535 */ 536p_mesgout_loop: 537 test SSTAT1,REQINIT jz p_mesgout_loop 538 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis 539 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */ 540 mvi CLRSINT1,CLRATNO /* drop ATN */ 541p_mesgout_outb: | 513 mvi SCB_TARGET_STATUS call inb_first 514 jmp mesgin_done 515 516/* 517 * Message out phase. If there is not an active message, but the target 518 * took us into this phase anyway, build a no-op message and send it. 519 */ 520p_mesgout: --- 15 unchanged lines hidden (view full) --- 536 * a MESSAGE REJECT. 537 */ 538p_mesgout_loop: 539 test SSTAT1,REQINIT jz p_mesgout_loop 540 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis 541 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */ 542 mvi CLRSINT1,CLRATNO /* drop ATN */ 543p_mesgout_outb: |
544 test SSTAT0, SPIORDY jz p_mesgout_outb |
|
542 dec DINDEX | 545 dec DINDEX |
543 or CLRSINT1, CLRREQINIT | 546 mvi CLRSINT1, CLRREQINIT |
544 mov SCSIDATL,SINDIR 545 546p_mesgout4: 547 test DINDEX,0xff jnz p_mesgout_loop 548 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. --- 101 unchanged lines hidden (view full) --- 653 */ 654 mvi INTSTAT,IMMEDDONE 655 jmp dma_next_scb 656complete: 657 test FLAGS, PAGESCBS jz complete_post 658 mov A, QFULLCNT 659complete_poll: 660 cmp QOUTQCNT, A je complete_poll | 547 mov SCSIDATL,SINDIR 548 549p_mesgout4: 550 test DINDEX,0xff jnz p_mesgout_loop 551 552/* 553 * If the next bus phase after ATN drops is a message out, it means 554 * that the target is requesting that the last message(s) be resent. --- 101 unchanged lines hidden (view full) --- 656 */ 657 mvi INTSTAT,IMMEDDONE 658 jmp dma_next_scb 659complete: 660 test FLAGS, PAGESCBS jz complete_post 661 mov A, QFULLCNT 662complete_poll: 663 cmp QOUTQCNT, A je complete_poll |
664 mvi SEQCTL,0x50 /* PAUSEDIS|FASTMODE */ |
|
661 inc QOUTQCNT 662complete_post: 663 /* Post the SCB and issue an interrupt */ 664 mov QOUTFIFO,SCB_TAG | 665 inc QOUTQCNT 666complete_post: 667 /* Post the SCB and issue an interrupt */ 668 mov QOUTFIFO,SCB_TAG |
669 mvi SEQCTL,0x10 /* FASTMODE */ |
|
665 mvi INTSTAT,CMDCMPLT 666 667dma_next_scb: 668 cmp SCB_LINKED_NEXT, SCB_LIST_NULL je mesgin_done 669 test FLAGS, PAGESCBS jnz dma_next_scb2 670 /* Only DMA on top of ourselves if we are the SCB to download */ 671 mov A, SCB_LINKED_NEXT 672 cmp SCB_TAG, A je dma_next_scb2 --- 161 unchanged lines hidden (view full) --- 834 jmp mesgin_done 835 836/* 837 * [ ADD MORE MESSAGE HANDLING HERE ] 838 */ 839 840/* 841 * Bus free phase. It might be useful to interrupt the device | 670 mvi INTSTAT,CMDCMPLT 671 672dma_next_scb: 673 cmp SCB_LINKED_NEXT, SCB_LIST_NULL je mesgin_done 674 test FLAGS, PAGESCBS jnz dma_next_scb2 675 /* Only DMA on top of ourselves if we are the SCB to download */ 676 mov A, SCB_LINKED_NEXT 677 cmp SCB_TAG, A je dma_next_scb2 --- 161 unchanged lines hidden (view full) --- 839 jmp mesgin_done 840 841/* 842 * [ ADD MORE MESSAGE HANDLING HERE ] 843 */ 844 845/* 846 * Bus free phase. It might be useful to interrupt the device |
842 * driver if we aren't expecting this. For now, make sure that 843 * ATN isn't being asserted and look for a new command. | 847 * driver if we aren't expecting this. |
844 */ 845p_busfree: | 848 */ 849p_busfree: |
846 mvi CLRSINT1,CLRATNO 847 clr LASTPHASE | 850 mvi LASTPHASE, P_BUSFREE |
848 849/* 850 * if this is an immediate command, perform a psuedo command complete to 851 * notify the driver. 852 */ 853 test SCB_CMDLEN,0xff jz status_ok 854 test FLAGS, SCB_LISTED jnz start 855 /* --- 40 unchanged lines hidden (view full) --- 896 * we send our ACK. 897 * 898 * The assumption here is that these are called in a particular sequence, 899 * and that REQ is already set when inb_first is called. inb_{first,next} 900 * use the same calling convention as inb. 901 */ 902 903inb_next: | 851 852/* 853 * if this is an immediate command, perform a psuedo command complete to 854 * notify the driver. 855 */ 856 test SCB_CMDLEN,0xff jz status_ok 857 test FLAGS, SCB_LISTED jnz start 858 /* --- 40 unchanged lines hidden (view full) --- 899 * we send our ACK. 900 * 901 * The assumption here is that these are called in a particular sequence, 902 * and that REQ is already set when inb_first is called. inb_{first,next} 903 * use the same calling convention as inb. 904 */ 905 906inb_next: |
904 or CLRSINT1, CLRREQINIT 905 mov NONE,SCSIDATL /*dummy read from latch to ACK*/ | 907 call inb_last /* ACK */ |
906inb_next_wait: | 908inb_next_wait: |
907 test SSTAT1,REQINIT jz inb_next_wait /* wait for next byte */ 908inb_first: | 909 test SSTAT1, REQINIT jz inb_next_wait |
909 test SSTAT1,PHASEMIS jnz mesgin_phasemis | 910 test SSTAT1,PHASEMIS jnz mesgin_phasemis |
911inb_first: |
|
910 mov DINDEX,SINDEX 911 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/ 912inb_last: | 912 mov DINDEX,SINDEX 913 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/ 914inb_last: |
913 or CLRSINT1, CLRREQINIT | 915 mvi CLRSINT1, CLRREQINIT |
914 mov NONE,SCSIDATL ret /*dummy read from latch to ACK*/ 915 916mesgin_phasemis: 917/* 918 * We expected to receive another byte, but the target changed phase 919 */ 920 mvi INTSTAT, MSGIN_PHASEMIS 921 jmp ITloop --- 253 unchanged lines hidden --- | 916 mov NONE,SCSIDATL ret /*dummy read from latch to ACK*/ 917 918mesgin_phasemis: 919/* 920 * We expected to receive another byte, but the target changed phase 921 */ 922 mvi INTSTAT, MSGIN_PHASEMIS 923 jmp ITloop --- 253 unchanged lines hidden --- |