0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _MAC53C94_H
0009 #define _MAC53C94_H
0010
0011
0012
0013
0014
0015 struct mac53c94_regs {
0016 unsigned char count_lo;
0017 char pad0[15];
0018 unsigned char count_mid;
0019 char pad1[15];
0020 unsigned char fifo;
0021 char pad2[15];
0022 unsigned char command;
0023 char pad3[15];
0024 unsigned char status;
0025 char pad4[15];
0026 unsigned char interrupt;
0027 char pad5[15];
0028 unsigned char seqstep;
0029 char pad6[15];
0030 unsigned char flags;
0031 char pad7[15];
0032 unsigned char config1;
0033 char pad8[15];
0034 unsigned char clk_factor;
0035 char pad9[15];
0036 unsigned char test;
0037 char pad10[15];
0038 unsigned char config2;
0039 char pad11[15];
0040 unsigned char config3;
0041 char pad12[15];
0042 unsigned char config4;
0043 char pad13[15];
0044 unsigned char count_hi;
0045 char pad14[15];
0046 unsigned char fifo_res;
0047 char pad15[15];
0048 };
0049
0050
0051
0052
0053 #define dest_id status
0054 #define sel_timeout interrupt
0055 #define sync_period seqstep
0056 #define sync_offset flags
0057
0058
0059
0060
0061 #define CMD_DMA_MODE 0x80
0062 #define CMD_MODE_MASK 0x70
0063 #define CMD_MODE_INIT 0x10
0064 #define CMD_MODE_TARG 0x20
0065 #define CMD_MODE_DISC 0x40
0066
0067 #define CMD_NOP 0
0068 #define CMD_FLUSH 1
0069 #define CMD_RESET 2
0070 #define CMD_SCSI_RESET 3
0071
0072 #define CMD_XFER_DATA 0x10
0073 #define CMD_I_COMPLETE 0x11
0074 #define CMD_ACCEPT_MSG 0x12
0075 #define CMD_XFER_PAD 0x18
0076 #define CMD_SET_ATN 0x1a
0077 #define CMD_CLR_ATN 0x1b
0078
0079 #define CMD_SEND_MSG 0x20
0080 #define CMD_SEND_STATUS 0x21
0081 #define CMD_SEND_DATA 0x22
0082 #define CMD_DISC_SEQ 0x23
0083 #define CMD_TERMINATE 0x24
0084 #define CMD_T_COMPLETE 0x25
0085 #define CMD_DISCONNECT 0x27
0086 #define CMD_RECV_MSG 0x28
0087 #define CMD_RECV_CDB 0x29
0088 #define CMD_RECV_DATA 0x2a
0089 #define CMD_RECV_CMD 0x2b
0090 #define CMD_ABORT_DMA 0x04
0091
0092 #define CMD_RESELECT 0x40
0093 #define CMD_SELECT 0x41
0094 #define CMD_SELECT_ATN 0x42
0095 #define CMD_SELATN_STOP 0x43
0096 #define CMD_ENABLE_SEL 0x44
0097 #define CMD_DISABLE_SEL 0x45
0098 #define CMD_SEL_ATN3 0x46
0099 #define CMD_RESEL_ATN3 0x47
0100
0101
0102
0103
0104 #define STAT_IRQ 0x80
0105 #define STAT_ERROR 0x40
0106 #define STAT_PARITY 0x20
0107 #define STAT_TC_ZERO 0x10
0108 #define STAT_DONE 0x08
0109 #define STAT_PHASE 0x07
0110 #define STAT_MSG 0x04
0111 #define STAT_CD 0x02
0112 #define STAT_IO 0x01
0113
0114
0115
0116
0117 #define INTR_RESET 0x80
0118 #define INTR_ILL_CMD 0x40
0119 #define INTR_DISCONNECT 0x20
0120 #define INTR_BUS_SERV 0x10
0121 #define INTR_DONE 0x08
0122 #define INTR_RESELECTED 0x04
0123 #define INTR_SEL_ATN 0x02
0124 #define INTR_SELECT 0x01
0125
0126
0127
0128
0129 #define TIMO_VAL(x) ((x) * 5000 / 7682)
0130
0131
0132
0133
0134 #define SS_MASK 7
0135 #define SS_ARB_SEL 0
0136 #define SS_MSG_SENT 1
0137 #define SS_NOT_CMD 2
0138 #define SS_PHASE_CHG 3
0139 #define SS_DONE 4
0140
0141
0142
0143
0144 #define SYNCP_MASK 0x1f
0145 #define SYNCP_MIN 4
0146 #define SYNCP_MAX 31
0147
0148
0149
0150
0151 #define FLAGS_FIFO_LEV 0x1f
0152 #define FLAGS_SEQ_STEP 0xe0
0153
0154
0155
0156
0157 #define SYNCO_MASK 0x0f
0158 #define SYNCO_ASS_CTRL 0x30
0159 #define SYNCO_NEG_CTRL 0xc0
0160
0161
0162
0163
0164 #define CF1_SLOW_CABLE 0x80
0165 #define CF1_NO_RES_REP 0x40
0166 #define CF1_PAR_TEST 0x20
0167 #define CF1_PAR_ENABLE 0x10
0168 #define CF1_TEST 0x08
0169 #define CF1_MY_ID 0x07
0170
0171
0172
0173
0174 #define CLKF_MASK 7
0175 #define CLKF_VAL(freq) ((((freq) + 4999999) / 5000000) & CLKF_MASK)
0176
0177
0178
0179
0180 #define TEST_TARGET 1
0181 #define TEST_INITIATOR 2
0182 #define TEST_TRISTATE 4
0183
0184
0185
0186
0187 #define CF2_RFB 0x80
0188 #define CF2_FEATURE_EN 0x40
0189 #define CF2_BYTECTRL 0x20
0190 #define CF2_DREQ_HIZ 0x10
0191 #define CF2_SCSI2 0x08
0192 #define CF2_PAR_ABORT 0x04
0193 #define CF2_REG_PARERR 0x02
0194 #define CF2_DMA_PARERR 0x01
0195
0196
0197
0198
0199 #define CF3_ID_MSG_CHK 0x80
0200 #define CF3_3B_MSGS 0x40
0201 #define CF3_CDB10 0x20
0202 #define CF3_FASTSCSI 0x10
0203 #define CF3_FASTCLOCK 0x08
0204 #define CF3_SAVERESID 0x04
0205 #define CF3_ALT_DMA 0x02
0206 #define CF3_THRESH_8 0x01
0207
0208
0209
0210
0211 #define CF4_EAN 0x04
0212 #define CF4_TEST 0x02
0213 #define CF4_BBTE 0x01
0214
0215 struct mac53c94_cmd_priv {
0216 int this_residual;
0217 int status;
0218 int message;
0219 };
0220
0221 static inline struct mac53c94_cmd_priv *mac53c94_priv(struct scsi_cmnd *cmd)
0222 {
0223 return scsi_cmd_priv(cmd);
0224 }
0225
0226 #endif