Lines Matching +full:always +full:- +full:wait +full:- +full:for +full:- +full:ack

2  * Adaptec U320 device driver firmware for Linux and FreeBSD.
4 * Copyright (c) 1994-2001, 2004 Justin T. Gibbs.
5 * Copyright (c) 2000-2002 Adaptec Inc.
17 * including a substantially similar Disclaimer requirement for further
19 * 3. Neither the names of the above-listed copyright holders nor the names
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
32 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
58 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
85 * If we have completions stalled waiting for the qfreeze
100 cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL jne . - 1;
109 * ENSELO is cleared by a SELDO, so we must test for SELDO
124 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
128 * and re-selections. Make the LED status
149 * We have received good status for this transaction. There may
159 * pending select-outs.
170 * be a bit more dilligent in how we check for FIFOs pertaining
177 * Case 1 can be detected by noticing a non-zero FIFO active
182 * pointers for this same context in the other FIFO. So, if
221 * If the SCB was uploaded for some reason other than
222 * bad SCSI status (currently only for underruns), we
223 * queue the SCB for normal completion. Otherwise, we
224 * wait until any select-out activity has halted, and
250 * to the host, always coalesce. Otherwise honor the
259 * bother waiting for another command to complete.
262 /* Add -1 so that jnc means <= not just < */
263 add A, -1, INT_COALESCING_MINCMDS;
298 if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) {
337 * for this target.
352 * the first for this target.
357 * SCBs that want to send messages must always be
358 * at the head of their per-target queue so that
363 * wait for it to empty before entering this SCB
364 * into the waiting for selection queue. Otherwise
365 * our batching and round-robin selection scheme
369 * SCB can be queued to the waiting for selection
400 * Append SCB to the tail of the waiting for
419 * if select-outs are currently frozen or we have
446 add CMDS_PENDING, -1;
447 adc CMDS_PENDING[1], -1;
455 * in the data-stream should the target force a retry on
457 * PCI-X mode, we do this to avoid split transactions since
481 * is responsible for polling for transfer completion.
517 * fail to store the new mode value for restoration on
520 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {
528 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
539 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) {
559 * To simplify the workaround for this bug in SELDO
561 * selection so we can rely on it even for case #1 above.
573 * to our negotiation table entry for this selection will
583 * Allocate a FIFO for a non-packetized transaction.
585 * can allocate a FIFO for a non-packetized transaction.
594 if ((ahd->bugs & AHD_NONPACKFIFO_BUG) != 0) {
618 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
622 * and re-selections. Make the LED status
626 * are busy. This handles the non-packetized
633 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
658 * Take Razor #494 into account for above.
664 * In Non-Packetize Mode:
671 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
675 * and re-selections. Make the LED status
677 * the point of re-selection until our idle
679 * are busy. This handles the non-packetized
687 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) {
689 * For packetized, the LQO manager clears ENSELO on
690 * the assertion of SELDO. If we are non-packetized,
696 * The update is correct for LQOSTAT1 errors. All
746 * that the per-target selection queue is now empty.
752 * We know that neither the per-TID list nor the list of
766 * Queue any pending MK_MESSAGE SCB for this target now
801 if ((ahd->bugs & AHD_LQO_ATNO_BUG) != 0) {
805 * REQs in a non-packet phase.
819 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
845 * Main loop for information transfer phases. Wait for the
846 * target to assert REQ before checking MSG, C/D and I/O for
875 * re-allocate a FIFO so transfer state is
887 add NONE, -17, SCB_CDB_LEN;
900 if ((ahd->features & AHD_FAST_CDB_DELIVERY) != 0) {
909 * the target goes to data-in, but if the acks go
921 test DFCNTRL, SCSIEN jnz . - 1;
937 * Status phase. Wait for the data byte to appear, then read it
962 * on an SCB that might not be for the current nexus. (For example, a
970 * in case the target decides to put us in this phase for some strange
974 /* Turn on ATN for the retry */
1054 mov NONE, SCSIDAT; /* ACK Byte */
1078 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1092 * Determine whether a target is using tagged or non-tagged
1094 * the per-device, disconnected array. If there is no untagged
1095 * transaction for this target, this must be a tagged transaction.
1108 * Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
1110 * SCB. After receiving the tag, look for the SCB at SCB locations tag and
1114 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1117 mov NONE, SCSIDAT; /* ACK Identify MSG */
1119 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1123 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1142 * Ensure that the SCB the tag points to is for
1146 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1184 * for this command and setting ATN while we are still processing
1221 /* Cancel any pending select-out. */
1233 * Complete the current FIFO's SCB if data for this same
1247 * Check for residuals
1283 * store the SCB id for it in our untagged target table for lookup on
1293 * XXX - Wait for more testing.
1309 if ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0) {
1317 mov NONE, SCSIDAT; /* Ack the last byte */
1343 * Copying RAM values back to SCB, for Save Data Pointers message, but
1347 * Ack the message as soon as possible.
1352 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1377 * SCB anytime we enter a data phase for the first time, so all
1380 * sure we have a clean start for the next data or command phase.
1392 if ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0) {
1398 * count REQ while we are waiting for it to fall during
1399 * an async phase due to our asserted ACK. Each
1421 * An ACK is not sent on input from the target until SCSIDATL is read from.
1422 * So we wait until SCSIDATL is latched (the usual way), then read the data
1426 * data byte on the bus until we send our ACK.
1433 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1436 * If there is a parity error, wait for the kernel to
1450 mov NONE,SCSIDAT ret; /*dummy read from latch to ACK*/
1486 * that a FIFO will be freed to handle snapshot requests for
1490 if ((ahd->features & AHD_RTI) == 0) {
1499 * Switch to the other FIFO. Non-RTI chips
1524 * so we don't end up referencing a non-existent page.
1531 if ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0) {
1550 /* Does the hardware have space for another SG entry? */
1555 * first segment in the S/G FIFO. Wait until it is
1558 if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0) {
1561 if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
1568 if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) {
1571 if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
1586 if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0) {
1638 * If we re-enter the data phase after going through another
1640 * corrupted by the interveining, non-data, transfers. Ask
1650 * Turn on `Bit Bucket' mode, wait until the target takes
1665 /* Wait for non-data phase. */
1712 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
1716 * We have enabled the auto-ack feature. This means
1720 * to wait for LAST_SEG_DONE to come true on a completed
1722 * non-empty. We know there is more data yet to transfer
1737 if ((ahd->flags & AHD_TARGETROLE) != 0) {
1740 if ((ahd->flags & AHD_INITIATORROLE) != 0) {
1750 if ((ahd->flags & AHD_TARGETROLE) != 0) {
1754 * For data-in phases, wait for any pending acks from the
1756 * send Ignore Wide Residue messages for data-in phases.
1782 * to fetch additional segments for this transfer,
1824 add SCB_RESIDUAL_SGPTR[1], -1;
1825 adc SCB_RESIDUAL_SGPTR[2], -1;
1826 adc SCB_RESIDUAL_SGPTR[3], -1;
1835 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {
1838 * for intvec2, but is restored on iret.
1850 if ((ahd->features & AHD_RTI) == 0) {
1852 * On RevA Silicon, if the target returns us to data-out
1853 * after we have already trained for data-out, it is
1854 * possible for us to transition the free running clock to
1855 * data-valid before the required 100ns P1 setup time (8 P1
1856 * assertions in fast-160 mode). This will only happen if
1857 * this L-Q is a continuation of a data transfer for which
1859 * followed by LQ/Data for the same write transaction).
1912 * This happens between packets in a stream for a single L_Q. Since we
1914 * so it can be used for other transactions. On RTI capable controllers,
1925 if ((ahd->features & AHD_RTI) == 0) {
1942 add NONE, -13, SCB_CDB_LEN;
1958 * Wait in idle loop for transfer to complete.
1982 * overrun condition. For the write case, the hardware cannot
1983 * ack bytes until data are provided. So, if the target begins
1986 * situation. For the read case, the hardware will continue to
1987 * ack bytes into the FIFO, and may even ack the last overrun packet
1988 * into the FIFO. If the FIFO should become non-empty, we are in
2006 * will not be asserted if the NONPACKREQ is for us,
2010 * waiting for either shadow valid or last_seg_done.
2026 * Either a SAVEPTRS interrupt condition is pending for this FIFO
2027 * or we have a pending NONPACKREQ for this FIFO. We differentiate
2029 * prior to clearing this status and executing the common code for
2034 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
2046 * Keep a handler around for this FIFO until it drains
2062 * This indicates that all of the allowed data for this
2064 * Check for overrun and see if we can complete this command.
2073 * Wait for the current context to finish to verify that
2083 * poll for these statuses too.
2107 * Must wait until CDB xfer is over before issuing the
2119 * None-the-less, we must still catch and report overruns to
2120 * the host. Additionally, properly catch unexpected non-packet
2130 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
2162 * if it is for the current context. If it is for the current
2187 * (re)selection). Routines that know that the context responsible for this
2190 * we simply do not have the full I_T_L_Q for this phase.
2215 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
2246 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0) {
2255 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0) {
2273 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0) {