Deleted Added
full compact
aic7xxx.seq (13360) aic7xxx.seq (13386)
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 *Modifications/enhancements:

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

36 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 *SUCH DAMAGE.
38 *
39 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other
40 *optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org)
41 *
42 *-M************************************************************************/
43
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 *Modifications/enhancements:

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

36 *OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 *SUCH DAMAGE.
38 *
39 *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other
40 *optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org)
41 *
42 *-M************************************************************************/
43
44VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.26 1996/01/05 16:11:49 gibbs Exp $"
44VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.28 1996/01/09 16:14:03 gibbs Exp $"
45
46#include "../../dev/aic7xxx/aic7xxx_reg.h"
47
48/*
49 * We can't just use ACCUM in the sequencer code because it
50 * must be treated specially by the assembler, and it currently
51 * looks for the symbol 'A'. This is the only register defined
52 * the assembler's symbol space.

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

414 * Not in FreeBSD. the scatter list entry is only 8 bytes.
415 *
416 * struct ahc_dma_seg {
417 * physaddr addr; four bytes, little-endian order
418 * long len; four bytes, little endian order
419 * };
420 */
421
45
46#include "../../dev/aic7xxx/aic7xxx_reg.h"
47
48/*
49 * We can't just use ACCUM in the sequencer code because it
50 * must be treated specially by the assembler, and it currently
51 * looks for the symbol 'A'. This is the only register defined
52 * the assembler's symbol space.

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

414 * Not in FreeBSD. the scatter list entry is only 8 bytes.
415 *
416 * struct ahc_dma_seg {
417 * physaddr addr; four bytes, little-endian order
418 * long len; four bytes, little endian order
419 * };
420 */
421
422 mvi DINDEX,HADDR
422/*
423 * For Linux, we must throw away four bytes since there is a 32bit gap
424 * in the middle of a struct scatterlist
425 */
423/*
424 * For Linux, we must throw away four bytes since there is a 32bit gap
425 * in the middle of a struct scatterlist
426 */
426#ifdef LINUX
427#ifdef linux
427 call bcopy_4_dfdat
428 mov NONE,DFDAT
429 mov NONE,DFDAT
430 mov NONE,DFDAT
431 mov NONE,DFDAT
432 call bcopy_3_dfdat /* Only support 24 bit length. */
433#else
434/*
435 * For FreeBSD, just copy it wholesale
436 */
428 call bcopy_4_dfdat
429 mov NONE,DFDAT
430 mov NONE,DFDAT
431 mov NONE,DFDAT
432 mov NONE,DFDAT
433 call bcopy_3_dfdat /* Only support 24 bit length. */
434#else
435/*
436 * For FreeBSD, just copy it wholesale
437 */
437 mvi DINDEX,HADDR
438 call bcopy_7_dfdat
439#endif
440
441/* Load STCNT as well. It is a mirror of HCNT */
442 mvi DINDEX,STCNT
443 mvi HCNT call bcopy_3
444 test SSTAT1,PHASEMIS jz data_phase_loop
445

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

508 */
509p_mesgout_loop:
510 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis
511 test SSTAT0,SPIORDY jz p_mesgout_loop
512 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */
513 mvi CLRSINT1,CLRATNO /* drop ATN */
514p_mesgout_outb:
515 dec DINDEX
438 call bcopy_7_dfdat
439#endif
440
441/* Load STCNT as well. It is a mirror of HCNT */
442 mvi DINDEX,STCNT
443 mvi HCNT call bcopy_3
444 test SSTAT1,PHASEMIS jz data_phase_loop
445

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

508 */
509p_mesgout_loop:
510 test SSTAT1,PHASEMIS jnz p_mesgout_phasemis
511 test SSTAT0,SPIORDY jz p_mesgout_loop
512 cmp DINDEX,1 jne p_mesgout_outb /* last byte? */
513 mvi CLRSINT1,CLRATNO /* drop ATN */
514p_mesgout_outb:
515 dec DINDEX
516 or CLRSINT0, CLRSPIORDY
516 mov SCSIDATL,SINDIR
517
518p_mesgout4:
519 test DINDEX,0xff jnz p_mesgout_loop
520
521/*
522 * If the next bus phase after ATN drops is a message out, it means
523 * that the target is requesting that the last message(s) be resent.

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

876 * we send our ACK.
877 *
878 * The assumption here is that these are called in a particular sequence,
879 * and that REQ is already set when inb_first is called. inb_{first,next}
880 * use the same calling convention as inb.
881 */
882
883inb_next:
517 mov SCSIDATL,SINDIR
518
519p_mesgout4:
520 test DINDEX,0xff jnz p_mesgout_loop
521
522/*
523 * If the next bus phase after ATN drops is a message out, it means
524 * that the target is requesting that the last message(s) be resent.

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

877 * we send our ACK.
878 *
879 * The assumption here is that these are called in a particular sequence,
880 * and that REQ is already set when inb_first is called. inb_{first,next}
881 * use the same calling convention as inb.
882 */
883
884inb_next:
885 or CLRSINT0, CLRSPIORDY
884 mov NONE,SCSIDATL /*dummy read from latch to ACK*/
885inb_next_wait:
886 test SSTAT1,PHASEMIS jnz mesgin_phasemis
887 test SSTAT0,SPIORDY jz inb_next_wait /* wait for next byte */
888inb_first:
889 mov DINDEX,SINDEX
890 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/
891inb_last:

--- 232 unchanged lines hidden ---
886 mov NONE,SCSIDATL /*dummy read from latch to ACK*/
887inb_next_wait:
888 test SSTAT1,PHASEMIS jnz mesgin_phasemis
889 test SSTAT0,SPIORDY jz inb_next_wait /* wait for next byte */
890inb_first:
891 mov DINDEX,SINDEX
892 mov DINDIR,SCSIBUSL ret /*read byte directly from bus*/
893inb_last:

--- 232 unchanged lines hidden ---