dtc.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. static int dtc_abort(Scsi_Cmnd *);
  30. static int dtc_biosparam(struct scsi_device *, struct block_device *,
  31. sector_t, int*);
  32. static int dtc_detect(Scsi_Host_Template *);
  33. static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  34. static int dtc_bus_reset(Scsi_Cmnd *);
  35. #ifndef CMD_PER_LUN
  36. #define CMD_PER_LUN 2
  37. #endif
  38. #ifndef CAN_QUEUE
  39. #define CAN_QUEUE 32
  40. #endif
  41. #define NCR5380_implementation_fields \
  42. void __iomem *base
  43. #define NCR5380_local_declare() \
  44. void __iomem *base
  45. #define NCR5380_setup(instance) \
  46. base = ((struct NCR5380_hostdata *)(instance)->hostdata)->base
  47. #define DTC_address(reg) (base + DTC_5380_OFFSET + reg)
  48. #define dbNCR5380_read(reg) \
  49. (rval=readb(DTC_address(reg)), \
  50. (((unsigned char) printk("DTC : read register %d at addr %p is: %02x\n"\
  51. , (reg), DTC_address(reg), rval)), rval ) )
  52. #define dbNCR5380_write(reg, value) do { \
  53. printk("DTC : write %02x to register %d at address %p\n", \
  54. (value), (reg), DTC_address(reg)); \
  55. writeb(value, DTC_address(reg));} while(0)
  56. #if !(DTCDEBUG & DTCDEBUG_TRANSFER)
  57. #define NCR5380_read(reg) (readb(DTC_address(reg)))
  58. #define NCR5380_write(reg, value) (writeb(value, DTC_address(reg)))
  59. #else
  60. #define NCR5380_read(reg) (readb(DTC_address(reg)))
  61. #define xNCR5380_read(reg) \
  62. (((unsigned char) printk("DTC : read register %d at address %p\n"\
  63. , (reg), DTC_address(reg))), readb(DTC_address(reg)))
  64. #define NCR5380_write(reg, value) do { \
  65. printk("DTC : write %02x to register %d at address %p\n", \
  66. (value), (reg), DTC_address(reg)); \
  67. writeb(value, DTC_address(reg));} while(0)
  68. #endif
  69. #define NCR5380_intr dtc_intr
  70. #define NCR5380_queue_command dtc_queue_command
  71. #define NCR5380_abort dtc_abort
  72. #define NCR5380_bus_reset dtc_bus_reset
  73. #define NCR5380_proc_info dtc_proc_info
  74. /* 15 12 11 10
  75. 1001 1100 0000 0000 */
  76. #define DTC_IRQS 0x9c00
  77. #endif /* DTC3280_H */