[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / drivers / scsi / atari_scsi.h
blobcc1256988841dc2c6e55bc860f6b4c88be36c489
1 /*
2 * atari_scsi.h -- Header file for the Atari native SCSI driver
4 * Copyright 1994 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
6 * (Loosely based on the work of Robert De Vries' team)
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
10 * for more details.
15 #ifndef ATARI_SCSI_H
16 #define ATARI_SCSI_H
18 /* (I_HAVE_OVERRUNS stuff removed) */
20 #ifndef ASM
21 int atari_scsi_detect (Scsi_Host_Template *);
22 const char *atari_scsi_info (struct Scsi_Host *);
23 int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
24 #ifdef MODULE
25 int atari_scsi_release (struct Scsi_Host *);
26 #else
27 #define atari_scsi_release NULL
28 #endif
30 /* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
31 * values should work, too; try it! (but cmd_per_lun costs memory!) */
33 /* But there seems to be a bug somewhere that requires CAN_QUEUE to be
34 * 2*CMD_PER_LUN. At least on a TT, no spurious timeouts seen since
35 * changed CMD_PER_LUN... */
37 /* Note: The Falcon currently uses 8/1 setting due to unsolved problems with
38 * cmd_per_lun != 1 */
40 #define ATARI_TT_CAN_QUEUE 16
41 #define ATARI_TT_CMD_PER_LUN 8
42 #define ATARI_TT_SG_TABLESIZE SG_ALL
44 #define ATARI_FALCON_CAN_QUEUE 8
45 #define ATARI_FALCON_CMD_PER_LUN 1
46 #define ATARI_FALCON_SG_TABLESIZE SG_NONE
48 #define DEFAULT_USE_TAGGED_QUEUING 0
51 #define NCR5380_implementation_fields /* none */
53 #define NCR5380_read(reg) atari_scsi_reg_read( reg )
54 #define NCR5380_write(reg, value) atari_scsi_reg_write( reg, value )
56 #define NCR5380_intr atari_scsi_intr
57 #define NCR5380_queue_command atari_scsi_queue_command
58 #define NCR5380_abort atari_scsi_abort
59 #define NCR5380_proc_info atari_scsi_proc_info
60 #define NCR5380_dma_read_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 0)
61 #define NCR5380_dma_write_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 1)
62 #define NCR5380_dma_residual(inst) atari_scsi_dma_residual( inst )
63 #define NCR5380_dma_xfer_len(i,cmd,phase) \
64 atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
66 /* Debugging printk definitions:
68 * ARB -> arbitration
69 * ASEN -> auto-sense
70 * DMA -> DMA
71 * HSH -> PIO handshake
72 * INF -> information transfer
73 * INI -> initialization
74 * INT -> interrupt
75 * LNK -> linked commands
76 * MAIN -> NCR5380_main() control flow
77 * NDAT -> no data-out phase
78 * NWR -> no write commands
79 * PIO -> PIO transfers
80 * PDMA -> pseudo DMA (unused on Atari)
81 * QU -> queues
82 * RSL -> reselections
83 * SEL -> selections
84 * USL -> usleep cpde (unused on Atari)
85 * LBS -> last byte sent (unused on Atari)
86 * RSS -> restarting of selections
87 * EXT -> extended messages
88 * ABRT -> aborting and resetting
89 * TAG -> queue tag handling
90 * MER -> merging of consec. buffers
94 #if NDEBUG & NDEBUG_ARBITRATION
95 #define ARB_PRINTK(format, args...) \
96 printk(KERN_DEBUG format , ## args)
97 #else
98 #define ARB_PRINTK(format, args...)
99 #endif
100 #if NDEBUG & NDEBUG_AUTOSENSE
101 #define ASEN_PRINTK(format, args...) \
102 printk(KERN_DEBUG format , ## args)
103 #else
104 #define ASEN_PRINTK(format, args...)
105 #endif
106 #if NDEBUG & NDEBUG_DMA
107 #define DMA_PRINTK(format, args...) \
108 printk(KERN_DEBUG format , ## args)
109 #else
110 #define DMA_PRINTK(format, args...)
111 #endif
112 #if NDEBUG & NDEBUG_HANDSHAKE
113 #define HSH_PRINTK(format, args...) \
114 printk(KERN_DEBUG format , ## args)
115 #else
116 #define HSH_PRINTK(format, args...)
117 #endif
118 #if NDEBUG & NDEBUG_INFORMATION
119 #define INF_PRINTK(format, args...) \
120 printk(KERN_DEBUG format , ## args)
121 #else
122 #define INF_PRINTK(format, args...)
123 #endif
124 #if NDEBUG & NDEBUG_INIT
125 #define INI_PRINTK(format, args...) \
126 printk(KERN_DEBUG format , ## args)
127 #else
128 #define INI_PRINTK(format, args...)
129 #endif
130 #if NDEBUG & NDEBUG_INTR
131 #define INT_PRINTK(format, args...) \
132 printk(KERN_DEBUG format , ## args)
133 #else
134 #define INT_PRINTK(format, args...)
135 #endif
136 #if NDEBUG & NDEBUG_LINKED
137 #define LNK_PRINTK(format, args...) \
138 printk(KERN_DEBUG format , ## args)
139 #else
140 #define LNK_PRINTK(format, args...)
141 #endif
142 #if NDEBUG & NDEBUG_MAIN
143 #define MAIN_PRINTK(format, args...) \
144 printk(KERN_DEBUG format , ## args)
145 #else
146 #define MAIN_PRINTK(format, args...)
147 #endif
148 #if NDEBUG & NDEBUG_NO_DATAOUT
149 #define NDAT_PRINTK(format, args...) \
150 printk(KERN_DEBUG format , ## args)
151 #else
152 #define NDAT_PRINTK(format, args...)
153 #endif
154 #if NDEBUG & NDEBUG_NO_WRITE
155 #define NWR_PRINTK(format, args...) \
156 printk(KERN_DEBUG format , ## args)
157 #else
158 #define NWR_PRINTK(format, args...)
159 #endif
160 #if NDEBUG & NDEBUG_PIO
161 #define PIO_PRINTK(format, args...) \
162 printk(KERN_DEBUG format , ## args)
163 #else
164 #define PIO_PRINTK(format, args...)
165 #endif
166 #if NDEBUG & NDEBUG_PSEUDO_DMA
167 #define PDMA_PRINTK(format, args...) \
168 printk(KERN_DEBUG format , ## args)
169 #else
170 #define PDMA_PRINTK(format, args...)
171 #endif
172 #if NDEBUG & NDEBUG_QUEUES
173 #define QU_PRINTK(format, args...) \
174 printk(KERN_DEBUG format , ## args)
175 #else
176 #define QU_PRINTK(format, args...)
177 #endif
178 #if NDEBUG & NDEBUG_RESELECTION
179 #define RSL_PRINTK(format, args...) \
180 printk(KERN_DEBUG format , ## args)
181 #else
182 #define RSL_PRINTK(format, args...)
183 #endif
184 #if NDEBUG & NDEBUG_SELECTION
185 #define SEL_PRINTK(format, args...) \
186 printk(KERN_DEBUG format , ## args)
187 #else
188 #define SEL_PRINTK(format, args...)
189 #endif
190 #if NDEBUG & NDEBUG_USLEEP
191 #define USL_PRINTK(format, args...) \
192 printk(KERN_DEBUG format , ## args)
193 #else
194 #define USL_PRINTK(format, args...)
195 #endif
196 #if NDEBUG & NDEBUG_LAST_BYTE_SENT
197 #define LBS_PRINTK(format, args...) \
198 printk(KERN_DEBUG format , ## args)
199 #else
200 #define LBS_PRINTK(format, args...)
201 #endif
202 #if NDEBUG & NDEBUG_RESTART_SELECT
203 #define RSS_PRINTK(format, args...) \
204 printk(KERN_DEBUG format , ## args)
205 #else
206 #define RSS_PRINTK(format, args...)
207 #endif
208 #if NDEBUG & NDEBUG_EXTENDED
209 #define EXT_PRINTK(format, args...) \
210 printk(KERN_DEBUG format , ## args)
211 #else
212 #define EXT_PRINTK(format, args...)
213 #endif
214 #if NDEBUG & NDEBUG_ABORT
215 #define ABRT_PRINTK(format, args...) \
216 printk(KERN_DEBUG format , ## args)
217 #else
218 #define ABRT_PRINTK(format, args...)
219 #endif
220 #if NDEBUG & NDEBUG_TAGS
221 #define TAG_PRINTK(format, args...) \
222 printk(KERN_DEBUG format , ## args)
223 #else
224 #define TAG_PRINTK(format, args...)
225 #endif
226 #if NDEBUG & NDEBUG_MERGING
227 #define MER_PRINTK(format, args...) \
228 printk(KERN_DEBUG format , ## args)
229 #else
230 #define MER_PRINTK(format, args...)
231 #endif
233 /* conditional macros for NCR5380_print_{,phase,status} */
235 #define NCR_PRINT(mask) \
236 ((NDEBUG & (mask)) ? NCR5380_print(instance) : (void)0)
238 #define NCR_PRINT_PHASE(mask) \
239 ((NDEBUG & (mask)) ? NCR5380_print_phase(instance) : (void)0)
241 #define NCR_PRINT_STATUS(mask) \
242 ((NDEBUG & (mask)) ? NCR5380_print_status(instance) : (void)0)
245 #endif /* ndef ASM */
246 #endif /* ATARI_SCSI_H */