atari_scsi.h 6.6 KB

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