linux/drivers/scsi/aha152x.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _AHA152X_H
#define _AHA152X_H

/*
 * $Id: aha152x.h,v 2.7 2004/01/24 11:39:03 fischer Exp $
 */

/* number of queueable commands
   (unless we support more than 1 cmd_per_lun this should do) */
#define AHA152X_MAXQUEUE

#define AHA152X_REVID

/* port addresses */
#define SCSISEQ
#define SXFRCTL0
#define SXFRCTL1
#define SCSISIG
#define SCSIRATE
#define SELID
#define SCSIID
#define SCSIDAT
#define SCSIBUS
#define STCNT0
#define STCNT1
#define STCNT2
#define SSTAT0
#define SSTAT1
#define SSTAT2
#define SCSITEST
#define SSTAT3
#define SSTAT4
#define SIMODE0
#define SIMODE1
#define DMACNTRL0
#define DMACNTRL1
#define DMASTAT
#define FIFOSTAT
#define DATAPORT
#define BRSTCNTRL
#define PORTA
#define PORTB
#define REV
#define STACK
#define TEST

#define IO_RANGE

/* used in aha152x_porttest */
#define O_PORTA
#define O_PORTB
#define O_DMACNTRL1
#define O_STACK

/* used in tc1550_porttest */
#define O_TC_PORTA
#define O_TC_PORTB
#define O_TC_DMACNTRL1
#define O_TC_STACK

/* bits and bitmasks to ports */

/* SCSI sequence control */
#define TEMODEO
#define ENSELO
#define ENSELI
#define ENRESELI
#define ENAUTOATNO
#define ENAUTOATNI
#define ENAUTOATNP
#define SCSIRSTO

/* SCSI transfer control 0 */
#define SCSIEN
#define DMAEN
#define CH1
#define CLRSTCNT
#define SPIOEN
#define CLRCH1

/* SCSI transfer control 1 */
#define BITBUCKET
#define SWRAPEN
#define ENSPCHK
#define STIMESEL
#define STIMESEL_
#define ENSTIMER
#define BYTEALIGN

/* SCSI signal IN */
#define SIG_CDI
#define SIG_IOI
#define SIG_MSGI
#define SIG_ATNI
#define SIG_SELI
#define SIG_BSYI
#define SIG_REQI
#define SIG_ACKI

/* SCSI Phases */
#define P_MASK
#define P_DATAO
#define P_DATAI
#define P_CMD
#define P_STATUS
#define P_MSGO
#define P_MSGI

/* SCSI signal OUT */
#define SIG_CDO
#define SIG_IOO
#define SIG_MSGO
#define SIG_ATNO
#define SIG_SELO
#define SIG_BSYO
#define SIG_REQO
#define SIG_ACKO

/* SCSI rate control */
#define SXFR
#define SXFR_
#define SOFS

/* SCSI ID */
#define OID
#define OID_
#define TID

/* SCSI transfer count */
#define GETSTCNT()

#define SETSTCNT(X)

/* SCSI interrupt status */
#define TARGET
#define SELDO
#define SELDI
#define SELINGO
#define SWRAP
#define SDONE
#define SPIORDY
#define DMADONE

#define SETSDONE
#define CLRSELDO
#define CLRSELDI
#define CLRSELINGO
#define CLRSWRAP
#define CLRSDONE
#define CLRSPIORDY
#define CLRDMADONE

/* SCSI status 1 */
#define SELTO
#define ATNTARG
#define SCSIRSTI
#define PHASEMIS
#define BUSFREE
#define SCSIPERR
#define PHASECHG
#define REQINIT

#define CLRSELTIMO
#define CLRATNO
#define CLRSCSIRSTI
#define CLRBUSFREE
#define CLRSCSIPERR
#define CLRPHASECHG
#define CLRREQINIT

/* SCSI status 2 */
#define SOFFSET
#define SEMPTY
#define SFULL
#define SFCNT

/* SCSI status 3 */
#define SCSICNT
#define SCSICNT_
#define OFFCNT

/* SCSI TEST control */
#define SCTESTU
#define SCTESTD
#define STCTEST

/* SCSI status 4 */
#define SYNCERR
#define FWERR
#define FRERR

#define CLRSYNCERR
#define CLRFWERR
#define CLRFRERR

/* SCSI interrupt mode 0 */
#define ENSELDO
#define ENSELDI
#define ENSELINGO
#define ENSWRAP
#define ENSDONE
#define ENSPIORDY
#define ENDMADONE

/* SCSI interrupt mode 1 */
#define ENSELTIMO
#define ENATNTARG
#define ENSCSIRST
#define ENPHASEMIS
#define ENBUSFREE
#define ENSCSIPERR
#define ENPHASECHG
#define ENREQINIT

/* DMA control 0 */
#define ENDMA
#define _8BIT
#define DMA
#define WRITE_READ
#define INTEN
#define RSTFIFO
#define SWINT

/* DMA control 1 */
#define PWRDWN
#define STK

/* DMA status */
#define ATDONE
#define WORDRDY
#define INTSTAT
#define DFIFOFULL
#define DFIFOEMP

/* BURST control */
#define BON
#define BOFF

/* TEST REGISTER */
#define BOFFTMR
#define BONTMR
#define STCNTH
#define STCNTM
#define STCNTL
#define SCSIBLK
#define DMABLK

/* On the AHA-152x board PORTA and PORTB contain
   some information about the board's configuration. */
aha152x_config ;

#define cf_parity
#define cf_dmachan
#define cf_irq
#define cf_id
#define cf_dma
#define cf_boot
#define cf_msgclasses
#define cf_syncneg
#define cf_tardisc
#define cf_port

/* Some macros to manipulate ports and their bits */

#define SETPORT(PORT, VAL)
#define GETPORT(PORT)
#define SETBITS(PORT, BITS)
#define CLRBITS(PORT, BITS)
#define TESTHI(PORT, BITS)
#define TESTLO(PORT, BITS)

#define SETRATE(RATE)

#if defined(AHA152X_DEBUG)
enum {
  debug_procinfo  = 0x0001,
  debug_queue     = 0x0002,
  debug_locking   = 0x0004,
  debug_intr      = 0x0008,
  debug_selection = 0x0010,
  debug_msgo      = 0x0020,
  debug_msgi      = 0x0040,
  debug_status    = 0x0080,
  debug_cmd       = 0x0100,
  debug_datai     = 0x0200,
  debug_datao     = 0x0400,
  debug_eh	  = 0x0800,
  debug_done      = 0x1000,
  debug_phases    = 0x2000,
};
#endif

/* for the pcmcia stub */
struct aha152x_setup {};

struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *);
void aha152x_release(struct Scsi_Host *);
int aha152x_host_reset_host(struct Scsi_Host *);

#endif /* _AHA152X_H */