qlogicfas408.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* to be used by qlogicfas and qlogic_cs */
  2. #ifndef __QLOGICFAS408_H
  3. #define __QLOGICFAS408_H
  4. /*----------------------------------------------------------------*/
  5. /* Configuration */
  6. /* Set the following to max out the speed of the PIO PseudoDMA transfers,
  7. again, 0 tends to be slower, but more stable. */
  8. #define QL_TURBO_PDMA 1
  9. /* This should be 1 to enable parity detection */
  10. #define QL_ENABLE_PARITY 1
  11. /* This will reset all devices when the driver is initialized (during bootup).
  12. The other linux drivers don't do this, but the DOS drivers do, and after
  13. using DOS or some kind of crash or lockup this will bring things back
  14. without requiring a cold boot. It does take some time to recover from a
  15. reset, so it is slower, and I have seen timeouts so that devices weren't
  16. recognized when this was set. */
  17. #define QL_RESET_AT_START 0
  18. /* crystal frequency in megahertz (for offset 5 and 9)
  19. Please set this for your card. Most Qlogic cards are 40 Mhz. The
  20. Control Concepts ISA (not VLB) is 24 Mhz */
  21. #define XTALFREQ 40
  22. /**********/
  23. /* DANGER! modify these at your own risk */
  24. /* SLOWCABLE can usually be reset to zero if you have a clean setup and
  25. proper termination. The rest are for synchronous transfers and other
  26. advanced features if your device can transfer faster than 5Mb/sec.
  27. If you are really curious, email me for a quick howto until I have
  28. something official */
  29. /**********/
  30. /*****/
  31. /* config register 1 (offset 8) options */
  32. /* This needs to be set to 1 if your cabling is long or noisy */
  33. #define SLOWCABLE 1
  34. /*****/
  35. /* offset 0xc */
  36. /* This will set fast (10Mhz) synchronous timing when set to 1
  37. For this to have an effect, FASTCLK must also be 1 */
  38. #define FASTSCSI 0
  39. /* This when set to 1 will set a faster sync transfer rate */
  40. #define FASTCLK 0 /*(XTALFREQ>25?1:0)*/
  41. /*****/
  42. /* offset 6 */
  43. /* This is the sync transfer divisor, XTALFREQ/X will be the maximum
  44. achievable data rate (assuming the rest of the system is capable
  45. and set properly) */
  46. #define SYNCXFRPD 5 /*(XTALFREQ/5)*/
  47. /*****/
  48. /* offset 7 */
  49. /* This is the count of how many synchronous transfers can take place
  50. i.e. how many reqs can occur before an ack is given.
  51. The maximum value for this is 15, the upper bits can modify
  52. REQ/ACK assertion and deassertion during synchronous transfers
  53. If this is 0, the bus will only transfer asynchronously */
  54. #define SYNCOFFST 0
  55. /* for the curious, bits 7&6 control the deassertion delay in 1/2 cycles
  56. of the 40Mhz clock. If FASTCLK is 1, specifying 01 (1/2) will
  57. cause the deassertion to be early by 1/2 clock. Bits 5&4 control
  58. the assertion delay, also in 1/2 clocks (FASTCLK is ignored here). */
  59. /*----------------------------------------------------------------*/
  60. struct qlogicfas408_priv {
  61. int qbase; /* Port */
  62. int qinitid; /* initiator ID */
  63. int qabort; /* Flag to cause an abort */
  64. int qlirq; /* IRQ being used */
  65. int int_type; /* type of irq, 2 for ISA board, 0 for PCMCIA */
  66. char qinfo[80]; /* description */
  67. struct scsi_cmnd *qlcmd; /* current command being processed */
  68. struct Scsi_Host *shost; /* pointer back to host */
  69. struct qlogicfas408_priv *next; /* next private struct */
  70. };
  71. /* The qlogic card uses two register maps - These macros select which one */
  72. #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
  73. #define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | int_type, qbase + 0xd ))
  74. /* following is watchdog timeout in microseconds */
  75. #define WATCHDOG 5000000
  76. /*----------------------------------------------------------------*/
  77. /* the following will set the monitor border color (useful to find
  78. where something crashed or gets stuck at and as a simple profiler) */
  79. #define rtrc(i) {}
  80. #define get_priv_by_cmd(x) (struct qlogicfas408_priv *)&((x)->device->host->hostdata[0])
  81. #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0])
  82. irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id);
  83. int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd);
  84. int qlogicfas408_biosparam(struct scsi_device * disk,
  85. struct block_device *dev,
  86. sector_t capacity, int ip[]);
  87. int qlogicfas408_abort(struct scsi_cmnd * cmd);
  88. int qlogicfas408_bus_reset(struct scsi_cmnd * cmd);
  89. const char *qlogicfas408_info(struct Scsi_Host *host);
  90. int qlogicfas408_get_chip_type(int qbase, int int_type);
  91. void qlogicfas408_setup(int qbase, int id, int int_type);
  92. int qlogicfas408_detect(int qbase, int int_type);
  93. void qlogicfas408_disable_ints(struct qlogicfas408_priv *priv);
  94. #endif /* __QLOGICFAS408_H */