Deleted Added
full compact
aic7xxx.seq (24662) aic7xxx.seq (24794)
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,

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

32 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
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,

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

32 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $Id: aic7xxx.seq,v 1.68 1997/04/04 19:35:30 gibbs Exp $
40 * $Id: aic7xxx.seq,v 1.69 1997/04/05 22:03:47 gibbs Exp $
41 *
42 *-M************************************************************************/
43
44#include <dev/aic7xxx/aic7xxx.reg>
45#include <scsi/scsi_message.h>
46
47/*
48 * A few words on the waiting SCB list:

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

305/*
306 * Main loop for information transfer phases. If BSY is false, then
307 * we have a bus free condition, expected or not. Otherwise, wait
308 * for the target to assert REQ before checking MSG, C/D and I/O
309 * for the bus phase.
310 *
311 */
312ITloop:
41 *
42 *-M************************************************************************/
43
44#include <dev/aic7xxx/aic7xxx.reg>
45#include <scsi/scsi_message.h>
46
47/*
48 * A few words on the waiting SCB list:

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

305/*
306 * Main loop for information transfer phases. If BSY is false, then
307 * we have a bus free condition, expected or not. Otherwise, wait
308 * for the target to assert REQ before checking MSG, C/D and I/O
309 * for the bus phase.
310 *
311 */
312ITloop:
313 test SSTAT1,REQINIT jz ITloop;
313 test SSTAT1,REQINIT jz ITloop;
314 test SSTAT1, SCSIPERR jnz ITloop;
314
315 and A,PHASE_MASK,SCSISIGI;
316 mov LASTPHASE,A;
317 mov SCSISIGO,A;
318
319 cmp ALLZEROS,A je p_dataout;
320 cmp A,P_DATAIN je p_datain;
321 cmp A,P_COMMAND je p_command;
322 cmp A,P_MESGOUT je p_mesgout;
323 cmp A,P_STATUS je p_status;
324 cmp A,P_MESGIN je p_mesgin;
325
326 mvi INTSTAT,BAD_PHASE; /* unknown phase - signal driver */
327 jmp ITloop; /* Try reading the bus again. */
328
329await_busfree:
330 and SIMODE1, ~ENBUSFREE;
315
316 and A,PHASE_MASK,SCSISIGI;
317 mov LASTPHASE,A;
318 mov SCSISIGO,A;
319
320 cmp ALLZEROS,A je p_dataout;
321 cmp A,P_DATAIN je p_datain;
322 cmp A,P_COMMAND je p_command;
323 cmp A,P_MESGOUT je p_mesgout;
324 cmp A,P_STATUS je p_status;
325 cmp A,P_MESGIN je p_mesgin;
326
327 mvi INTSTAT,BAD_PHASE; /* unknown phase - signal driver */
328 jmp ITloop; /* Try reading the bus again. */
329
330await_busfree:
331 and SIMODE1, ~ENBUSFREE;
331 mov NONE, SCSIDATL; /* Ack the last byte */
332 call clear_target_state;
332 call clear_target_state;
333 mov NONE, SCSIDATL; /* Ack the last byte */
333 test SSTAT1,REQINIT|BUSFREE jz .;
334 test SSTAT1, BUSFREE jnz poll_for_work;
335 mvi INTSTAT, BAD_PHASE;
336
337clear_target_state:
338 clr DFCNTRL;
339 clr SCSIRATE; /*
340 * We don't know the target we will

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

533 * ATN must be dropped *at least* 90ns before we ack the last byte, so
534 * the code is aranged to execute two instructions before the byte is
535 * transferred to give a good margin of safety
536 *
537 * Keep an eye out for a phase change, in case the target issues
538 * a MESSAGE REJECT.
539 */
540p_mesgout_loop:
334 test SSTAT1,REQINIT|BUSFREE jz .;
335 test SSTAT1, BUSFREE jnz poll_for_work;
336 mvi INTSTAT, BAD_PHASE;
337
338clear_target_state:
339 clr DFCNTRL;
340 clr SCSIRATE; /*
341 * We don't know the target we will

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

534 * ATN must be dropped *at least* 90ns before we ack the last byte, so
535 * the code is aranged to execute two instructions before the byte is
536 * transferred to give a good margin of safety
537 *
538 * Keep an eye out for a phase change, in case the target issues
539 * a MESSAGE REJECT.
540 */
541p_mesgout_loop:
541 test SSTAT1, REQINIT jz p_mesgout_loop;
542 test SSTAT1, REQINIT jz p_mesgout_loop;
543 test SSTAT1, SCSIPERR jnz p_mesgout_loop;
542 and LASTPHASE, PHASE_MASK, SCSISIGI;
543 cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
544/*
545 * If the next bus phase after ATN drops is a message out, it means
546 * that the target is requesting that the last message(s) be resent.
547 */
548p_mesgout_dropatn:
549 cmp DINDEX,1 jne p_mesgout_testretry;/* last byte? */

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

775 * and non-tagged transactions since the SCB may exist in any slot.
776 * If we're not using SCB paging, we can use the tag as the direct
777 * index to the SCB.
778 */
779snoop_tag:
780 mov NONE,SCSIDATL; /* ACK Identify MSG */
781snoop_tag_loop:
782 test SSTAT1,REQINIT jz snoop_tag_loop;
544 and LASTPHASE, PHASE_MASK, SCSISIGI;
545 cmp LASTPHASE, P_MESGOUT jne p_mesgout_done;
546/*
547 * If the next bus phase after ATN drops is a message out, it means
548 * that the target is requesting that the last message(s) be resent.
549 */
550p_mesgout_dropatn:
551 cmp DINDEX,1 jne p_mesgout_testretry;/* last byte? */

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

777 * and non-tagged transactions since the SCB may exist in any slot.
778 * If we're not using SCB paging, we can use the tag as the direct
779 * index to the SCB.
780 */
781snoop_tag:
782 mov NONE,SCSIDATL; /* ACK Identify MSG */
783snoop_tag_loop:
784 test SSTAT1,REQINIT jz snoop_tag_loop;
785 test SSTAT1, SCSIPERR jnz snoop_tag_loop;
783 and LASTPHASE, PHASE_MASK, SCSISIGI;
784 cmp LASTPHASE, P_MESGIN jne not_found;
785 cmp SCSIBUSL,MSG_SIMPLE_Q_TAG jne not_found;
786get_tag:
787 or SEQ_FLAGS, TAGGED_SCB;
788 mvi ARG_1 call inb_next; /* tag value */
789/*
790 * See if the tag is in range. The tag is < SCBCOUNT if we add

--- 360 unchanged lines hidden ---
786 and LASTPHASE, PHASE_MASK, SCSISIGI;
787 cmp LASTPHASE, P_MESGIN jne not_found;
788 cmp SCSIBUSL,MSG_SIMPLE_Q_TAG jne not_found;
789get_tag:
790 or SEQ_FLAGS, TAGGED_SCB;
791 mvi ARG_1 call inb_next; /* tag value */
792/*
793 * See if the tag is in range. The tag is < SCBCOUNT if we add

--- 360 unchanged lines hidden ---