Import 2.3.18pre1
[davej-history.git] / drivers / scsi / atari_scsi.h
blob15280b82cc9504642e30822f98f727ea53bd4295
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 intatari_scsi_abort(Scsi_Cmnd *);
22 intatari_scsi_detect(Scsi_Host_Template *);
23 const char*atari_scsi_info(struct Scsi_Host *);
24 intatari_scsi_queue_command(Scsi_Cmnd *,void(*done) (Scsi_Cmnd *));
25 intatari_scsi_reset(Scsi_Cmnd *,unsigned int);
26 intatari_scsi_proc_info(char*,char**, off_t,int,int,int);
27 #ifdef MODULE
28 intatari_scsi_release(struct Scsi_Host *);
29 #else
30 #define atari_scsi_release NULL
31 #endif
33 /* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
34 * values should work, too; try it! (but cmd_per_lun costs memory!) */
36 /* But there seems to be a bug somewhere that requires CAN_QUEUE to be
37 * 2*CMD_PER_LUN. At least on a TT, no spurious timeouts seen since
38 * changed CMD_PER_LUN... */
40 /* Note: The Falcon currently uses 8/1 setting due to unsolved problems with
41 * cmd_per_lun != 1 */
43 #define ATARI_TT_CAN_QUEUE 16
44 #define ATARI_TT_CMD_PER_LUN 8
45 #define ATARI_TT_SG_TABLESIZE SG_ALL
47 #define ATARI_FALCON_CAN_QUEUE 8
48 #define ATARI_FALCON_CMD_PER_LUN 1
49 #define ATARI_FALCON_SG_TABLESIZE SG_NONE
51 #define DEFAULT_USE_TAGGED_QUEUING 0
54 #if defined (HOSTS_C) || defined (MODULE)
56 #define ATARI_SCSI { proc_info: atari_scsi_proc_info, \
57 name:"Atari native SCSI", \
58 detect: atari_scsi_detect, \
59 release: atari_scsi_release, \
60 info: atari_scsi_info, \
61 queuecommand: atari_scsi_queue_command, \
62 abort: atari_scsi_abort, \
63 reset: atari_scsi_reset, \
64 can_queue: 0,/* initialized at run-time */ \
65 this_id: 0,/* initialized at run-time */ \
66 sg_tablesize: 0,/* initialized at run-time */ \
67 cmd_per_lun: 0,/* initialized at run-time */ \
68 use_clustering: DISABLE_CLUSTERING }
70 #endif
72 #ifndef HOSTS_C
74 #define NCR5380_implementation_fields/* none */
76 #define NCR5380_read(reg) atari_scsi_reg_read( reg )
77 #define NCR5380_write(reg, value) atari_scsi_reg_write( reg, value )
79 #define NCR5380_intr atari_scsi_intr
80 #define NCR5380_queue_command atari_scsi_queue_command
81 #define NCR5380_abort atari_scsi_abort
82 #define NCR5380_proc_info atari_scsi_proc_info
83 #define NCR5380_dma_read_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 0)
84 #define NCR5380_dma_write_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 1)
85 #define NCR5380_dma_residual(inst) atari_scsi_dma_residual( inst )
86 #define NCR5380_dma_xfer_len(i,cmd,phase) \
87 atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
89 /* Debugging printk definitions:
91 * ARB -> arbitration
92 * ASEN -> auto-sense
93 * DMA -> DMA
94 * HSH -> PIO handshake
95 * INF -> information transfer
96 * INI -> initialization
97 * INT -> interrupt
98 * LNK -> linked commands
99 * MAIN -> NCR5380_main() control flow
100 * NDAT -> no data-out phase
101 * NWR -> no write commands
102 * PIO -> PIO transfers
103 * PDMA -> pseudo DMA (unused on Atari)
104 * QU -> queues
105 * RSL -> reselections
106 * SEL -> selections
107 * USL -> usleep cpde (unused on Atari)
108 * LBS -> last byte sent (unused on Atari)
109 * RSS -> restarting of selections
110 * EXT -> extended messages
111 * ABRT -> aborting and resetting
112 * TAG -> queue tag handling
113 * MER -> merging of consec. buffers
117 #if NDEBUG & NDEBUG_ARBITRATION
118 #define ARB_PRINTK(format, args...) \
119 printk(KERN_DEBUG format , ## args)
120 #else
121 #define ARB_PRINTK(format, args...)
122 #endif
123 #if NDEBUG & NDEBUG_AUTOSENSE
124 #define ASEN_PRINTK(format, args...) \
125 printk(KERN_DEBUG format , ## args)
126 #else
127 #define ASEN_PRINTK(format, args...)
128 #endif
129 #if NDEBUG & NDEBUG_DMA
130 #define DMA_PRINTK(format, args...) \
131 printk(KERN_DEBUG format , ## args)
132 #else
133 #define DMA_PRINTK(format, args...)
134 #endif
135 #if NDEBUG & NDEBUG_HANDSHAKE
136 #define HSH_PRINTK(format, args...) \
137 printk(KERN_DEBUG format , ## args)
138 #else
139 #define HSH_PRINTK(format, args...)
140 #endif
141 #if NDEBUG & NDEBUG_INFORMATION
142 #define INF_PRINTK(format, args...) \
143 printk(KERN_DEBUG format , ## args)
144 #else
145 #define INF_PRINTK(format, args...)
146 #endif
147 #if NDEBUG & NDEBUG_INIT
148 #define INI_PRINTK(format, args...) \
149 printk(KERN_DEBUG format , ## args)
150 #else
151 #define INI_PRINTK(format, args...)
152 #endif
153 #if NDEBUG & NDEBUG_INTR
154 #define INT_PRINTK(format, args...) \
155 printk(KERN_DEBUG format , ## args)
156 #else
157 #define INT_PRINTK(format, args...)
158 #endif
159 #if NDEBUG & NDEBUG_LINKED
160 #define LNK_PRINTK(format, args...) \
161 printk(KERN_DEBUG format , ## args)
162 #else
163 #define LNK_PRINTK(format, args...)
164 #endif
165 #if NDEBUG & NDEBUG_MAIN
166 #define MAIN_PRINTK(format, args...) \
167 printk(KERN_DEBUG format , ## args)
168 #else
169 #define MAIN_PRINTK(format, args...)
170 #endif
171 #if NDEBUG & NDEBUG_NO_DATAOUT
172 #define NDAT_PRINTK(format, args...) \
173 printk(KERN_DEBUG format , ## args)
174 #else
175 #define NDAT_PRINTK(format, args...)
176 #endif
177 #if NDEBUG & NDEBUG_NO_WRITE
178 #define NWR_PRINTK(format, args...) \
179 printk(KERN_DEBUG format , ## args)
180 #else
181 #define NWR_PRINTK(format, args...)
182 #endif
183 #if NDEBUG & NDEBUG_PIO
184 #define PIO_PRINTK(format, args...) \
185 printk(KERN_DEBUG format , ## args)
186 #else
187 #define PIO_PRINTK(format, args...)
188 #endif
189 #if NDEBUG & NDEBUG_PSEUDO_DMA
190 #define PDMA_PRINTK(format, args...) \
191 printk(KERN_DEBUG format , ## args)
192 #else
193 #define PDMA_PRINTK(format, args...)
194 #endif
195 #if NDEBUG & NDEBUG_QUEUES
196 #define QU_PRINTK(format, args...) \
197 printk(KERN_DEBUG format , ## args)
198 #else
199 #define QU_PRINTK(format, args...)
200 #endif
201 #if NDEBUG & NDEBUG_RESELECTION
202 #define RSL_PRINTK(format, args...) \
203 printk(KERN_DEBUG format , ## args)
204 #else
205 #define RSL_PRINTK(format, args...)
206 #endif
207 #if NDEBUG & NDEBUG_SELECTION
208 #define SEL_PRINTK(format, args...) \
209 printk(KERN_DEBUG format , ## args)
210 #else
211 #define SEL_PRINTK(format, args...)
212 #endif
213 #if NDEBUG & NDEBUG_USLEEP
214 #define USL_PRINTK(format, args...) \
215 printk(KERN_DEBUG format , ## args)
216 #else
217 #define USL_PRINTK(format, args...)
218 #endif
219 #if NDEBUG & NDEBUG_LAST_BYTE_SENT
220 #define LBS_PRINTK(format, args...) \
221 printk(KERN_DEBUG format , ## args)
222 #else
223 #define LBS_PRINTK(format, args...)
224 #endif
225 #if NDEBUG & NDEBUG_RESTART_SELECT
226 #define RSS_PRINTK(format, args...) \
227 printk(KERN_DEBUG format , ## args)
228 #else
229 #define RSS_PRINTK(format, args...)
230 #endif
231 #if NDEBUG & NDEBUG_EXTENDED
232 #define EXT_PRINTK(format, args...) \
233 printk(KERN_DEBUG format , ## args)
234 #else
235 #define EXT_PRINTK(format, args...)
236 #endif
237 #if NDEBUG & NDEBUG_ABORT
238 #define ABRT_PRINTK(format, args...) \
239 printk(KERN_DEBUG format , ## args)
240 #else
241 #define ABRT_PRINTK(format, args...)
242 #endif
243 #if NDEBUG & NDEBUG_TAGS
244 #define TAG_PRINTK(format, args...) \
245 printk(KERN_DEBUG format , ## args)
246 #else
247 #define TAG_PRINTK(format, args...)
248 #endif
249 #if NDEBUG & NDEBUG_MERGING
250 #define MER_PRINTK(format, args...) \
251 printk(KERN_DEBUG format , ## args)
252 #else
253 #define MER_PRINTK(format, args...)
254 #endif
256 /* conditional macros for NCR5380_print_{,phase,status} */
258 #define NCR_PRINT(mask) \
259 ((NDEBUG & (mask)) ? NCR5380_print(instance) : (void)0)
261 #define NCR_PRINT_PHASE(mask) \
262 ((NDEBUG & (mask)) ? NCR5380_print_phase(instance) : (void)0)
264 #define NCR_PRINT_STATUS(mask) \
265 ((NDEBUG & (mask)) ? NCR5380_print_status(instance) : (void)0)
267 #define NDEBUG_ANY 0xffffffff
270 #endif/* else def HOSTS_C */
271 #endif/* ndef ASM */
272 #endif/* ATARI_SCSI_H */
close