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
18 /* (I_HAVE_OVERRUNS stuff removed) */
21 int atari_scsi_abort (Scsi_Cmnd *);
22 int atari_scsi_detect (Scsi_Host_Template *);
23 const char *atari_scsi_info (struct Scsi_Host *);
24 int atari_scsi_queue_command (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
25 int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
26 int atari_scsi_proc_info (char *, char **, off_t, int, int, int);
28 int atari_scsi_release (struct Scsi_Host *);
30 #define atari_scsi_release NULL
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
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 #define ATARI_SCSI { proc_info: atari_scsi_proc_info, \
55 name: "Atari native SCSI", \
56 detect: atari_scsi_detect, \
57 release: atari_scsi_release, \
58 info: atari_scsi_info, \
59 queuecommand: atari_scsi_queue_command, \
60 abort: atari_scsi_abort, \
61 reset: atari_scsi_reset, \
62 can_queue: 0, /* initialized at run-time */ \
63 this_id: 0, /* initialized at run-time */ \
64 sg_tablesize: 0, /* initialized at run-time */ \
65 cmd_per_lun: 0, /* initialized at run-time */ \
66 use_clustering: DISABLE_CLUSTERING }
68 #define NCR5380_implementation_fields /* none */
70 #define NCR5380_read(reg) atari_scsi_reg_read( reg )
71 #define NCR5380_write(reg, value) atari_scsi_reg_write( reg, value )
73 #define NCR5380_intr atari_scsi_intr
74 #define NCR5380_queue_command atari_scsi_queue_command
75 #define NCR5380_abort atari_scsi_abort
76 #define NCR5380_proc_info atari_scsi_proc_info
77 #define NCR5380_dma_read_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 0)
78 #define NCR5380_dma_write_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 1)
79 #define NCR5380_dma_residual(inst) atari_scsi_dma_residual( inst )
80 #define NCR5380_dma_xfer_len(i,cmd,phase) \
81 atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
83 /* Debugging printk definitions:
88 * HSH -> PIO handshake
89 * INF -> information transfer
90 * INI -> initialization
92 * LNK -> linked commands
93 * MAIN -> NCR5380_main() control flow
94 * NDAT -> no data-out phase
95 * NWR -> no write commands
96 * PIO -> PIO transfers
97 * PDMA -> pseudo DMA (unused on Atari)
101 * USL -> usleep cpde (unused on Atari)
102 * LBS -> last byte sent (unused on Atari)
103 * RSS -> restarting of selections
104 * EXT -> extended messages
105 * ABRT -> aborting and resetting
106 * TAG -> queue tag handling
107 * MER -> merging of consec. buffers
111 #if NDEBUG & NDEBUG_ARBITRATION
112 #define ARB_PRINTK(format, args...) \
113 printk(KERN_DEBUG format , ## args)
115 #define ARB_PRINTK(format, args...)
117 #if NDEBUG & NDEBUG_AUTOSENSE
118 #define ASEN_PRINTK(format, args...) \
119 printk(KERN_DEBUG format , ## args)
121 #define ASEN_PRINTK(format, args...)
123 #if NDEBUG & NDEBUG_DMA
124 #define DMA_PRINTK(format, args...) \
125 printk(KERN_DEBUG format , ## args)
127 #define DMA_PRINTK(format, args...)
129 #if NDEBUG & NDEBUG_HANDSHAKE
130 #define HSH_PRINTK(format, args...) \
131 printk(KERN_DEBUG format , ## args)
133 #define HSH_PRINTK(format, args...)
135 #if NDEBUG & NDEBUG_INFORMATION
136 #define INF_PRINTK(format, args...) \
137 printk(KERN_DEBUG format , ## args)
139 #define INF_PRINTK(format, args...)
141 #if NDEBUG & NDEBUG_INIT
142 #define INI_PRINTK(format, args...) \
143 printk(KERN_DEBUG format , ## args)
145 #define INI_PRINTK(format, args...)
147 #if NDEBUG & NDEBUG_INTR
148 #define INT_PRINTK(format, args...) \
149 printk(KERN_DEBUG format , ## args)
151 #define INT_PRINTK(format, args...)
153 #if NDEBUG & NDEBUG_LINKED
154 #define LNK_PRINTK(format, args...) \
155 printk(KERN_DEBUG format , ## args)
157 #define LNK_PRINTK(format, args...)
159 #if NDEBUG & NDEBUG_MAIN
160 #define MAIN_PRINTK(format, args...) \
161 printk(KERN_DEBUG format , ## args)
163 #define MAIN_PRINTK(format, args...)
165 #if NDEBUG & NDEBUG_NO_DATAOUT
166 #define NDAT_PRINTK(format, args...) \
167 printk(KERN_DEBUG format , ## args)
169 #define NDAT_PRINTK(format, args...)
171 #if NDEBUG & NDEBUG_NO_WRITE
172 #define NWR_PRINTK(format, args...) \
173 printk(KERN_DEBUG format , ## args)
175 #define NWR_PRINTK(format, args...)
177 #if NDEBUG & NDEBUG_PIO
178 #define PIO_PRINTK(format, args...) \
179 printk(KERN_DEBUG format , ## args)
181 #define PIO_PRINTK(format, args...)
183 #if NDEBUG & NDEBUG_PSEUDO_DMA
184 #define PDMA_PRINTK(format, args...) \
185 printk(KERN_DEBUG format , ## args)
187 #define PDMA_PRINTK(format, args...)
189 #if NDEBUG & NDEBUG_QUEUES
190 #define QU_PRINTK(format, args...) \
191 printk(KERN_DEBUG format , ## args)
193 #define QU_PRINTK(format, args...)
195 #if NDEBUG & NDEBUG_RESELECTION
196 #define RSL_PRINTK(format, args...) \
197 printk(KERN_DEBUG format , ## args)
199 #define RSL_PRINTK(format, args...)
201 #if NDEBUG & NDEBUG_SELECTION
202 #define SEL_PRINTK(format, args...) \
203 printk(KERN_DEBUG format , ## args)
205 #define SEL_PRINTK(format, args...)
207 #if NDEBUG & NDEBUG_USLEEP
208 #define USL_PRINTK(format, args...) \
209 printk(KERN_DEBUG format , ## args)
211 #define USL_PRINTK(format, args...)
213 #if NDEBUG & NDEBUG_LAST_BYTE_SENT
214 #define LBS_PRINTK(format, args...) \
215 printk(KERN_DEBUG format , ## args)
217 #define LBS_PRINTK(format, args...)
219 #if NDEBUG & NDEBUG_RESTART_SELECT
220 #define RSS_PRINTK(format, args...) \
221 printk(KERN_DEBUG format , ## args)
223 #define RSS_PRINTK(format, args...)
225 #if NDEBUG & NDEBUG_EXTENDED
226 #define EXT_PRINTK(format, args...) \
227 printk(KERN_DEBUG format , ## args)
229 #define EXT_PRINTK(format, args...)
231 #if NDEBUG & NDEBUG_ABORT
232 #define ABRT_PRINTK(format, args...) \
233 printk(KERN_DEBUG format , ## args)
235 #define ABRT_PRINTK(format, args...)
237 #if NDEBUG & NDEBUG_TAGS
238 #define TAG_PRINTK(format, args...) \
239 printk(KERN_DEBUG format , ## args)
241 #define TAG_PRINTK(format, args...)
243 #if NDEBUG & NDEBUG_MERGING
244 #define MER_PRINTK(format, args...) \
245 printk(KERN_DEBUG format , ## args)
247 #define MER_PRINTK(format, args...)
250 /* conditional macros for NCR5380_print_{,phase,status} */
252 #define NCR_PRINT(mask) \
253 ((NDEBUG & (mask)) ? NCR5380_print(instance) : (void)0)
255 #define NCR_PRINT_PHASE(mask) \
256 ((NDEBUG & (mask)) ? NCR5380_print_phase(instance) : (void)0)
258 #define NCR_PRINT_STATUS(mask) \
259 ((NDEBUG & (mask)) ? NCR5380_print_status(instance) : (void)0)
261 #define NDEBUG_ANY 0xffffffff
264 #endif /* ndef ASM */
265 #endif /* ATARI_SCSI_H */