g_NCR5380.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * Generic Generic NCR5380 driver defines
  3. *
  4. * Copyright 1993, Drew Eckhardt
  5. * Visionary Computing
  6. * (Unix and Linux consulting and custom programming)
  7. * drew@colorado.edu
  8. * +1 (303) 440-4894
  9. *
  10. * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
  11. * K.Lentin@cs.monash.edu.au
  12. *
  13. * ALPHA RELEASE 1.
  14. *
  15. * For more information, please consult
  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. /*
  28. * $Log: generic_NCR5380.h,v $
  29. */
  30. #ifndef GENERIC_NCR5380_H
  31. #define GENERIC_NCR5380_H
  32. #include <linux/config.h>
  33. #define GENERIC_NCR5380_PUBLIC_RELEASE 1
  34. #ifdef NCR53C400
  35. #define BIOSPARAM
  36. #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
  37. #else
  38. #define NCR5380_BIOSPARAM NULL
  39. #endif
  40. #ifndef ASM
  41. static int generic_NCR5380_abort(Scsi_Cmnd *);
  42. static int generic_NCR5380_detect(struct scsi_host_template *);
  43. static int generic_NCR5380_release_resources(struct Scsi_Host *);
  44. static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
  45. static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
  46. static const char* generic_NCR5380_info(struct Scsi_Host *);
  47. #ifndef CMD_PER_LUN
  48. #define CMD_PER_LUN 2
  49. #endif
  50. #ifndef CAN_QUEUE
  51. #define CAN_QUEUE 16
  52. #endif
  53. #ifndef HOSTS_C
  54. #define __STRVAL(x) #x
  55. #define STRVAL(x) __STRVAL(x)
  56. #ifndef CONFIG_SCSI_G_NCR5380_MEM
  57. #define NCR5380_map_config port
  58. #define NCR5380_map_type int
  59. #define NCR5380_map_name port
  60. #define NCR5380_instance_name io_port
  61. #define NCR53C400_register_offset 0
  62. #define NCR53C400_address_adjust 8
  63. #ifdef NCR53C400
  64. #define NCR5380_region_size 16
  65. #else
  66. #define NCR5380_region_size 8
  67. #endif
  68. #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
  69. #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
  70. #define NCR5380_implementation_fields \
  71. NCR5380_map_type NCR5380_map_name
  72. #define NCR5380_local_declare() \
  73. register NCR5380_implementation_fields
  74. #define NCR5380_setup(instance) \
  75. NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
  76. #else
  77. /* therefore CONFIG_SCSI_G_NCR5380_MEM */
  78. #define NCR5380_map_config memory
  79. #define NCR5380_map_type unsigned long
  80. #define NCR5380_map_name base
  81. #define NCR5380_instance_name base
  82. #define NCR53C400_register_offset 0x108
  83. #define NCR53C400_address_adjust 0
  84. #define NCR53C400_mem_base 0x3880
  85. #define NCR53C400_host_buffer 0x3900
  86. #define NCR5380_region_size 0x3a00
  87. #define NCR5380_read(reg) readb(iomem + NCR53C400_mem_base + (reg))
  88. #define NCR5380_write(reg, value) writeb(value, iomem + NCR53C400_mem_base + (reg))
  89. #define NCR5380_implementation_fields \
  90. NCR5380_map_type NCR5380_map_name; \
  91. void __iomem *iomem;
  92. #define NCR5380_local_declare() \
  93. register void __iomem *iomem
  94. #define NCR5380_setup(instance) \
  95. iomem = (((struct NCR5380_hostdata *)(instance)->hostdata).iomem)
  96. #endif
  97. #define NCR5380_intr generic_NCR5380_intr
  98. #define NCR5380_queue_command generic_NCR5380_queue_command
  99. #define NCR5380_abort generic_NCR5380_abort
  100. #define NCR5380_bus_reset generic_NCR5380_bus_reset
  101. #define NCR5380_pread generic_NCR5380_pread
  102. #define NCR5380_pwrite generic_NCR5380_pwrite
  103. #define NCR5380_proc_info notyet_generic_proc_info
  104. #define BOARD_NCR5380 0
  105. #define BOARD_NCR53C400 1
  106. #define BOARD_NCR53C400A 2
  107. #define BOARD_DTC3181E 3
  108. #endif /* else def HOSTS_C */
  109. #endif /* ndef ASM */
  110. #endif /* GENERIC_NCR5380_H */