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 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); 28 intatari_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 #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 } 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: 94 * HSH -> PIO handshake 95 * INF -> information transfer 96 * INI -> initialization 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) 105 * RSL -> reselections 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) 121 #define ARB_PRINTK(format, args...) 123 #if NDEBUG & NDEBUG_AUTOSENSE 124 #define ASEN_PRINTK(format, args...) \ 125 printk(KERN_DEBUG format , ## args) 127 #define ASEN_PRINTK(format, args...) 129 #if NDEBUG & NDEBUG_DMA 130 #define DMA_PRINTK(format, args...) \ 131 printk(KERN_DEBUG format , ## args) 133 #define DMA_PRINTK(format, args...) 135 #if NDEBUG & NDEBUG_HANDSHAKE 136 #define HSH_PRINTK(format, args...) \ 137 printk(KERN_DEBUG format , ## args) 139 #define HSH_PRINTK(format, args...) 141 #if NDEBUG & NDEBUG_INFORMATION 142 #define INF_PRINTK(format, args...) \ 143 printk(KERN_DEBUG format , ## args) 145 #define INF_PRINTK(format, args...) 147 #if NDEBUG & NDEBUG_INIT 148 #define INI_PRINTK(format, args...) \ 149 printk(KERN_DEBUG format , ## args) 151 #define INI_PRINTK(format, args...) 153 #if NDEBUG & NDEBUG_INTR 154 #define INT_PRINTK(format, args...) \ 155 printk(KERN_DEBUG format , ## args) 157 #define INT_PRINTK(format, args...) 159 #if NDEBUG & NDEBUG_LINKED 160 #define LNK_PRINTK(format, args...) \ 161 printk(KERN_DEBUG format , ## args) 163 #define LNK_PRINTK(format, args...) 165 #if NDEBUG & NDEBUG_MAIN 166 #define MAIN_PRINTK(format, args...) \ 167 printk(KERN_DEBUG format , ## args) 169 #define MAIN_PRINTK(format, args...) 171 #if NDEBUG & NDEBUG_NO_DATAOUT 172 #define NDAT_PRINTK(format, args...) \ 173 printk(KERN_DEBUG format , ## args) 175 #define NDAT_PRINTK(format, args...) 177 #if NDEBUG & NDEBUG_NO_WRITE 178 #define NWR_PRINTK(format, args...) \ 179 printk(KERN_DEBUG format , ## args) 181 #define NWR_PRINTK(format, args...) 183 #if NDEBUG & NDEBUG_PIO 184 #define PIO_PRINTK(format, args...) \ 185 printk(KERN_DEBUG format , ## args) 187 #define PIO_PRINTK(format, args...) 189 #if NDEBUG & NDEBUG_PSEUDO_DMA 190 #define PDMA_PRINTK(format, args...) \ 191 printk(KERN_DEBUG format , ## args) 193 #define PDMA_PRINTK(format, args...) 195 #if NDEBUG & NDEBUG_QUEUES 196 #define QU_PRINTK(format, args...) \ 197 printk(KERN_DEBUG format , ## args) 199 #define QU_PRINTK(format, args...) 201 #if NDEBUG & NDEBUG_RESELECTION 202 #define RSL_PRINTK(format, args...) \ 203 printk(KERN_DEBUG format , ## args) 205 #define RSL_PRINTK(format, args...) 207 #if NDEBUG & NDEBUG_SELECTION 208 #define SEL_PRINTK(format, args...) \ 209 printk(KERN_DEBUG format , ## args) 211 #define SEL_PRINTK(format, args...) 213 #if NDEBUG & NDEBUG_USLEEP 214 #define USL_PRINTK(format, args...) \ 215 printk(KERN_DEBUG format , ## args) 217 #define USL_PRINTK(format, args...) 219 #if NDEBUG & NDEBUG_LAST_BYTE_SENT 220 #define LBS_PRINTK(format, args...) \ 221 printk(KERN_DEBUG format , ## args) 223 #define LBS_PRINTK(format, args...) 225 #if NDEBUG & NDEBUG_RESTART_SELECT 226 #define RSS_PRINTK(format, args...) \ 227 printk(KERN_DEBUG format , ## args) 229 #define RSS_PRINTK(format, args...) 231 #if NDEBUG & NDEBUG_EXTENDED 232 #define EXT_PRINTK(format, args...) \ 233 printk(KERN_DEBUG format , ## args) 235 #define EXT_PRINTK(format, args...) 237 #if NDEBUG & NDEBUG_ABORT 238 #define ABRT_PRINTK(format, args...) \ 239 printk(KERN_DEBUG format , ## args) 241 #define ABRT_PRINTK(format, args...) 243 #if NDEBUG & NDEBUG_TAGS 244 #define TAG_PRINTK(format, args...) \ 245 printk(KERN_DEBUG format , ## args) 247 #define TAG_PRINTK(format, args...) 249 #if NDEBUG & NDEBUG_MERGING 250 #define MER_PRINTK(format, args...) \ 251 printk(KERN_DEBUG format , ## args) 253 #define MER_PRINTK(format, args...) 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 */ 272 #endif/* ATARI_SCSI_H */