#define status_ready 0x10
#define status_reselected 0x11
#define status_timeout 0x12
#define status_selected 0x13
#define status_complete 0x14
#define status_disconnect 0x15
#define status_badstatus 0x16
#define status_overrun 0x17
#define status_underrun 0x18
#define status_badphase 0x19
#define status_badmsg 0x1a
#define status_badextmsg 0x1b
#define status_selftest 0x1c
#define status_iocomplete 0x1d
#define status_syncin 0x1e
#define status_widein 0x1f
#define status_ignore_residue 0x20
#define status_inactive 0x00
#define status_queued 0x01
#define status_selecting 0x02
#define status_active 0x03
#define status_waiting 0x04
#define OP_NDATA_IN 0x09000000L
#define OP_NDATA_OUT 0x08000000L
#define OP_WDATA_IN 0x01000000L
#define OP_WDATA_OUT 0x00000000L
#define OP_END 0x98080000L
#define ARG_END (status_iocomplete)
typedef struct
{
uint32 count;
uint32 address;
} SymInd;
#define PATCH_DATAIN ((Ent_do_datain/4) + 1)
#define PATCH_DATAOUT ((Ent_do_dataout/4) + 1)
#define ctxt_device 0
#define ctxt_sendmsg 1
#define ctxt_recvmsg 2
#define ctxt_extdmsg 3
#define ctxt_syncmsg 4
#define ctxt_status 5
#define ctxt_command 6
#define ctxt_widemsg 7
#define ctxt_program 8
typedef struct
{
uchar _command[12];
uchar _syncmsg[2];
uchar _widemsg[2];
uchar _sendmsg[8];
uchar _recvmsg[1];
uchar _extdmsg[1];
uchar _status[1];
uchar _padding[1];
SymInd device;
SymInd sendmsg;
SymInd recvmsg;
SymInd extdmsg;
SymInd syncmsg;
SymInd status;
SymInd command;
SymInd widemsg;
SymInd table[131];
} SymPriv;
#define ADJUST_PRIV_TO_DSA 28
#define ADJUST_PRIV_TO_TABLE 92
typedef struct _SymTarg
{
struct _Symbios *adapter;
struct _SymTarg *next;
uchar device[4];
int sem_targ;
int sem_done;
CCB_SCSIIO *ccb;
SymPriv *priv;
uint32 priv_phys;
uint32 table_phys;
uint32 datain_phys;
uint32 dataout_phys;
int inbound;
uint32 period;
uint32 offset;
uint32 wide;
uint32 flags;
uint32 status;
uint32 id;
} SymTarg;
#define tf_ask_sync 0x0001
#define tf_ask_wide 0x0002
#define tf_is_sync 0x0010
#define tf_is_wide 0x0020
#define tf_ignore 0x0100
typedef struct _Symbios
{
uint32 num;
uint32 iobase;
uint32 irq;
char *name;
uint32 host_targ_id;
uint32 max_targ_id;
int reset;
int registered;
uint32 *script;
uint32 sram_phys;
SymTarg targ[16];
spinlock hwlock;
SymTarg *startqueue;
SymTarg *startqueuetail;
SymTarg *active;
enum {
OFFLINE, IDLE, START, ACTIVE, TEST
} status;
struct {
uint period;
uint period_ns;
uchar scntl3;
uchar sxfer;
} syncinfo[16];
uint32 syncsize;
uint32 idmask;
uint32 scntl3;
uint32 sclk;
uint32 maxoffset;
uint32 op_in;
uint32 op_out;
} Symbios;