sym53c8xx.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
  3. * of PCI-SCSI IO processors.
  4. *
  5. * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
  6. *
  7. * This driver is derived from the Linux sym53c8xx driver.
  8. * Copyright (C) 1998-2000 Gerard Roudier
  9. *
  10. * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
  11. * a port of the FreeBSD ncr driver to Linux-1.2.13.
  12. *
  13. * The original ncr driver has been written for 386bsd and FreeBSD by
  14. * Wolfgang Stanglmeier <wolf@cologne.de>
  15. * Stefan Esser <se@mi.Uni-Koeln.de>
  16. * Copyright (C) 1994 Wolfgang Stanglmeier
  17. *
  18. * Other major contributions:
  19. *
  20. * NVRAM detection and reading.
  21. * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
  22. *
  23. *-----------------------------------------------------------------------------
  24. *
  25. * This program is free software; you can redistribute it and/or modify
  26. * it under the terms of the GNU General Public License as published by
  27. * the Free Software Foundation; either version 2 of the License, or
  28. * (at your option) any later version.
  29. *
  30. * This program is distributed in the hope that it will be useful,
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. * GNU General Public License for more details.
  34. *
  35. * You should have received a copy of the GNU General Public License
  36. * along with this program; if not, write to the Free Software
  37. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  38. */
  39. #ifndef SYM53C8XX_H
  40. #define SYM53C8XX_H
  41. /*
  42. * DMA addressing mode.
  43. *
  44. * 0 : 32 bit addressing for all chips.
  45. * 1 : 40 bit addressing when supported by chip.
  46. * 2 : 64 bit addressing when supported by chip,
  47. * limited to 16 segments of 4 GB -> 64 GB max.
  48. */
  49. #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
  50. /*
  51. * NVRAM support.
  52. */
  53. #if 1
  54. #define SYM_CONF_NVRAM_SUPPORT (1)
  55. #endif
  56. /*
  57. * These options are not tunable from 'make config'
  58. */
  59. #if 1
  60. #define SYM_LINUX_PROC_INFO_SUPPORT
  61. #define SYM_LINUX_USER_COMMAND_SUPPORT
  62. #define SYM_LINUX_USER_INFO_SUPPORT
  63. #define SYM_LINUX_DEBUG_CONTROL_SUPPORT
  64. #endif
  65. /*
  66. * Also handle old NCR chips if not (0).
  67. */
  68. #define SYM_CONF_GENERIC_SUPPORT (1)
  69. /*
  70. * Allow tags from 2 to 256, default 8
  71. */
  72. #ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
  73. #define CONFIG_SCSI_SYM53C8XX_MAX_TAGS (8)
  74. #endif
  75. #if CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
  76. #define SYM_CONF_MAX_TAG (2)
  77. #elif CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
  78. #define SYM_CONF_MAX_TAG (256)
  79. #else
  80. #define SYM_CONF_MAX_TAG CONFIG_SCSI_SYM53C8XX_MAX_TAGS
  81. #endif
  82. #ifndef CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
  83. #define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS SYM_CONF_MAX_TAG
  84. #endif
  85. /*
  86. * Anyway, we configure the driver for at least 64 tags per LUN. :)
  87. */
  88. #if SYM_CONF_MAX_TAG <= 64
  89. #define SYM_CONF_MAX_TAG_ORDER (6)
  90. #elif SYM_CONF_MAX_TAG <= 128
  91. #define SYM_CONF_MAX_TAG_ORDER (7)
  92. #else
  93. #define SYM_CONF_MAX_TAG_ORDER (8)
  94. #endif
  95. /*
  96. * Max number of SG entries.
  97. */
  98. #define SYM_CONF_MAX_SG (96)
  99. /*
  100. * Driver setup structure.
  101. *
  102. * This structure is initialized from linux config options.
  103. * It can be overridden at boot-up by the boot command line.
  104. */
  105. struct sym_driver_setup {
  106. u_short max_tag;
  107. u_char burst_order;
  108. u_char scsi_led;
  109. u_char scsi_diff;
  110. u_char irq_mode;
  111. u_char scsi_bus_check;
  112. u_char host_id;
  113. u_char verbose;
  114. u_char settle_delay;
  115. u_char use_nvram;
  116. u_long excludes[8];
  117. };
  118. #define SYM_SETUP_MAX_TAG sym_driver_setup.max_tag
  119. #define SYM_SETUP_BURST_ORDER sym_driver_setup.burst_order
  120. #define SYM_SETUP_SCSI_LED sym_driver_setup.scsi_led
  121. #define SYM_SETUP_SCSI_DIFF sym_driver_setup.scsi_diff
  122. #define SYM_SETUP_IRQ_MODE sym_driver_setup.irq_mode
  123. #define SYM_SETUP_SCSI_BUS_CHECK sym_driver_setup.scsi_bus_check
  124. #define SYM_SETUP_HOST_ID sym_driver_setup.host_id
  125. #define boot_verbose sym_driver_setup.verbose
  126. /*
  127. * Initial setup.
  128. *
  129. * Can be overriden at startup by a command line.
  130. */
  131. #define SYM_LINUX_DRIVER_SETUP { \
  132. .max_tag = CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS, \
  133. .burst_order = 7, \
  134. .scsi_led = 1, \
  135. .scsi_diff = 1, \
  136. .irq_mode = 0, \
  137. .scsi_bus_check = 1, \
  138. .host_id = 7, \
  139. .verbose = 0, \
  140. .settle_delay = 3, \
  141. .use_nvram = 1, \
  142. }
  143. extern struct sym_driver_setup sym_driver_setup;
  144. extern unsigned int sym_debug_flags;
  145. #define DEBUG_FLAGS sym_debug_flags
  146. /*
  147. * Max number of targets.
  148. * Maximum is 16 and you are advised not to change this value.
  149. */
  150. #ifndef SYM_CONF_MAX_TARGET
  151. #define SYM_CONF_MAX_TARGET (16)
  152. #endif
  153. /*
  154. * Max number of logical units.
  155. * SPI-2 allows up to 64 logical units, but in real life, target
  156. * that implements more that 7 logical units are pretty rare.
  157. * Anyway, the cost of accepting up to 64 logical unit is low in
  158. * this driver, thus going with the maximum is acceptable.
  159. */
  160. #ifndef SYM_CONF_MAX_LUN
  161. #define SYM_CONF_MAX_LUN (64)
  162. #endif
  163. /*
  164. * Max number of IO control blocks queued to the controller.
  165. * Each entry needs 8 bytes and the queues are allocated contiguously.
  166. * Since we donnot want to allocate more than a page, the theorical
  167. * maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
  168. * access method. :)
  169. * When not supplied, as it is suggested, the driver compute some
  170. * good value for this parameter.
  171. */
  172. /* #define SYM_CONF_MAX_START (PAGE_SIZE/8 - 16) */
  173. /*
  174. * Support for Immediate Arbitration.
  175. * Not advised.
  176. */
  177. /* #define SYM_CONF_IARB_SUPPORT */
  178. /*
  179. * Only relevant if IARB support configured.
  180. * - Max number of successive settings of IARB hints.
  181. * - Set IARB on arbitration lost.
  182. */
  183. #define SYM_CONF_IARB_MAX 3
  184. #define SYM_CONF_SET_IARB_ON_ARB_LOST 1
  185. /*
  186. * Returning wrong residuals may make problems.
  187. * When zero, this define tells the driver to
  188. * always return 0 as transfer residual.
  189. * Btw, all my testings of residuals have succeeded.
  190. */
  191. #define SYM_SETUP_RESIDUAL_SUPPORT 1
  192. #endif /* SYM53C8XX_H */