1 /* 2 * atari_scsi.h -- Header file for the Atari native SCSI driver 3 * 4 * Copyright 1994 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> 5 * 6 * (Loosely based on the work of Robert De Vries' team) 7 * 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. 11 * 12 */ 13 14 15 #ifndef ATARI_SCSI_H 16 #define ATARI_SCSI_H 17 18 /* (I_HAVE_OVERRUNS stuff removed) */ 19 20 #ifndef ASM 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); 27 #ifdef MODULE 28 int atari_scsi_release (struct Scsi_Host *); 29 #else 30 #define atari_scsi_release NULL 31 #endif 32 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!) */ 35 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... */ 39 40 /* Note: The Falcon currently uses 8/1 setting due to unsolved problems with 41 * cmd_per_lun != 1 */ 42 43 #define ATARI_TT_CAN_QUEUE 16 44 #define ATARI_TT_CMD_PER_LUN 8 45 #define ATARI_TT_SG_TABLESIZE SG_ALL 46 47 #define ATARI_FALCON_CAN_QUEUE 8 48 #define ATARI_FALCON_CMD_PER_LUN 1 49 #define ATARI_FALCON_SG_TABLESIZE SG_NONE 50 51 #define DEFAULT_USE_TAGGED_QUEUING 0 52 53 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 } 67 68 #define NCR5380_implementation_fields /* none */ 69 70 #define NCR5380_read(reg) atari_scsi_reg_read( reg ) 71 #define NCR5380_write(reg, value) atari_scsi_reg_write( reg, value ) 72 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) 82 83 /* Debugging printk definitions: 84 * 85 * ARB -> arbitration 86 * ASEN -> auto-sense 87 * DMA -> DMA 88 * HSH -> PIO handshake 89 * INF -> information transfer 90 * INI -> initialization 91 * INT -> interrupt 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) 98 * QU -> queues 99 * RSL -> reselections 100 * SEL -> selections 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 108 * 109 */ 110 111 #if NDEBUG & NDEBUG_ARBITRATION 112 #define ARB_PRINTK(format, args...) \ 113 printk(KERN_DEBUG format , ## args) 114 #else 115 #define ARB_PRINTK(format, args...) 116 #endif 117 #if NDEBUG & NDEBUG_AUTOSENSE 118 #define ASEN_PRINTK(format, args...) \ 119 printk(KERN_DEBUG format , ## args) 120 #else 121 #define ASEN_PRINTK(format, args...) 122 #endif 123 #if NDEBUG & NDEBUG_DMA 124 #define DMA_PRINTK(format, args...) \ 125 printk(KERN_DEBUG format , ## args) 126 #else 127 #define DMA_PRINTK(format, args...) 128 #endif 129 #if NDEBUG & NDEBUG_HANDSHAKE 130 #define HSH_PRINTK(format, args...) \ 131 printk(KERN_DEBUG format , ## args) 132 #else 133 #define HSH_PRINTK(format, args...) 134 #endif 135 #if NDEBUG & NDEBUG_INFORMATION 136 #define INF_PRINTK(format, args...) \ 137 printk(KERN_DEBUG format , ## args) 138 #else 139 #define INF_PRINTK(format, args...) 140 #endif 141 #if NDEBUG & NDEBUG_INIT 142 #define INI_PRINTK(format, args...) \ 143 printk(KERN_DEBUG format , ## args) 144 #else 145 #define INI_PRINTK(format, args...) 146 #endif 147 #if NDEBUG & NDEBUG_INTR 148 #define INT_PRINTK(format, args...) \ 149 printk(KERN_DEBUG format , ## args) 150 #else 151 #define INT_PRINTK(format, args...) 152 #endif 153 #if NDEBUG & NDEBUG_LINKED 154 #define LNK_PRINTK(format, args...) \ 155 printk(KERN_DEBUG format , ## args) 156 #else 157 #define LNK_PRINTK(format, args...) 158 #endif 159 #if NDEBUG & NDEBUG_MAIN 160 #define MAIN_PRINTK(format, args...) \ 161 printk(KERN_DEBUG format , ## args) 162 #else 163 #define MAIN_PRINTK(format, args...) 164 #endif 165 #if NDEBUG & NDEBUG_NO_DATAOUT 166 #define NDAT_PRINTK(format, args...) \ 167 printk(KERN_DEBUG format , ## args) 168 #else 169 #define NDAT_PRINTK(format, args...) 170 #endif 171 #if NDEBUG & NDEBUG_NO_WRITE 172 #define NWR_PRINTK(format, args...) \ 173 printk(KERN_DEBUG format , ## args) 174 #else 175 #define NWR_PRINTK(format, args...) 176 #endif 177 #if NDEBUG & NDEBUG_PIO 178 #define PIO_PRINTK(format, args...) \ 179 printk(KERN_DEBUG format , ## args) 180 #else 181 #define PIO_PRINTK(format, args...) 182 #endif 183 #if NDEBUG & NDEBUG_PSEUDO_DMA 184 #define PDMA_PRINTK(format, args...) \ 185 printk(KERN_DEBUG format , ## args) 186 #else 187 #define PDMA_PRINTK(format, args...) 188 #endif 189 #if NDEBUG & NDEBUG_QUEUES 190 #define QU_PRINTK(format, args...) \ 191 printk(KERN_DEBUG format , ## args) 192 #else 193 #define QU_PRINTK(format, args...) 194 #endif 195 #if NDEBUG & NDEBUG_RESELECTION 196 #define RSL_PRINTK(format, args...) \ 197 printk(KERN_DEBUG format , ## args) 198 #else 199 #define RSL_PRINTK(format, args...) 200 #endif 201 #if NDEBUG & NDEBUG_SELECTION 202 #define SEL_PRINTK(format, args...) \ 203 printk(KERN_DEBUG format , ## args) 204 #else 205 #define SEL_PRINTK(format, args...) 206 #endif 207 #if NDEBUG & NDEBUG_USLEEP 208 #define USL_PRINTK(format, args...) \ 209 printk(KERN_DEBUG format , ## args) 210 #else 211 #define USL_PRINTK(format, args...) 212 #endif 213 #if NDEBUG & NDEBUG_LAST_BYTE_SENT 214 #define LBS_PRINTK(format, args...) \ 215 printk(KERN_DEBUG format , ## args) 216 #else 217 #define LBS_PRINTK(format, args...) 218 #endif 219 #if NDEBUG & NDEBUG_RESTART_SELECT 220 #define RSS_PRINTK(format, args...) \ 221 printk(KERN_DEBUG format , ## args) 222 #else 223 #define RSS_PRINTK(format, args...) 224 #endif 225 #if NDEBUG & NDEBUG_EXTENDED 226 #define EXT_PRINTK(format, args...) \ 227 printk(KERN_DEBUG format , ## args) 228 #else 229 #define EXT_PRINTK(format, args...) 230 #endif 231 #if NDEBUG & NDEBUG_ABORT 232 #define ABRT_PRINTK(format, args...) \ 233 printk(KERN_DEBUG format , ## args) 234 #else 235 #define ABRT_PRINTK(format, args...) 236 #endif 237 #if NDEBUG & NDEBUG_TAGS 238 #define TAG_PRINTK(format, args...) \ 239 printk(KERN_DEBUG format , ## args) 240 #else 241 #define TAG_PRINTK(format, args...) 242 #endif 243 #if NDEBUG & NDEBUG_MERGING 244 #define MER_PRINTK(format, args...) \ 245 printk(KERN_DEBUG format , ## args) 246 #else 247 #define MER_PRINTK(format, args...) 248 #endif 249 250 /* conditional macros for NCR5380_print_{,phase,status} */ 251 252 #define NCR_PRINT(mask) \ 253 ((NDEBUG & (mask)) ? NCR5380_print(instance) : (void)0) 254 255 #define NCR_PRINT_PHASE(mask) \ 256 ((NDEBUG & (mask)) ? NCR5380_print_phase(instance) : (void)0) 257 258 #define NCR_PRINT_STATUS(mask) \ 259 ((NDEBUG & (mask)) ? NCR5380_print_status(instance) : (void)0) 260 261 #define NDEBUG_ANY 0xffffffff 262 263 264 #endif /* ndef ASM */ 265 #endif /* ATARI_SCSI_H */ 266 267 268