dtc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * DTC controller, taken from T128 driver by...
  3. * Copyright 1993, Drew Eckhardt
  4. * Visionary Computing
  5. * (Unix and Linux consulting and custom programming)
  6. * drew@colorado.edu
  7. * +1 (303) 440-4894
  8. *
  9. * DISTRIBUTION RELEASE 2.
  10. *
  11. * For more information, please consult
  12. *
  13. *
  14. *
  15. * and
  16. *
  17. * NCR 5380 Family
  18. * SCSI Protocol Controller
  19. * Databook
  20. *
  21. * NCR Microelectronics
  22. * 1635 Aeroplaza Drive
  23. * Colorado Springs, CO 80916
  24. * 1+ (719) 578-3400
  25. * 1+ (800) 334-5454
  26. */
  27. #ifndef DTC3280_H
  28. #define DTC3280_H
  29. #define DTCDEBUG 0
  30. #define DTCDEBUG_INIT 0x1
  31. #define DTCDEBUG_TRANSFER 0x2
  32. static int dtc_abort(Scsi_Cmnd *);
  33. static int dtc_biosparam(struct scsi_device *, struct block_device *,
  34. sector_t, int*);
  35. static int dtc_detect(struct scsi_host_template *);
  36. static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  37. static int dtc_bus_reset(Scsi_Cmnd *);
  38. #ifndef CMD_PER_LUN
  39. #define CMD_PER_LUN 2
  40. #endif
  41. #ifndef CAN_QUEUE
  42. #define CAN_QUEUE 32
  43. #endif
  44. #define NCR5380_implementation_fields \
  45. void __iomem *base
  46. #define NCR5380_local_declare() \
  47. void __iomem *base
  48. #define NCR5380_setup(instance) \
  49. base = ((struct NCR5380_hostdata *)(instance)->hostdata)->base
  50. #define DTC_address(reg) (base + DTC_5380_OFFSET + reg)
  51. #define dbNCR5380_read(reg) \
  52. (rval=readb(DTC_address(reg)), \
  53. (((unsigned char) printk("DTC : read register %d at addr %p is: %02x\n"\
  54. , (reg), DTC_address(reg), rval)), rval ) )
  55. #define dbNCR5380_write(reg, value) do { \
  56. printk("DTC : write %02x to register %d at address %p\n", \
  57. (value), (reg), DTC_address(reg)); \
  58. writeb(value, DTC_address(reg));} while(0)
  59. #if !(DTCDEBUG & DTCDEBUG_TRANSFER)
  60. #define NCR5380_read(reg) (readb(DTC_address(reg)))
  61. #define NCR5380_write(reg, value) (writeb(value, DTC_address(reg)))
  62. #else
  63. #define NCR5380_read(reg) (readb(DTC_address(reg)))
  64. #define xNCR5380_read(reg) \
  65. (((unsigned char) printk("DTC : read register %d at address %p\n"\
  66. , (reg), DTC_address(reg))), readb(DTC_address(reg)))
  67. #define NCR5380_write(reg, value) do { \
  68. printk("DTC : write %02x to register %d at address %p\n", \
  69. (value), (reg), DTC_address(reg)); \
  70. writeb(value, DTC_address(reg));} while(0)
  71. #endif
  72. #define NCR5380_intr dtc_intr
  73. #define NCR5380_queue_command dtc_queue_command
  74. #define NCR5380_abort dtc_abort
  75. #define NCR5380_bus_reset dtc_bus_reset
  76. #define NCR5380_proc_info dtc_proc_info
  77. /* 15 12 11 10
  78. 1001 1100 0000 0000 */
  79. #define DTC_IRQS 0x9c00
  80. #endif /* DTC3280_H */