Deleted Added
full compact
aic7xxx.seq (72811) aic7xxx.seq (74094)
1/*
2 * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
3 *
4 * Copyright (c) 1994-2001 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

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

23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
1/*
2 * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD.
3 *
4 * Copyright (c) 1994-2001 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

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

23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * $Id: //depot/src/aic7xxx/aic7xxx.seq#20 $
31 * $Id: //depot/src/aic7xxx/aic7xxx.seq#23 $
32 *
32 *
33 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx.seq 72811 2001-02-21 20:50:36Z gibbs $
33 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx.seq 74094 2001-03-11 06:34:17Z gibbs $
34 */
35
36#include "aic7xxx.reg"
37#include "scsi_message.h"
38
39/*
40 * A few words on the waiting SCB list:
41 * After starting the selection hardware, we check for reconnecting targets

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

83BEGIN_CRITICAL
84 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
85 test QOFF_CTLSTA, SCB_AVAIL jz poll_for_work_loop;
86 } else {
87 mov A, QINPOS;
88 cmp KERNEL_QINPOS, A je poll_for_work_loop;
89 }
90 mov ARG_1, NEXT_QUEUED_SCB;
34 */
35
36#include "aic7xxx.reg"
37#include "scsi_message.h"
38
39/*
40 * A few words on the waiting SCB list:
41 * After starting the selection hardware, we check for reconnecting targets

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

83BEGIN_CRITICAL
84 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
85 test QOFF_CTLSTA, SCB_AVAIL jz poll_for_work_loop;
86 } else {
87 mov A, QINPOS;
88 cmp KERNEL_QINPOS, A je poll_for_work_loop;
89 }
90 mov ARG_1, NEXT_QUEUED_SCB;
91END_CRITICAL
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. Allocate a
96 * card SCB for the host's SCB and get to work on it.
97 */
98 if ((ahc->flags & AHC_PAGESCBS) != 0) {
99 mov ALLZEROS call get_free_or_disc_scb;
100 } else {
101 /* In the non-paging case, the SCBID == hardware SCB index */
102 mov SCBPTR, ARG_1;
103 }
91
92 /*
93 * We have at least one queued SCB now and we don't have any
94 * SCBs in the list of SCBs awaiting selection. Allocate a
95 * card SCB for the host's SCB and get to work on it.
96 */
97 if ((ahc->flags & AHC_PAGESCBS) != 0) {
98 mov ALLZEROS call get_free_or_disc_scb;
99 } else {
100 /* In the non-paging case, the SCBID == hardware SCB index */
101 mov SCBPTR, ARG_1;
102 }
103 or SEQ_FLAGS2, SCB_DMA;
104END_CRITICAL
104dma_queued_scb:
105 /*
106 * DMA the SCB from host ram into the current SCB location.
107 */
108 mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
109 mov ARG_1 call dma_scb;
110 /*
111 * Check one last time to see if this SCB was canceled

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

123 mov NEXT_QUEUED_SCB, SCB_NEXT;
124 mov SCB_NEXT,WAITING_SCBH;
125 mov WAITING_SCBH, SCBPTR;
126 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
127 mov NONE, SNSCB_QOFF;
128 } else {
129 inc QINPOS;
130 }
105dma_queued_scb:
106 /*
107 * DMA the SCB from host ram into the current SCB location.
108 */
109 mvi DMAPARAMS, HDMAEN|DIRECTION|FIFORESET;
110 mov ARG_1 call dma_scb;
111 /*
112 * Check one last time to see if this SCB was canceled

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

124 mov NEXT_QUEUED_SCB, SCB_NEXT;
125 mov SCB_NEXT,WAITING_SCBH;
126 mov WAITING_SCBH, SCBPTR;
127 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
128 mov NONE, SNSCB_QOFF;
129 } else {
130 inc QINPOS;
131 }
132 and SEQ_FLAGS2, ~SCB_DMA;
131END_CRITICAL
132start_waiting:
133 /*
134 * Start the first entry on the waiting SCB list.
135 */
136 mov SCBPTR, WAITING_SCBH;
137 call start_selection;
138

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

687
688sg_advance:
689 clr A; /* add sizeof(struct scatter) */
690 add SCB_RESIDUAL_SGPTR[0],SG_SIZEOF;
691 adc SCB_RESIDUAL_SGPTR[1],A;
692 adc SCB_RESIDUAL_SGPTR[2],A;
693 adc SCB_RESIDUAL_SGPTR[3],A ret;
694
133END_CRITICAL
134start_waiting:
135 /*
136 * Start the first entry on the waiting SCB list.
137 */
138 mov SCBPTR, WAITING_SCBH;
139 call start_selection;
140

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

689
690sg_advance:
691 clr A; /* add sizeof(struct scatter) */
692 add SCB_RESIDUAL_SGPTR[0],SG_SIZEOF;
693 adc SCB_RESIDUAL_SGPTR[1],A;
694 adc SCB_RESIDUAL_SGPTR[2],A;
695 adc SCB_RESIDUAL_SGPTR[3],A ret;
696
697if ((ahc->features & AHC_CMD_CHAN) != 0) {
698disable_ccsgen:
699 test CCSGCTL, CCSGEN jz return;
700 test CCSGCTL, CCSGDONE jz .;
701disable_ccsgen_fetch_done:
702 clr CCSGCTL;
703 test CCSGCTL, CCSGEN jnz .;
704 ret;
695idle_loop:
705idle_loop:
696 if ((ahc->features & AHC_CMD_CHAN) != 0) {
697 /* Did we just finish fetching segs? */
698 cmp CCSGCTL, CCSGEN|CCSGDONE je idle_sgfetch_complete;
706 /* Did we just finish fetching segs? */
707 cmp CCSGCTL, CCSGEN|CCSGDONE je idle_sgfetch_complete;
699
708
700 /* Are we actively fetching segments? */
701 test CCSGCTL, CCSGEN jnz return;
709 /* Are we actively fetching segments? */
710 test CCSGCTL, CCSGEN jnz return;
702
711
703 /*
704 * Do we need any more segments?
705 */
706 test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jnz return;
712 /*
713 * Do we need any more segments?
714 */
715 test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jnz return;
707
716
708 /*
709 * Do we have any prefetch left???
710 */
711 cmp CCSGADDR, SG_PREFETCH_CNT jne idle_sg_avail;
717 /*
718 * Do we have any prefetch left???
719 */
720 cmp CCSGADDR, SG_PREFETCH_CNT jne idle_sg_avail;
712
721
713 /*
714 * Need to fetch segments, but we can only do that
715 * if the command channel is completely idle. Make
716 * sure we don't have an SCB prefetch going on.
717 */
718 test CCSCBCTL, CCSCBEN jnz return;
722 /*
723 * Need to fetch segments, but we can only do that
724 * if the command channel is completely idle. Make
725 * sure we don't have an SCB prefetch going on.
726 */
727 test CCSCBCTL, CCSCBEN jnz return;
719
728
720 /*
721 * We fetch a "cacheline aligned" and sized amount of data
722 * so we don't end up referencing a non-existant page.
723 * Cacheline aligned is in quotes because the kernel will
724 * set the prefetch amount to a reasonable level if the
725 * cacheline size is unknown.
726 */
727 mvi CCHCNT, SG_PREFETCH_CNT;
728 and CCHADDR[0], SG_PREFETCH_ALIGN_MASK, SCB_RESIDUAL_SGPTR;
729 bmov CCHADDR[1], SCB_RESIDUAL_SGPTR[1], 3;
730 mvi CCSGCTL, CCSGEN|CCSGRESET ret;
729 /*
730 * We fetch a "cacheline aligned" and sized amount of data
731 * so we don't end up referencing a non-existant page.
732 * Cacheline aligned is in quotes because the kernel will
733 * set the prefetch amount to a reasonable level if the
734 * cacheline size is unknown.
735 */
736 mvi CCHCNT, SG_PREFETCH_CNT;
737 and CCHADDR[0], SG_PREFETCH_ALIGN_MASK, SCB_RESIDUAL_SGPTR;
738 bmov CCHADDR[1], SCB_RESIDUAL_SGPTR[1], 3;
739 mvi CCSGCTL, CCSGEN|CCSGRESET ret;
731idle_sgfetch_complete:
740idle_sgfetch_complete:
732 clr CCSGCTL;
733 test CCSGCTL, CCSGEN jnz .;
734 and CCSGADDR, SG_PREFETCH_ADDR_MASK, SCB_RESIDUAL_SGPTR;
741 call disable_ccsgen_fetch_done;
742 and CCSGADDR, SG_PREFETCH_ADDR_MASK, SCB_RESIDUAL_SGPTR;
735idle_sg_avail:
743idle_sg_avail:
736 if ((ahc->features & AHC_ULTRA2) != 0) {
737 /* Does the hardware have space for another SG entry? */
738 test DFSTATUS, PRELOAD_AVAIL jz return;
739 bmov HADDR, CCSGRAM, 4;
740 bmov SINDEX, CCSGRAM, 1;
741 test SINDEX, 0x1 jz . + 2;
742 xor DATA_COUNT_ODD, 0x1;
743 bmov HCNT[0], SINDEX, 1;
744 bmov HCNT[1], CCSGRAM, 2;
745 bmov SCB_RESIDUAL_DATACNT[3], CCSGRAM, 1;
746 call sg_advance;
747 mov SINDEX, SCB_RESIDUAL_SGPTR[0];
748 test DATA_COUNT_ODD, 0x1 jz . + 2;
749 or SINDEX, ODD_SEG;
750 test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz . + 2;
751 or SINDEX, LAST_SEG;
752 mov SG_CACHE_PRE, SINDEX;
753 /* Load the segment by writing DFCNTRL again */
754 mov DFCNTRL, DMAPARAMS;
755 }
756 ret;
744 if ((ahc->features & AHC_ULTRA2) != 0) {
745 /* Does the hardware have space for another SG entry? */
746 test DFSTATUS, PRELOAD_AVAIL jz return;
747 bmov HADDR, CCSGRAM, 4;
748 bmov SINDEX, CCSGRAM, 1;
749 test SINDEX, 0x1 jz . + 2;
750 xor DATA_COUNT_ODD, 0x1;
751 bmov HCNT[0], SINDEX, 1;
752 bmov HCNT[1], CCSGRAM, 2;
753 bmov SCB_RESIDUAL_DATACNT[3], CCSGRAM, 1;
754 call sg_advance;
755 mov SINDEX, SCB_RESIDUAL_SGPTR[0];
756 test DATA_COUNT_ODD, 0x1 jz . + 2;
757 or SINDEX, ODD_SEG;
758 test SCB_RESIDUAL_DATACNT[3], SG_LAST_SEG jz . + 2;
759 or SINDEX, LAST_SEG;
760 mov SG_CACHE_PRE, SINDEX;
761 /* Load the segment by writing DFCNTRL again */
762 mov DFCNTRL, DMAPARAMS;
757 }
763 }
764 ret;
765}
758
759if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0 && ahc->pci_cachesize != 0) {
760/*
761 * Calculate the trailing portion of this S/G segment that cannot
762 * be transferred using memory write and invalidate PCI transactions.
763 * XXX Can we optimize this for PCI writes only???
764 */
765calc_mwi_residual:

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

1144 * is loaded as well as if there is an overrun.
1145 */
1146 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1147 test SSTAT0, TARGET jnz data_phase_done;
1148 }
1149 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
1150 test SSTAT1, REQINIT jz .;
1151 test SSTAT1,PHASEMIS jz data_phase_loop;
766
767if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0 && ahc->pci_cachesize != 0) {
768/*
769 * Calculate the trailing portion of this S/G segment that cannot
770 * be transferred using memory write and invalidate PCI transactions.
771 * XXX Can we optimize this for PCI writes only???
772 */
773calc_mwi_residual:

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

1152 * is loaded as well as if there is an overrun.
1153 */
1154 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1155 test SSTAT0, TARGET jnz data_phase_done;
1156 }
1157 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
1158 test SSTAT1, REQINIT jz .;
1159 test SSTAT1,PHASEMIS jz data_phase_loop;
1152
1153 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1154 /* Kill off any pending prefetch */
1155 clr CCSGCTL;
1156 test CCSGCTL, CCSGEN jnz .;
1157 }
1158 }
1159
1160data_phase_done:
1161 /*
1162 * After a DMA finishes, save the SG and STCNT residuals back into
1163 * the SCB. We use STCNT instead of HCNT, since it's a reflection
1164 * of how many bytes were transferred on the SCSI (as opposed to the
1165 * host) bus.
1166 */
1167 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1168 /* Kill off any pending prefetch */
1160 }
1161
1162data_phase_done:
1163 /*
1164 * After a DMA finishes, save the SG and STCNT residuals back into
1165 * the SCB. We use STCNT instead of HCNT, since it's a reflection
1166 * of how many bytes were transferred on the SCSI (as opposed to the
1167 * host) bus.
1168 */
1169 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1170 /* Kill off any pending prefetch */
1169 clr CCSGCTL;
1170 test CCSGCTL, CCSGEN jnz .;
1171 call disable_ccsgen;
1171 }
1172
1173 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1174 && ahc->pci_cachesize != 0) {
1175 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1176 test MWI_RESIDUAL, 0xFF jz bmov_resid;
1177 }
1178 mov A, MWI_RESIDUAL;

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

1643 nop;
1644 }
1645 }
1646 mov ARG_1, SINDIR;
1647 cmp ARG_1, SCB_LIST_NULL je snoop_tag;
1648 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1649 mov ARG_1 call findSCB;
1650 } else {
1172 }
1173
1174 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1175 && ahc->pci_cachesize != 0) {
1176 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1177 test MWI_RESIDUAL, 0xFF jz bmov_resid;
1178 }
1179 mov A, MWI_RESIDUAL;

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

1644 nop;
1645 }
1646 }
1647 mov ARG_1, SINDIR;
1648 cmp ARG_1, SCB_LIST_NULL je snoop_tag;
1649 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1650 mov ARG_1 call findSCB;
1651 } else {
1651 mov SCBPTR, RETURN_1;
1652 mov SCBPTR, ARG_1;
1652 }
1653 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1654 jmp setup_SCB_id_lun_okay;
1655 } else {
1653 }
1654 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1655 jmp setup_SCB_id_lun_okay;
1656 } else {
1656 jmp setup_SCB_id_okay;
1657 /*
1658 * We only allow one untagged command per-target
1659 * at a time. So, if the lun doesn't match, look
1660 * for a tag message.
1661 */
1662 mov A, SCB_LUN;
1663 cmp SAVED_LUN, A je setup_SCB_id_lun_okay;
1664 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1665 /*
1666 * findSCB removes the SCB from the
1667 * disconnected list, so we must replace
1668 * it there should this SCB be for another
1669 * lun.
1670 */
1671 call cleanup_scb;
1672 }
1657 }
1658
1659/*
1660 * Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
1661 * If we get one, we use the tag returned to find the proper
1662 * SCB. With SCB paging, we must search for non-tagged
1663 * transactions since the SCB may exist in any slot. If we're not
1664 * using SCB paging, we can use the tag as the direct index to the

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

1705 cmp SAVED_LUN, A jne not_found_cleanup_scb;
1706setup_SCB_id_lun_okay:
1707 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1708 or SEQ_FLAGS, 0x10;
1709 }
1710 test SCB_CONTROL,DISCONNECTED jz not_found_cleanup_scb;
1711 and SCB_CONTROL,~DISCONNECTED;
1712 test SCB_CONTROL, TAG_ENB jnz setup_SCB_tagged;
1673 }
1674
1675/*
1676 * Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
1677 * If we get one, we use the tag returned to find the proper
1678 * SCB. With SCB paging, we must search for non-tagged
1679 * transactions since the SCB may exist in any slot. If we're not
1680 * using SCB paging, we can use the tag as the direct index to the

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

1721 cmp SAVED_LUN, A jne not_found_cleanup_scb;
1722setup_SCB_id_lun_okay:
1723 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1724 or SEQ_FLAGS, 0x10;
1725 }
1726 test SCB_CONTROL,DISCONNECTED jz not_found_cleanup_scb;
1727 and SCB_CONTROL,~DISCONNECTED;
1728 test SCB_CONTROL, TAG_ENB jnz setup_SCB_tagged;
1713 mov A, SCBPTR;
1729 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1730 mov A, SCBPTR;
1731 }
1714 mvi ARG_1, SCB_LIST_NULL;
1715 mov SAVED_SCSIID call set_busy_target;
1732 mvi ARG_1, SCB_LIST_NULL;
1733 mov SAVED_SCSIID call set_busy_target;
1716 mov SCBPTR, A;
1734 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1735 mov SCBPTR, A;
1736 }
1717setup_SCB_tagged:
1718 mvi SEQ_FLAGS,IDENTIFY_SEEN; /* make note of IDENTIFY */
1719 call set_transfer_settings;
1720 /* See if the host wants to send a message upon reconnection */
1721 test SCB_CONTROL, MK_MESSAGE jz mesgin_done;
1722 mvi HOST_MSG call mk_mesg;
1723 jmp mesgin_done;
1724
1725not_found_cleanup_scb:
1726 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1737setup_SCB_tagged:
1738 mvi SEQ_FLAGS,IDENTIFY_SEEN; /* make note of IDENTIFY */
1739 call set_transfer_settings;
1740 /* See if the host wants to send a message upon reconnection */
1741 test SCB_CONTROL, MK_MESSAGE jz mesgin_done;
1742 mvi HOST_MSG call mk_mesg;
1743 jmp mesgin_done;
1744
1745not_found_cleanup_scb:
1746 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1727 call add_scb_to_free_list;
1747 call cleanup_scb;
1728 }
1729not_found:
1730 mvi NO_MATCH call set_seqint;
1731 jmp mesgin_done;
1732
1733mk_mesg:
1734 or SCSISIGO,ATNO,LASTPHASE;/* turn on ATNO */
1735 mov MSG_OUT,SINDEX ret;

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

2051 /* Wait for some data to arrive. */
2052dma_scb_hang_fifo:
2053 test DFSTATUS, FIFOEMP jnz dma_scb_hang_fifo;
2054dma_scb_hang_wait:
2055 test DFSTATUS, MREQPEND jnz dma_scb_hang_wait;
2056 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2057 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2058 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
1748 }
1749not_found:
1750 mvi NO_MATCH call set_seqint;
1751 jmp mesgin_done;
1752
1753mk_mesg:
1754 or SCSISIGO,ATNO,LASTPHASE;/* turn on ATNO */
1755 mov MSG_OUT,SINDEX ret;

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

2071 /* Wait for some data to arrive. */
2072dma_scb_hang_fifo:
2073 test DFSTATUS, FIFOEMP jnz dma_scb_hang_fifo;
2074dma_scb_hang_wait:
2075 test DFSTATUS, MREQPEND jnz dma_scb_hang_wait;
2076 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2077 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2078 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2079 test DFSTATUS, HDONE jnz dma_scb_hang_dma_done;
2059 /*
2060 * The PCI module no longer intends to perform
2061 * a PCI transaction and HDONE has not come true.
2062 * We are hung. Drain the fifo.
2063 */
2064dma_scb_hang_empty_fifo:
2065 /*
2066 * Skip lines not yet transfered into the FIFO.

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

2126 */
2127dma_finish:
2128 test DFSTATUS,HDONE jz dma_finish;
2129 /* Turn off DMA */
2130 and DFCNTRL, ~HDMAEN;
2131 test DFCNTRL, HDMAEN jnz .;
2132 ret;
2133
2080 /*
2081 * The PCI module no longer intends to perform
2082 * a PCI transaction and HDONE has not come true.
2083 * We are hung. Drain the fifo.
2084 */
2085dma_scb_hang_empty_fifo:
2086 /*
2087 * Skip lines not yet transfered into the FIFO.

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

2147 */
2148dma_finish:
2149 test DFSTATUS,HDONE jz dma_finish;
2150 /* Turn off DMA */
2151 and DFCNTRL, ~HDMAEN;
2152 test DFCNTRL, HDMAEN jnz .;
2153 ret;
2154
2155/*
2156 * Restore an SCB that failed to match an incoming reselection
2157 * to the correct/safe state. If the SCB is for a disconnected
2158 * transaction, it must be returned to the disconnected list.
2159 * If it is not in the disconnected state, it must be free.
2160 */
2161cleanup_scb:
2162 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2163 test SCB_CONTROL,DISCONNECTED jnz add_scb_to_disc_list;
2164 }
2134add_scb_to_free_list:
2135 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2136BEGIN_CRITICAL
2137 mov SCB_NEXT, FREE_SCBH;
2138 mvi SCB_TAG, SCB_LIST_NULL;
2139 mov FREE_SCBH, SCBPTR ret;
2140END_CRITICAL
2141 } else {

--- 39 unchanged lines hidden ---
2165add_scb_to_free_list:
2166 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2167BEGIN_CRITICAL
2168 mov SCB_NEXT, FREE_SCBH;
2169 mvi SCB_TAG, SCB_LIST_NULL;
2170 mov FREE_SCBH, SCBPTR ret;
2171END_CRITICAL
2172 } else {

--- 39 unchanged lines hidden ---