atari_scsi.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:7k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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