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

1 /*-
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
49 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
56 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
83 * If we have completions stalled waiting for the qfreeze
98 cmp SCB_NEXT_COMPLETE[1], SCB_LIST_NULL jne . - 1;
107 * ENSELO is cleared by a SELDO, so we must test for SELDO
122 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
126 * and re-selections. Make the LED status
147 * We have received good status for this transaction. There may
157 * pending select-outs.
168 * be a bit more dilligent in how we check for FIFOs pertaining
175 * Case 1 can be detected by noticing a non-zero FIFO active
180 * pointers for this same context in the other FIFO. So, if
219 * If the SCB was uploaded for some reason other than
220 * bad SCSI status (currently only for underruns), we
221 * queue the SCB for normal completion. Otherwise, we
222 * wait until any select-out activity has halted, and
248 * to the host, always coalesce. Otherwise honor the
257 * bother waiting for another command to complete.
260 /* Add -1 so that jnc means <= not just < */
261 add A, -1, INT_COALESCING_MINCMDS;
296 if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) {
335 * for this target.
350 * the first for this target.
355 * SCBs that want to send messages must always be
356 * at the head of their per-target queue so that
361 * wait for it to empty before entering this SCB
362 * into the waiting for selection queue. Otherwise
363 * our batching and round-robin selection scheme
367 * SCB can be queued to the waiting for selection
398 * Append SCB to the tail of the waiting for
417 * if select-outs are currently frozen or we have
444 add CMDS_PENDING, -1;
445 adc CMDS_PENDING[1], -1;
453 * in the data-stream should the target force a retry on
455 * PCI-X mode, we do this to avoid split transactions since
479 * is responsible for polling for transfer completion.
515 * fail to store the new mode value for restoration on
518 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {
526 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
537 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) {
557 * To simplify the workaround for this bug in SELDO
559 * selection so we can rely on it even for case #1 above.
571 * to our negotiation table entry for this selection will
581 * Allocate a FIFO for a non-packetized transaction.
583 * can allocate a FIFO for a non-packetized transaction.
592 if ((ahd->bugs & AHD_NONPACKFIFO_BUG) != 0) {
616 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
620 * and re-selections. Make the LED status
624 * are busy. This handles the non-packetized
631 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
656 * Take Razor #494 into account for above.
662 * In Non-Packetize Mode:
669 if ((ahd->bugs & AHD_FAINT_LED_BUG) != 0) {
673 * and re-selections. Make the LED status
675 * the point of re-selection until our idle
677 * are busy. This handles the non-packetized
685 if ((ahd->bugs & AHD_SENT_SCB_UPDATE_BUG) != 0) {
687 * For packetized, the LQO manager clears ENSELO on
688 * the assertion of SELDO. If we are non-packetized,
694 * The update is correct for LQOSTAT1 errors. All
744 * that the per-target selection queue is now empty.
750 * We know that neither the per-TID list nor the list of
764 * Queue any pending MK_MESSAGE SCB for this target now
799 if ((ahd->bugs & AHD_LQO_ATNO_BUG) != 0) {
803 * REQs in a non-packet phase.
817 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
843 * Main loop for information transfer phases. Wait for the
844 * target to assert REQ before checking MSG, C/D and I/O for
873 * re-allocate a FIFO so transfer state is
885 add NONE, -17, SCB_CDB_LEN;
898 if ((ahd->features & AHD_FAST_CDB_DELIVERY) != 0) {
907 * the target goes to data-in, but if the acks go
919 test DFCNTRL, SCSIEN jnz . - 1;
935 * Status phase. Wait for the data byte to appear, then read it
960 * on an SCB that might not be for the current nexus. (For example, a
968 * in case the target decides to put us in this phase for some strange
972 /* Turn on ATN for the retry */
1052 mov NONE, SCSIDAT; /* ACK Byte */
1076 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1090 * Determine whether a target is using tagged or non-tagged
1092 * the per-device, disconnected array. If there is no untagged
1093 * transaction for this target, this must be a tagged transaction.
1106 * Here we "snoop" the bus looking for a SIMPLE QUEUE TAG message.
1108 * SCB. After receiving the tag, look for the SCB at SCB locations tag and
1112 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1115 mov NONE, SCSIDAT; /* ACK Identify MSG */
1117 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1121 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1140 * Ensure that the SCB the tag points to is for
1144 if ((ahd->flags & AHD_SEQUENCER_DEBUG) != 0) {
1182 * for this command and setting ATN while we are still processing
1219 /* Cancel any pending select-out. */
1231 * Complete the current FIFO's SCB if data for this same
1245 * Check for residuals
1281 * store the SCB id for it in our untagged target table for lookup on
1291 * XXX - Wait for more testing.
1307 if ((ahd->bugs & AHD_BUSFREEREV_BUG) == 0) {
1315 mov NONE, SCSIDAT; /* Ack the last byte */
1341 * Copying RAM values back to SCB, for Save Data Pointers message, but
1345 * Ack the message as soon as possible.
1350 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1375 * SCB anytime we enter a data phase for the first time, so all
1378 * sure we have a clean start for the next data or command phase.
1390 if ((ahd->bugs & AHD_EARLY_REQ_BUG) != 0) {
1396 * count REQ while we are waiting for it to fall during
1397 * an async phase due to our asserted ACK. Each
1419 * An ACK is not sent on input from the target until SCSIDATL is read from.
1420 * So we wait until SCSIDATL is latched (the usual way), then read the data
1424 * data byte on the bus until we send our ACK.
1431 mov NONE,SCSIDAT; /*dummy read from latch to ACK*/
1434 * If there is a parity error, wait for the kernel to
1448 mov NONE,SCSIDAT ret; /*dummy read from latch to ACK*/
1484 * that a FIFO will be freed to handle snapshot requests for
1488 if ((ahd->features & AHD_RTI) == 0) {
1497 * Switch to the other FIFO. Non-RTI chips
1522 * so we don't end up referencing a non-existant page.
1529 if ((ahd->bugs & AHD_REG_SLOW_SETTLE_BUG) != 0) {
1548 /* Does the hardware have space for another SG entry? */
1553 * first segment in the S/G FIFO. Wait until it is
1556 if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) == 0) {
1559 if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
1566 if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) {
1569 if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
1584 if ((ahd->features & AHD_NEW_DFCNTRL_OPTS) != 0) {
1636 * If we re-enter the data phase after going through another
1638 * corrupted by the interveining, non-data, transfers. Ask
1648 * Turn on `Bit Bucket' mode, wait until the target takes
1663 /* Wait for non-data phase. */
1710 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
1714 * We have enabled the auto-ack feature. This means
1718 * to wait for LAST_SEG_DONE to come true on a completed
1720 * non-empty. We know there is more data yet to transfer
1735 if ((ahd->flags & AHD_TARGETROLE) != 0) {
1738 if ((ahd->flags & AHD_INITIATORROLE) != 0) {
1748 if ((ahd->flags & AHD_TARGETROLE) != 0) {
1752 * For data-in phases, wait for any pending acks from the
1754 * send Ignore Wide Residue messages for data-in phases.
1780 * to fetch additional segments for this transfer,
1822 add SCB_RESIDUAL_SGPTR[1], -1;
1823 adc SCB_RESIDUAL_SGPTR[2], -1;
1824 adc SCB_RESIDUAL_SGPTR[3], -1;
1833 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {
1836 * for intvec2, but is restored on iret.
1848 if ((ahd->features & AHD_RTI) == 0) {
1850 * On RevA Silicon, if the target returns us to data-out
1851 * after we have already trained for data-out, it is
1852 * possible for us to transition the free running clock to
1853 * data-valid before the required 100ns P1 setup time (8 P1
1854 * assertions in fast-160 mode). This will only happen if
1855 * this L-Q is a continuation of a data transfer for which
1857 * followed by LQ/Data for the same write transaction).
1910 * This happens between packets in a stream for a single L_Q. Since we
1912 * so it can be used for other transactions. On RTI capable controllers,
1923 if ((ahd->features & AHD_RTI) == 0) {
1940 add NONE, -13, SCB_CDB_LEN;
1956 * Wait in idle loop for transfer to complete.
1980 * overrun condition. For the write case, the hardware cannot
1981 * ack bytes until data are provided. So, if the target begins
1984 * situation. For the read case, the hardware will continue to
1985 * ack bytes into the FIFO, and may even ack the last overrun packet
1986 * into the FIFO. If the FIFO should become non-empty, we are in
2004 * will not be asserted if the NONPACKREQ is for us,
2008 * waiting for either shadow valid or last_seg_done.
2024 * Either a SAVEPTRS interrupt condition is pending for this FIFO
2025 * or we have a pending NONPACKREQ for this FIFO. We differentiate
2027 * prior to clearing this status and executing the common code for
2032 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
2044 * Keep a handler around for this FIFO until it drains
2060 * This indicates that all of the allowed data for this
2062 * Check for overrun and see if we can complete this command.
2071 * Wait for the current context to finish to verify that
2081 * poll for these statuses too.
2105 * Must wait until CDB xfer is over before issuing the
2117 * None-the-less, we must still catch and report overruns to
2118 * the host. Additionally, properly catch unexpected non-packet
2128 if ((ahd->bugs & AHD_AUTOFLUSH_BUG) != 0) {
2160 * if it is for the current context. If it is for the current
2185 * (re)selection). Routines that know that the context responsible for this
2188 * we simply do not have the full I_T_L_Q for this phase.
2213 if ((ahd->bugs & AHD_BUSFREEREV_BUG) != 0) {
2244 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) == 0) {
2253 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0) {
2271 if ((ahd->bugs & AHD_PKT_BITBUCKET_BUG) != 0) {