1998-05-08 04:05:19 +04:00
|
|
|
/* $NetBSD: siivar.h,v 1.4 1998/05/08 00:05:19 simonb Exp $ */
|
1996-10-13 07:02:39 +04:00
|
|
|
|
|
|
|
#ifndef _SIIVAR_H
|
|
|
|
#define _SIIVAR_H
|
|
|
|
|
|
|
|
typedef struct scsi_state {
|
|
|
|
int statusByte; /* status byte returned during STATUS_PHASE */
|
|
|
|
int dmaDataPhase; /* which data phase to expect */
|
|
|
|
int dmaCurPhase; /* SCSI phase if DMA is in progress */
|
|
|
|
int dmaPrevPhase; /* SCSI phase of DMA suspended by disconnect */
|
|
|
|
u_short *dmaAddr[2]; /* DMA buffer memory address */
|
|
|
|
int dmaBufIndex; /* which of the above is currently in use */
|
|
|
|
int dmalen; /* amount to transfer in this chunk */
|
|
|
|
int cmdlen; /* total remaining amount of cmd to transfer */
|
|
|
|
u_char *cmd; /* current pointer within scsicmd->cmd */
|
|
|
|
int buflen; /* total remaining amount of data to transfer */
|
|
|
|
char *buf; /* current pointer within scsicmd->buf */
|
|
|
|
u_short flags; /* see below */
|
|
|
|
u_short prevComm; /* command reg before disconnect */
|
|
|
|
u_short dmaCtrl; /* DMA control register if disconnect */
|
|
|
|
u_short dmaAddrL; /* DMA address register if disconnect */
|
|
|
|
u_short dmaAddrH; /* DMA address register if disconnect */
|
|
|
|
u_short dmaCnt; /* DMA count if disconnect */
|
|
|
|
u_short dmaByte; /* DMA byte if disconnect on odd boundary */
|
|
|
|
u_short dmaReqAck; /* DMA synchronous xfer offset or 0 if async */
|
|
|
|
} State;
|
|
|
|
|
|
|
|
/* state flags */
|
|
|
|
#define FIRST_DMA 0x01 /* true if no data DMA started yet */
|
|
|
|
#define PARITY_ERR 0x02 /* true if parity error seen */
|
|
|
|
|
1998-05-08 04:05:19 +04:00
|
|
|
#define SII_NCMD 8
|
1996-10-13 07:02:39 +04:00
|
|
|
struct siisoftc {
|
|
|
|
struct device sc_dev; /* us as a device */
|
|
|
|
void *sc_buf; /* DMA buffer (may be special mem) */
|
|
|
|
SIIRegs *sc_regs; /* HW address of SII controller chip */
|
|
|
|
int sc_flags;
|
|
|
|
int sc_target; /* target SCSI ID if connected */
|
|
|
|
ScsiCmd *sc_cmd[SII_NCMD]; /* active command indexed by ID */
|
1998-04-19 05:27:02 +04:00
|
|
|
void (*sii_copytobuf) __P((u_short *src, volatile u_short *dst, int ln));
|
|
|
|
void (*sii_copyfrombuf) __P((volatile u_short *src, char *dst, int len));
|
|
|
|
|
1996-10-13 07:02:39 +04:00
|
|
|
State sc_st[SII_NCMD]; /* state info for each active command */
|
|
|
|
#ifdef NEW_SCSI
|
1997-08-27 15:22:52 +04:00
|
|
|
struct scsipi_link sc_link; /* scsipi lint struct */
|
1996-10-13 07:02:39 +04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
int siiintr __P((void *sc));
|
|
|
|
|
|
|
|
/* Machine-indepedent back-end attach entry point */
|
|
|
|
void siiattach __P((struct siisoftc *sc));
|
|
|
|
|
|
|
|
#endif /* _SIIVAR_H */
|